/* index.css - Clean consolidated styling with fixed table sizing and centered headers */

/* ========== CUSTOM SCROLLBARS ========== */
#tableContainer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#tableContainer::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#tableContainer::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#tableContainer::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#unobligatedActivityList::-webkit-scrollbar,
#projectedBURList::-webkit-scrollbar {
  width: 6px;
}

#unobligatedActivityList::-webkit-scrollbar-track,
#projectedBURList::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

#unobligatedActivityList::-webkit-scrollbar-thumb,
#projectedBURList::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

#unobligatedActivityList::-webkit-scrollbar-thumb:hover,
#projectedBURList::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

#tableContainer,
#unobligatedActivityList,
#projectedBURList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ========== FIXED TABLE CONTAINER SIZING ========== */
#tableContainer {
  height: 60vh !important;
  min-height: 60vh !important;
  max-height: 60vh !important;
}

#tableView .bg-white.rounded-2xl {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
}

#budgetTableBody {
  min-height: auto;
}

.empty-table-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  text-align: center;
}

.empty-table-state i {
  margin-bottom: 1rem;
}

#tableView > div > div {
  min-height: 80vh;
  max-height: 90vh;
}

/* ========== ANIMATIONS AND TRANSITIONS ========== */
#tableView {
  animation: fadeIn 0.3s ease-out;
}

#tableView > div {
  animation: slideUp 0.3s ease-out;
}



#mainChartView,
#projectionView {
  transition: opacity 0.3s ease-in-out;
}

/* ========== SUMMARY CARDS ========== */
.summary-card-blue {
  background-color: rgb(239, 246, 255);
  color: rgb(20, 71, 230);
  border: 2px solid transparent;
}

.summary-card-green {
  background-color: rgb(240, 253, 244);
  color: rgb(21, 128, 61);
  border: 2px solid transparent;
}

.summary-card-purple {
  background-color: rgb(250, 245, 255);
  color: rgb(126, 34, 206);
  border: 2px solid transparent;
}

.summary-card-orange {
  background-color: rgb(255, 247, 237);
  color: rgb(194, 65, 12);
  border: 2px solid transparent;
}

.summary-card-blue:hover {
  border-color: rgb(20, 71, 230);
  box-shadow: 0 4px 12px rgba(20, 71, 230, 0.15);
}

.summary-card-green:hover {
  border-color: rgb(21, 128, 61);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.15);
}

.summary-card-purple:hover {
  border-color: rgb(126, 34, 206);
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.15);
}

.summary-card-orange:hover {
  border-color: rgb(194, 65, 12);
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.15);
}

/* ========== BUTTON STYLES ========== */
button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

.bg-blue-600:hover,
.bg-green-600:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.border-blue-600:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3);
}

/* ========== TABLE STYLES ========== */
#budgetTableBody tr {
  transition: all 0.2s ease;
  position: relative;
}

#budgetTableBody tr:hover {
  background-color: #f8fafc;
  transform: scale(1.002);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
}

#budgetTable thead th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background-color: rgba(248, 250, 252, 0.95);
}

/* ========== TABLE COLUMN STYLES ========== */
.allocation-column {
  background-color: rgb(240, 253, 244) !important;
  color: rgb(21, 128, 61) !important;
}

.allocation-data {
  background-color: rgb(240, 253, 244) !important;
}

.obligation-column {
  background-color: rgb(239, 246, 255) !important;
  color: rgb(20, 71, 230) !important;
}

.obligation-data {
  background-color: rgb(239, 246, 255) !important;
}

.bur-column {
  background-color: rgb(255, 247, 237) !important;
  color: rgb(194, 65, 12) !important;
}

.bur-data {
  background-color: rgb(255, 247, 237) !important;
}

.unobligated-column {
  background-color: rgb(254, 242, 242) !important;
  color: rgb(185, 28, 28) !important;
}

.unobligated-data {
  background-color: rgb(254, 242, 242) !important;
}

/* ========== TABLE COLUMN WIDTHS ========== */
#budgetTable th:nth-child(1), #budgetTable td:nth-child(1) {
  min-width: 80px !important;
  max-width: 80px !important;
}

#budgetTable th:nth-child(2), #budgetTable td:nth-child(2) {
  min-width: 160px !important;
  max-width: 160px !important;
}

#budgetTable th:nth-child(3), #budgetTable td:nth-child(3) {
  min-width: 160px !important;
  max-width: 160px !important;
}

#budgetTable th:nth-child(4), #budgetTable td:nth-child(4) {
  min-width: 180px !important;
  max-width: 180px !important;
}

#budgetTable th:nth-child(5), #budgetTable td:nth-child(5) {
  min-width: 100px !important;
  max-width: 100px !important;
}

#budgetTable th:nth-child(6), #budgetTable td:nth-child(6) {
  min-width: 80px !important;
  max-width: 80px !important;
}

#budgetTable th:nth-child(7), #budgetTable td:nth-child(7) {
  min-width: 80px !important;
  max-width: 80px !important;
}

#budgetTable th:nth-child(8), #budgetTable td:nth-child(8) {
  min-width: 80px !important;
  max-width: 80px !important;
}

#budgetTable th:nth-child(9), #budgetTable td:nth-child(9) {
  min-width: 80px !important;
  max-width: 80px !important;
}

