/* FontAwesome Icon Fixes */
.fas, .far, .fab {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro" !important;
  font-weight: 900 !important;
  display: inline-block !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
}

.fa-target:before {
  content: "\f140" !important;
}

.fa-flag-checkered:before {
  content: "\f11e" !important;  
}

.fa-umbrella-beach:before {
  content: "\f5ca" !important;
}

.fa-user:before {
  content: "\f007" !important;
}

.fa-heart:before {
  content: "\f004" !important;
}

/* Export Section Styles */
.export-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.02);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.export-section h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-section h4 i {
  color: var(--primary);
}

.data-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.share-description {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
  font-style: italic;
}

@media (max-width: 768px) {
  /* Force tabs to be scrollable on mobile */
  .tabs {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    gap: 0;
    padding: 0 5px;
  }
  
  .tabs::-webkit-scrollbar {
    height: 4px;
  }
  
  .tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
  }
  
  .tabs::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
  }
  
  .tab {
    flex: 1 1 calc(25% - 4px);
    min-width: 75px;
    max-width: 95px;
    padding: 10px 3px;
    text-align: center;
    font-weight: 500;
    margin: 0 1px;
    font-size: 13px;
    border-radius: 4px 4px 0 0;
    overflow: visible;
    white-space: nowrap;
    color: #6c757d;
  }
  
  .tab.active {
    color: var(--primary);
    font-weight: bold;
  }
}

@media (max-width: 480px) {
  .export-section {
    padding: 12px;
  }
  
  .data-buttons,
  .share-buttons {
    flex-direction: column;
  }
  
  .data-buttons .btn,
  .share-buttons .btn {
    width: 100%;
  }
  
  .tab {
    flex: 1 1 calc(25% - 2px);
    min-width: 70px;
    max-width: 85px;
    padding: 8px 2px;
    font-size: 12px;
    margin: 0 1px;
    border-radius: 4px 4px 0 0;
    overflow: visible;
    white-space: nowrap;
    text-align: center;
    font-weight: 500;
    color: #6c757d;
  }
  
  .tab.active {
    color: var(--primary);
    font-weight: bold;
  }
}

/* Tabs */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 10px 6px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 55px;
  max-width: 85px;
  font-size: 13px;
}

.tab.active {
  border-bottom: 3px solid var(--primary);
  color: var(--primary);
  font-weight: bold;
}

/* Desktop tabs enhancement */
@media (min-width: 769px) {
  .tab {
    padding: 15px 20px;
    font-size: 16px;
    min-width: 80px;
    max-width: 120px;
  }
}

/* Goal Items */
.goal-item { 
  background: white; 
  border-radius: 8px; 
  padding: 20px; 
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
  transition: all 0.3s;
}

.goal-item.active { 
  border-color: var(--primary); 
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.goal-header { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  margin-bottom: 15px;
}

.goal-checkbox { 
  width: 18px; 
  height: 18px; 
  accent-color: var(--primary); 
}

.goal-title { 
  font-size: 1rem; 
  font-weight: 600; 
  color: #495057; 
}

.goal-controls { 
  display: grid; 
  grid-template-columns: 1fr 90px; 
  gap: 15px; 
  align-items: center;
  margin-bottom: 12px;
}

.goal-input { 
  padding: 10px 12px; 
  border: 1px solid #ced4da; 
  border-radius: 5px;
  font-size: 14px;
  transition: all 0.3s;
}

.goal-input:disabled { 
  opacity: 0.5; 
  background: #f8f9fa; 
}

.goal-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-display { 
  font-weight: bold; 
  color: var(--primary); 
  text-align: right;
  font-size: 0.9rem;
}

/* Range Slider Styles */
input[type="range"].slider,
.slider {
  width: 100% !important;
  height: 6px !important;
  border-radius: 3px !important;
  background: #dee2e6 !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: all 0.3s !important;
  position: relative !important;
  padding: 0 !important;
  margin: 25px 0 !important;
  overflow: visible !important;
  border: none !important;
  background-clip: padding-box !important;
}

input[type="range"].slider::-webkit-slider-thumb,
.slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: var(--primary) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  transition: all 0.3s !important;
  margin-top: -6px !important;
  position: relative !important;
  z-index: 10 !important;
  border: none !important;
  overflow: visible !important;
}

