:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f0f4f8;
  --bg-tertiary: #e3f2fd;
  --text-primary: #333;
  --text-secondary: #666;
  --accent-color: #00796b;
  --border-color: #ddd;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(to right, #e0f2f1, #ffffff);
  --info-bg: #e3f2fd;
  --warning-bg: #fff3e0;
  --pslf-bg: #e8f5e9;
  --past-payments-bg: #f3e5f5;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3d3d3d;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --accent-color: #4db6ac;
  --border-color: #555;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(to right, #2d2d2d, #1a1a1a);
  --info-bg: #2d2d2d;
  --warning-bg: #3d3d3d;
  --pslf-bg: #2d2d2d;
  --past-payments-bg: #3d3d3d;
}

body {
  font-family: Arial, sans-serif;
  padding: 2rem;
  background: var(--gradient);
  color: var(--text-primary);
  max-width: 1200px;
  margin: auto;
  transition: background 0.3s ease, color 0.3s ease;
}

.header-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.save-notification {
  background: #4caf50;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  animation: fadeInOut 2s ease-in-out;
  opacity: 0;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.dark-mode-toggle {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.dark-mode-toggle:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  transform: scale(1.1);
}

.dark-mode-toggle .dark-icon {
  display: none;
}

[data-theme="dark"] .dark-mode-toggle .light-icon {
  display: none;
}

[data-theme="dark"] .dark-mode-toggle .dark-icon {
  display: block;
}
h1 {
  color: var(--accent-color);
  text-align: center;
}
h2 {
  color: var(--accent-color);
  margin-top: 2rem;
}
.slider-group {
  margin: 1.5rem 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.income-help-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.income-help-btn:hover {
  background: var(--accent-color-dark);
  transform: scale(1.1);
}
input[type="range"] {
  width: 100%;
}
.output,
.glossary,
.chart-wrapper,
.export,
.comparison,
.plan-comparison,
.past-payments-section {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
  transition: background 0.3s ease;
}
label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

input[type="text"], input[type="number"], input[type="email"], input[type="date"], select, textarea {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 121, 107, 0.2);
}

small {
  color: var(--text-secondary);
}
.value-display {
  font-weight: bold;
  color: var(--accent-color);
}
table.dataTable {
  margin-top: 2rem;
  width: 100% !important;
  color: var(--text-primary);
}

/* DataTable dark mode overrides */
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_processing,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate {
  color: var(--text-primary);
}

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-primary) !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--accent-color) !important;
  color: var(--bg-primary) !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent-color) !important;
  color: var(--bg-primary) !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Date input styling for dark mode */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  color: var(--text-primary);
}

[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-text {
  color: var(--text-primary);
}

[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field,
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field,
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text-primary);
}
canvas {
  max-width: 100%;
}
.glossary dt {
  font-weight: bold;
}
.glossary dd {
  margin: 0 0 1rem 0;
}
.settings-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .settings-section {
    grid-template-columns: 1fr;
  }
}
.export-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
button {
  padding: 0.5rem 1rem;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}
button:hover {
  background: var(--accent-color);
  opacity: 0.8;
}

.clear-data-btn {
  background: #f44336 !important;
}

.clear-data-btn:hover {
  background: #d32f2f !important;
}

.add-to-budget-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.add-to-budget-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}

.add-to-budget-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.comparison-item {
  background: white;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.comparison-label {
  font-size: 0.9rem;
  color: #666;
}
.comparison-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-color);
}