/* ========== TABLE ALIGNMENT ========== */
/* Center align ALL column headers */
#budgetTable thead th {
  text-align: center !important;
}

#budgetTable thead th div {
  justify-content: center !important;
}

/* Content alignment remains the same as before */
#budgetTable td:nth-child(-n+5) {
  text-align: left !important;
}

#budgetTable td.allocation-data,
#budgetTable td.obligation-data,
#budgetTable td.unobligated-data {
  text-align: right !important;
}

#budgetTable td.bur-data {
  text-align: center !important;
}

/* ========== TABLE TEXT STYLING ========== */
#budgetTable td div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

#budgetTable td:nth-child(-n+5) div {
  text-align: left;
}

#budgetTable td.allocation-data div,
#budgetTable td.obligation-data div,
#budgetTable td.unobligated-data div {
  text-align: right;
}

#budgetTable td.bur-data div {
  text-align: center;
}

#budgetTable td .whitespace-normal {
  padding: 2px 0;
}

#budgetTableBody tr:hover td {
  background-color: #f8fafc;
}

#budgetTableBody tr:hover .allocation-data,
#budgetTableBody tr:hover .obligation-data,
#budgetTableBody tr:hover .bur-data,
#budgetTableBody tr:hover .unobligated-data {
  background-color: inherit !important;
}

/* ========== FILTER & CHIP STYLES ========== */
.filter-btn,
.program-chip {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.filter-btn:hover,
.program-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.15);
}

.program-chip.bg-blue-600 {
  box-shadow: 0 2px 8px -1px rgba(59, 130, 246, 0.4);
}

/* ========== CHART CONTAINERS ========== */
.bg-white.rounded-2xl {
  transition: all 0.3s ease;
}

.bg-white.rounded-2xl:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========== ACTIVITY LIST STYLES ========== */
#unobligatedActivityList > div,
#projectedBURList > div {
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

#unobligatedActivityList > div:hover,
#projectedBURList > div:hover {
  transform: translateX(4px);
  border-color: #e5e7eb;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

/* ========== UTILITY CLASSES ========== */
.rounded-2xl { border-radius: 1rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-lg { border-radius: 0.5rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* ========== ACCESSIBILITY ========== */
button:focus,
.program-chip:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (prefers-contrast: high) {
  .bg-white { border: 1px solid #000; }
  .text-gray-600 { color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .grid { gap: 1rem; }
  
  #tableContainer {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    height: 50vh !important;
    min-height: 50vh !important;
    max-height: 50vh !important;
  }
  
  .flex.justify-center.gap-4 {
    flex-direction: column;
    align-items: center;
  }
  
  .flex.justify-center.gap-4 button {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 1024px) {
  .grid-cols-1.lg\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  button,
  #toggleProjection,
  #toggleTableView {
    display: none !important;
  }
  
  #tableView:not(.hidden) {
    position: relative !important;
    background: white !important;
  }
  
  #tableView .bg-black\/50 {
    background: white !important;
  }
}


/* Add to index.css - FIXED VERSION */
/* Remove any problematic CSS that affects height */
.bg-white.rounded-2xl .relative {
  position: relative;
  width: 100%;
  height: 400px; /* Fixed height */
}

.bg-white.rounded-2xl canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Ensure the chart container maintains fixed height */
.relative.h-\[400px\] {
  height: 400px !important;
  min-height: 400px !important;
  max-height: 400px !important;
}

/* Remove any flex-grow or auto-height properties that might be causing expansion */
#projectionView .bg-white.rounded-2xl,
#mainChartView .bg-white.rounded-2xl {
  height: auto;
  min-height: auto;
}

/* Better responsive behavior - width only */
@media (max-width: 768px) {
  .bg-white.rounded-2xl {
    padding: 1.5rem !important;
  }
  
  /* Keep height fixed, only adjust width */
  .bg-white.rounded-2xl .relative.h-\[400px\] {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
  }
  
  /* Allow chart to shrink horizontally but maintain height */
  .bg-white.rounded-2xl canvas {
    max-width: 100%;
    height: 400px !important;
  }
}

/* Add to index.css */
.relative.h-\[400px\] {
  position: relative !important;
}

.data-label {
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ========== CLEAN CHART FIXES ========== */
/* Remove any problematic chart positioning */
.bg-white.rounded-2xl .relative {
  position: relative !important;
  width: 100% !important;
  height: 400px !important;
}

.bg-white.rounded-2xl canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Ensure proper chart container sizing */
.relative.h-\[400px\] {
  height: 400px !important;
  min-height: 400px !important;
  max-height: 400px !important;
}

/* Clean data label styles */
.data-label {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

.obligation-label {
  background-color: #34a853;
  color: white;
}

.bur-label {
  background-color: #ff6d01;
  color: white;
}

/* Remove any flex-grow that might affect chart containers */
#projectionView .bg-white.rounded-2xl,
#mainChartView .bg-white.rounded-2xl {
  display: flex;
  flex-direction: column;
}

/* Clean responsive behavior */
@media (max-width: 768px) {
  .bg-white.rounded-2xl {
    padding: 1rem !important;
  }
  
  .bg-white.rounded-2xl .relative.h-\[400px\] {
    height: 350px !important;
  }
}

/* Remove any chartjs default margins */
.chartjs-render-monitor {
  margin: 0 !important;
  padding: 0 !important;
}