input[type="range"].slider::-webkit-slider-thumb:hover,
.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3) !important;
}

/* Firefox Styles */
input[type="range"].slider::-moz-range-thumb,
.slider::-moz-range-thumb {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: var(--primary) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  border: none !important;
  margin-top: 0 !important;
  -moz-appearance: none !important;
}

input[type="range"].slider::-moz-range-track,
.slider::-moz-range-track {
  height: 6px !important;
  background: #dee2e6 !important;
  border-radius: 3px !important;
  border: none !important;
  -moz-appearance: none !important;
}

/* Internet Explorer */
input[type="range"].slider::-ms-thumb,
.slider::-ms-thumb {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: var(--primary) !important;
  cursor: pointer !important;
  border: none !important;
}

input[type="range"].slider::-ms-track,
.slider::-ms-track {
  height: 6px !important;
  background: #dee2e6 !important;
  border-radius: 3px !important;
  border: none !important;
  color: transparent !important;
}

input[type="range"].slider:disabled,
.slider:disabled { 
  opacity: 0.5 !important; 
}

/* Results Section */
.results-section {
  margin-bottom: 30px;
  overflow: visible;
}

.results-title { 
  font-size: 1.3rem; 
  font-weight: bold; 
  margin-bottom: 20px; 
  color: #495057;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

/* Balance Meter */
.balance-meter {
  background: white;
  border-radius: 10px;
  padding: 30px 20px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  overflow: visible;
}

.meter-container {
  position: relative;
  height: 14px;
  background: linear-gradient(to right, #ef4444, #f59e0b, #10b981);
  border-radius: 7px;
  margin: 20px 0;
  overflow: visible;
}

.meter-indicator {
  position: absolute;
  top: -6px;
  width: 26px;
  height: 26px;
  background: white;
  border: 3px solid #333;
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.5s ease;
  left: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 2;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 5px;
}

.balance-status { 
  text-align: center; 
  margin-top: 12px; 
  font-weight: bold;
  font-size: 0.95rem;
  padding: 8px;
  border-radius: 5px;
}

/* KPI Grid */
.kpi-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 15px;
  margin-bottom: 25px;
}

.kpi-card { 
  background: white;
  border-radius: 8px; 
  padding: 15px; 
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.kpi-value { 
  font-size: 1.3rem; 
  font-weight: bold; 
  margin-bottom: 5px; 
  color: var(--primary); 
}

.kpi-label { 
  font-size: 0.8rem; 
  color: #6c757d; 
}

/* Insights */
.insights-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.insight { 
  margin: 10px 0; 
  padding: 12px; 
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  border-left: 4px solid var(--primary);
  background: #f8f9ff;
  border-radius: 0 5px 5px 0;
  transition: all 0.3s;
}

.insight:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.insight.warning { 
  border-left-color: var(--warning); 
  background: #fffbf0; 
}

.insight.success { 
  border-left-color: var(--success); 
  background: #f0fff4; 
}

.insight.danger { 
  border-left-color: var(--danger); 
  background: #fff5f5; 
}

.insight-header {
  font-weight: bold;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.insight-header i {
  margin-right: 8px;
}

/* Scenarios */
.scenarios-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.scenario {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin: 12px 0;
  border-left: 4px solid var(--primary);
  transition: all 0.3s;
}

.scenario:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}

.scenario.warning { 
  border-left-color: var(--warning); 
}

.scenario.success { 
  border-left-color: var(--success); 
}

.scenario.danger { 
  border-left-color: var(--danger); 
}

.scenario-title { 
  font-weight: bold; 
  color: var(--primary); 
  font-size: 0.95rem; 
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.scenario.warning .scenario-title { 
  color: var(--warning); 
}

.scenario.success .scenario-title { 
  color: var(--success); 
}

.scenario.danger .scenario-title { 
  color: var(--danger); 
}

.scenario-title i {
  margin-right: 8px;
}

.scenario-detail { 
  font-size: 0.85rem; 
  color: #6c757d; 
  margin-bottom: 5px;
  line-height: 1.5;
}

.scenario-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.8rem;
}

.scenario-metric {
  padding: 8px;
  background: white;
  border-radius: 5px;
  text-align: center;
}

.scenario-metric-value {
  font-weight: bold;
  color: var(--primary);
}

/* Loan Details */
.loan-details-container {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.loan-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
  position: relative;
}

.loan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.loan-title {
  font-weight: bold;
  color: #495057;
  font-size: 1rem;
}

.loan-remove {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.loan-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

/* Mobile responsiveness for loan fields */
@media (max-width: 768px) {
  .loan-fields {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .loan-fields {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  
  .loan-fields .form-group {
    margin-bottom: 15px;
  }
  
  .loan-fields .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Fix for tenure fields (years/months) on mobile */
  .loan-fields .form-group div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  
  .loan-fields .form-group div[style*="grid-template-columns"] input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Mobile loan summary alignment fixes */
  .loan-summary {
    padding: 10px !important;
    margin: 10px 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .loan-summary-item {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    padding: 3px 0 !important;
    margin-bottom: 8px !important;
  }
  
  .loan-summary-item span {
    display: block !important;
    min-width: 0 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  .loan-summary-item span:first-child {
    font-size: 0.85rem !important;
    color: #6c757d !important;
    margin-bottom: 2px !important;
  }
  
  .loan-summary-item span:last-child {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    color: #333 !important;
  }
  
  /* Fix for EMI scenario section on mobile */
  .emi-scenario {
    padding: 10px !important;
    margin-top: 10px !important;
    border-top: 1px solid #dee2e6 !important;
  }
  
  .scenario-header {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
  }
}

.loan-summary {
  background: #e8f4f8;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
  border-left: 4px solid var(--info);
  max-width: 100%;
  overflow: hidden;
}

.loan-summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.9rem;
  align-items: center;
  min-height: 24px;
}

.loan-summary-item:last-child {
  margin-bottom: 0;
  font-weight: bold;
  border-top: 1px solid #bee5eb;
  padding-top: 5px;
}

.loan-summary-item span:first-child {
  flex: 1;
  padding-right: 10px;
}

.loan-summary-item span:last-child {
  flex-shrink: 0;
  text-align: right;
}
.achievement-badge {
  display: inline-flex;
  align-items: center;
  background: var(--light);
  border-radius: 20px;
  padding: 5px 12px;
  margin: 0 5px 5px 0;
  font-size: 0.8rem;
  color: var(--dark);
}

.achievement-badge i {
  margin-right: 5px;
  color: var(--success);
}

/* Visualization */
.visualization {
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.visualization-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--dark);
  display: flex;
  align-items: center;
}

.visualization-title i {
  margin-right: 8px;
  color: var(--primary);
}

.timeline-visual {
  margin: 20px 0;
  position: relative;
  height: 60px;
  background: #e9ecef;
  border-radius: 4px;
}

.timeline-marker {
  position: absolute;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--primary);
  transform: translateX(-50%);
}

.timeline-label {
  position: absolute;
  top: -25px;
  transform: translateX(-50%);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Export */
.export-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #495057;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.2s ease;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
}

.close-modal:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #495057;
  transform: scale(1.1);
}

.close-modal:active {
  transform: scale(0.9);
  background-color: rgba(0, 0, 0, 0.15);
}

.plan-option {
  padding: 20px;
  margin: 15px 0;
  border-radius: 10px;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: all 0.3s;
}

.plan-option:hover {
  border-color: var(--primary);
  background: #f8f9ff;
  transform: translateY(-3px);
}

.plan-option.selected {
  border-color: var(--primary);
  background: #f0f4ff;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.plan-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.plan-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #495057;
  font-size: 1.1rem;
  flex: 1;
}

.plan-details {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 10px;
  line-height: 1.5;
}

.plan-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.plan-metric {
  padding: 10px;
  background: white;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.plan-metric-value {
  font-weight: bold;
  color: var(--primary);
  font-size: 1.1rem;
}

.plan-metric-label {
  font-size: 0.75rem;
  color: #6c757d;
}

.plan-action {
  text-align: right;
  margin-top: 20px;
}

.goal-balance-options {
  margin-top: 10px;
}

.goal-balance-options .plan-option {
  margin: 10px 0;
  padding: 15px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  z-index: 1000;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  margin-right: 10px;
  font-size: 1.2rem;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }


/* Feedback Section */
.feedback-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.feedback-card .form-group {
  margin-bottom: 15px;
}

.feedback-card label {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-weight: 500;
  font-size: 0.9rem;
}

.feedback-card label i {
  margin-right: 6px;
  color: var(--primary);
}

.feedback-card .form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.feedback-card .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.feedback-card textarea {
  resize: vertical;
  font-family: inherit;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 3px;
  margin-bottom: 10px;
}

.star {
  font-size: 1.5rem;
  color: #dee2e6;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.star:hover,
.star.active {
  color: #ffc107;
}

/* Goal Chart Container - Responsive Layout */
.goal-chart-container {
  height: auto;
  min-height: 200px;
  max-height: 400px;
  overflow: visible;
}

/* Mobile responsive goal chart */
@media (max-width: 768px) {
  .goal-chart-container {
    height: auto;
    min-height: 350px;
    padding: 15px;
    overflow: visible;
  }
  
  /* Ensure visualization section has proper spacing */
  .visualization {
    margin: 20px 0 50px 0; /* Increased bottom margin */
    padding: 20px;
  }
  
  /* Add spacing before ads to prevent overlap */
  .section:has(.visualization) {
    margin-bottom: 60px; /* Increased from 40px */
  }
  
  /* Improved pie chart mobile styles */
  .pie-chart-wrapper {
    flex-direction: column !important;
    align-items: center !important;
    gap: 25px !important;
  }
  
  .pie-chart-svg {
    text-align: center;
  }
  
  .pie-chart-metrics {
    width: 100% !important;
    max-width: 450px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Ensure desktop metrics container scrolls properly */
  @media (min-width: 769px) {
    .pie-chart-metrics {
      max-height: 350px !important;
      overflow-y: auto !important;
      padding-bottom: 15px !important;
      box-sizing: border-box !important;
    }
    
    .pie-chart-metrics > div {
      padding-bottom: 10px !important;
    }
  }
  
  /* Desktop pie chart metrics styling */
  .pie-chart-metric-row.desktop {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 32px !important;
    margin-bottom: 4px !important;
    padding: 2px 0 !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-left {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-icon {
    flex-shrink: 0 !important;
    margin-right: 6px !important;
    font-size: 0.8rem !important;
    width: 12px !important;
    display: inline-block !important;
    text-align: center !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-title {
    flex: 1 !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-right {
    flex-shrink: 0 !important;
    margin-left: 8px !important;
    text-align: right !important;
    min-width: 50px !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-percentage {
    font-weight: bold !important;
    color: #333 !important;
    font-size: 0.75rem !important;
  }
  
  .pie-chart-metric-row.desktop .pie-chart-metric-amount {
    color: #666 !important;
    font-size: 0.7rem !important;
  }
  
  /* Enhanced mobile pie chart metrics - Two row layout to prevent trimming */
  .pie-chart-metric-row.mobile {
    display: block !important;
    padding: 15px !important;
    margin-bottom: 12px !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    border-left: 4px solid var(--primary) !important;
    min-height: auto !important;
    overflow: visible !important;
    position: relative !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
  }
  
  /* First row: Icon and Title */
  .pie-chart-metric-row.mobile .pie-chart-metric-left {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    overflow: visible !important;
  }
  
  .pie-chart-metric-row.mobile .pie-chart-metric-icon {
    flex-shrink: 0 !important;
    margin-right: 15px !important;
    font-size: 1.5rem !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    background: rgba(255,255,255,0.8) !important;
    border-radius: 8px !important;
  }
  
  .pie-chart-metric-row.mobile .pie-chart-metric-title {
    flex: 1 !important;
    display: block !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    word-wrap: break-word !important;
  }
  
  /* Second row: Percentage and Amount */
  .pie-chart-metric-row.mobile .pie-chart-metric-right {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding: 8px 12px !important;
    background: rgba(255,255,255,0.6) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
  }
  
  .pie-chart-metric-row.mobile .pie-chart-metric-percentage {
    font-weight: bold !important;
    color: var(--primary) !important;
    font-size: 1.3rem !important;
    display: block !important;
    margin: 0 !important;
  }
  
  .pie-chart-metric-row.mobile .pie-chart-metric-amount {
    color: #495057 !important;
    font-size: 1.1rem !important;
    display: block !important;
    font-weight: 600 !important;
    margin: 0 !important;
  }
  
  /* Force visibility on mobile pie chart elements */
  @media (max-width: 768px) {
    .pie-chart-metrics * {
      visibility: visible !important;
      opacity: 1 !important;
    }
    
    .pie-chart-metric-row.mobile .pie-chart-metric-icon,
    .pie-chart-metric-row.mobile .pie-chart-metric-title,
    .pie-chart-metric-row.mobile .pie-chart-metric-right,
    .pie-chart-metric-row.mobile .pie-chart-metric-percentage,
    .pie-chart-metric-row.mobile .pie-chart-metric-amount {
      visibility: visible !important;
      opacity: 1 !important;
      display: block !important;
    }
    
    .pie-chart-metric-row.mobile .pie-chart-metric-right {
      display: block !important;
    }
  }
  
  /* Better spacing for goal visualization section on mobile */
  .section:nth-child(4) { /* Assuming visualization is 4th section */
    margin-bottom: 80px !important;
    padding-bottom: 30px;
  }

/* Ad Placeholder Styles - Remove when ads are approved */
.ad-container {
  position: relative;
}

.ad-container:empty::before {
  content: '';
  display: block;
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
              linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
              linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
}

.ad-container.mobile-banner:empty::before {
  height: 100px;
  content: 'Mobile Banner Ad (320x100)';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  background-color: #f8f9fa;
}

.ad-container.banner:empty::before {
  height: 120px;
  content: 'Banner Ad (728x90)';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  background-color: #f8f9fa;
}

.ad-container.sidebar:empty::before {
  height: 250px;
  width: 100%;
  content: 'Square Ad (250x250)';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  background-color: #f8f9fa;
}

.ad-container.sidebar.vertical:empty::before {
  height: 600px;
  content: 'Vertical Ad (160x600)';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  background-color: #f8f9fa;
}

.ad-container.native:empty::before {
  height: 200px;
  content: 'Native In-Article Ad';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  background-color: #f8f9fa;
}

/* Add subtle animation to placeholders */
.ad-container:empty::before {
  animation: adPlaceholder 2s ease-in-out infinite alternate;
}

@keyframes adPlaceholder {
  0% { opacity: 0.5; }
  100% { opacity: 0.8; }
}

/* Hide placeholders when ads are loaded */
.adsbygoogle[data-ad-status="filled"] + .ad-placeholder {
  display: none !important;
}

/* Style for ad placeholder fallback */
.ad-placeholder {
  animation: adPlaceholder 2s ease-in-out infinite alternate;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
}

/* Mobile modal positioning fix to prevent header trimming */
@media (max-width: 768px) {
  .modal {
    align-items: flex-start;
    padding-top: 20px;
    box-sizing: border-box;
  }

  .modal-content {
    margin-top: 0;
    margin-bottom: 20px;
    max-height: calc(100vh - 40px);
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
  }

  .modal-header {
    flex-shrink: 0;
    padding-bottom: 10px;
    margin-bottom: 15px;
  }

  .modal-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .close-modal {
    font-size: 1.8rem;
    padding: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
  }

  .close-modal:hover,
  .close-modal:active {
    background-color: rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 480px) {
  .modal {
    padding-top: 30px;
  }

  .modal-content {
    width: calc(100% - 10px);
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 60px);
  }

  .close-modal {
    font-size: 1.6rem;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: normal;
    flex-shrink: 0;
  }
}
}