.variance {
  font-weight: bold;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.variance.over {
  color: #f44336;
}

.variance.under {
  color: #4caf50;
}
.plan-comparison table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.plan-comparison th,
.plan-comparison td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.plan-comparison th {
  background: var(--accent-color);
  color: var(--bg-primary);
}
.plan-comparison tr:nth-child(even) {
  background: var(--bg-tertiary);
}
.plan-comparison .highlight {
  background: var(--accent-color);
  color: var(--bg-primary);
  font-weight: bold;
}
.info-box {
  background: var(--info-bg);
  border-left: 4px solid var(--accent-color);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 5px;
  transition: background 0.3s ease;
  color: var(--text-primary);
}
.warning-box {
  background: var(--warning-bg);
  border-left: 4px solid #f57c00;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 5px;
  transition: background 0.3s ease;
  color: var(--text-primary);
}
.plan-selector {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.plan-selector label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.past-payments-section {
  background: var(--past-payments-bg);
  border-left: 4px solid #7b1fa2;
  transition: background 0.3s ease;
  color: var(--text-primary);
}
.payment-history-input {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.pslf-info {
  background: var(--pslf-bg);
  border-left: 4px solid #388e3c;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 5px;
  transition: background 0.3s ease;
  color: var(--text-primary);
}

.ibr-version-info {
  background: var(--warning-bg);
  border-left: 4px solid #f57c00;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 5px;
  transition: background 0.3s ease;
  color: var(--text-primary);
}
.forgiveness-timeline {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.timeline-item {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-left: 3px solid var(--accent-color);
  padding-left: 1rem;
}

/* Tab System */
.tab-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.tab-button {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  padding: 1rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-button:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.tab-button.active {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-content {
  width: 100%;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Income & Expense Tracker Styles */
.tracker-section {
  background: var(--bg-secondary);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: background 0.3s ease;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.add-btn {
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.add-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.item-list {
  margin-top: 1rem;
}

.item-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.item-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.item-category {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.item-amount {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--accent-color);
  margin-right: 10px;
}

.edit-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.edit-btn:hover {
  background: #1976d2;
  transform: scale(1.1);
}

.delete-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.delete-btn:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

.cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
}

.cancel-btn:hover {
  background: #5a6268;
  transform: scale(1.05);
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.exclude-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: bold;
}

.exclude-btn:hover {
  background: #f57c00;
  transform: scale(1.1);
}

.exclude-btn.included {
  background: #4caf50;
}

.exclude-btn.included:hover {
  background: #45a049;
}

.item-card.excluded {
  opacity: 0.6;
  background: var(--bg-tertiary);
}

.item-card.excluded .item-amount {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.excluded-badge {
  background: #ff9800;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: inline-block;
}

.due-date {
  color: var(--accent-color);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.item-card.excluded .due-date {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Expense Tabs */
.expense-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.expense-tab-button {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.expense-tab-button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.expense-tab-button.active {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-bottom-color: var(--accent-color);
}

.expense-tab-panel {
  display: none;
}

.expense-tab-panel.active {
  display: block;
}

.actual-expense-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.import-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.import-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}

.comparison-summary {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.comparison-summary h3 {
  margin-top: 0;
  color: var(--accent-color);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.imported-badge {
  background: #2196f3;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: inline-block;
}

.excluded-expenses-info {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  color: #856404;
}

[data-theme="dark"] .excluded-expenses-info {
  background: #2d1b0e;
  border-color: #ff9800;
  color: #ffb74d;
}

.excluded-info-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.excluded-icon {
  font-size: 1.2rem;
}

.excluded-text {
  flex: 1;
  font-weight: bold;
}

.include-all-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.include-all-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-primary);
  margin: 2% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: 1.5rem;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  color: white;
  font-size: 1.5rem;
}

.close-modal {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-body {
  padding: 2rem;
  color: var(--text-primary);
}

.manifesto-content {
  line-height: 1.6;
}

.manifesto-intro {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-style: italic;
}

.manifesto-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 4px solid #e74c3c;
  transition: all 0.3s ease;
}

.manifesto-section:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.manifesto-section h3 {
  color: #e74c3c;
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.manifesto-section p {
  margin: 0;
  color: var(--text-primary);
}

.manifesto-conclusion {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  border-radius: 10px;
  font-style: italic;
  font-size: 1.1rem;
}

.manifesto-conclusion p {
  margin: 0;
  color: white;
}

/* Income Help Modal Styles */
.income-help-content {
  color: var(--text-primary);
}

.income-help-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.income-help-section h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.income-help-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.income-help-section ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.income-help-section li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.income-help-section strong {
  color: var(--accent-color);
}

/* Mobile responsive modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h2 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .manifesto-section {
    padding: 1rem;
    margin: 1.5rem 0;
  }
  
  .manifesto-section h3 {
    font-size: 1.1rem;
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.summary-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-color);
}

.chart-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  height: 400px;
}

/* Mobile Responsive Tables */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .plan-comparison {
    overflow-x: auto;
  }
  
  .plan-comparison table {
    min-width: 800px;
    font-size: 0.9rem;
  }
  
  .plan-comparison th,
  .plan-comparison td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }
  
  /* Stack table data for mobile */
  .plan-comparison-mobile {
    display: block;
  }
  
  .plan-comparison-mobile .plan-row {
    background: var(--bg-secondary);
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
  }
  
  .plan-comparison-mobile .plan-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
  }
  
  .plan-comparison-mobile .plan-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
  }
  
  .plan-comparison-mobile .plan-data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .plan-comparison-mobile .plan-data-item:last-child {
    border-bottom: none;
  }
  
  .plan-comparison-mobile .add-to-budget-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .plan-comparison-mobile .plan-data-label {
    font-weight: bold;
    color: var(--text-secondary);
  }
  
  .plan-comparison-mobile .plan-data-value {
    color: var(--text-primary);
  }
  
  .plan-comparison-mobile .highlight {
    background: var(--accent-color);
    color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
  }
  
  /* Hide desktop table on mobile */
  .plan-comparison-desktop {
    display: none;
  }
  
  /* Show mobile table on mobile */
  .plan-comparison-mobile {
    display: block;
  }
  
  /* Detailed table mobile styles */
  .detailed-table-container {
    overflow-x: auto;
  }
  
  .detailed-table-desktop {
    display: none;
  }
  
  .detailed-table-mobile {
    display: block;
  }
  
  .detailed-table-mobile .year-card {
    background: var(--bg-secondary);
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
  }
  
  .detailed-table-mobile .year-header {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .detailed-table-mobile .year-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
  }
  
  .detailed-table-mobile .data-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .detailed-table-mobile .data-item:last-child {
    border-bottom: none;
  }
  
  .detailed-table-mobile .data-label {
    font-weight: bold;
    color: var(--text-secondary);
  }
  
  .detailed-table-mobile .data-value {
    color: var(--text-primary);
  }
  
  .detailed-table-mobile .payment-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
  }
  
  .detailed-table-mobile .balance-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
  }
  
  /* Mobile table controls */
  .mobile-table-controls {
    display: block !important;
    margin: 1rem 0;
    text-align: center;
  }
  
  .mobile-toggle-btn {
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
  }
  
  .mobile-toggle-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
  }
  
  .mobile-toggle-btn .mobile-text {
    display: none;
  }
  
  .mobile-toggle-btn .desktop-text {
    display: inline;
  }
  
  /* When showing desktop table on mobile */
  .showing-desktop-table .mobile-toggle-btn .desktop-text {
    display: none;
  }
  
  .showing-desktop-table .mobile-toggle-btn .mobile-text {
    display: inline;
  }
  
  .showing-desktop-table .detailed-table-desktop {
    display: block;
  }
  
  .showing-desktop-table .detailed-table-mobile {
    display: none;
  }
  
  /* Mobile responsive tracker */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    height: 300px;
  }
}

@media (min-width: 769px) {
  .plan-comparison-desktop {
    display: table;
  }
  
  .plan-comparison-mobile {
    display: none;
  }
  
  .detailed-table-desktop {
    display: block;
  }
  
  .detailed-table-mobile {
    display: none;
  }
}

/* NoScript Message Styles */
.noscript-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}

.noscript-content {
  background: white;
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  text-align: center;
  animation: noscriptSlideIn 0.5s ease-out;
}

@keyframes noscriptSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.noscript-content h2 {
  color: #667eea;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.noscript-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #333;
  font-size: 1.1rem;
}

.noscript-content strong {
  color: #667eea;
}

.noscript-steps {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.noscript-steps h3 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.noscript-steps ul {
  text-align: left;
  padding-left: 1.5rem;
}

.noscript-steps li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: #555;
}

.noscript-steps strong {
  color: #667eea;
}

/* Dark mode support for noscript */
@media (prefers-color-scheme: dark) {
  .noscript-content {
    background: #2c3e50;
    color: white;
  }
  
  .noscript-content p {
    color: #ecf0f1;
  }
  
  .noscript-steps {
    background: #34495e;
  }
  
  .noscript-steps li {
    color: #bdc3c7;
  }
}

/* Footer Styles */
.app-footer {
  background: var(--bg-secondary);
  border-top: 2px solid var(--border-color);
  margin-top: 3rem;
  padding: 2rem 0 1rem 0;
  color: var(--text-primary);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.footer-section p {
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
}

/* Dark mode footer adjustments */
[data-theme="dark"] .app-footer {
  background: var(--bg-tertiary);
  border-top-color: var(--border-color);
}

[data-theme="dark"] .footer-section h3 {
  color: var(--accent-color);
}

[data-theme="dark"] .footer-section p {
  color: var(--text-secondary);
}

/* Mobile responsive footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .footer-section h3 {
    font-size: 1.1rem;
  }
  
  .footer-section p {
    font-size: 0.9rem;
  }
  
  .app-footer {
    margin-top: 2rem;
    padding: 1.5rem 0 1rem 0;
  }
}
