/* ========================================
   ISEE CALCULATOR STYLES
   Matching Italian Universities Guide Design
   Performance Optimized Version
   ======================================== */

/* Import shared styles and inherit CSS variables from main styles.css */

/* Calculator-specific CSS Variables */
:root {
  --calc-section-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(217, 70, 239, 0.05));
  --calc-section-border: rgba(217, 70, 239, 0.3);
  --calc-input-bg: rgba(217, 70, 239, 0.08);
  --calc-input-border: rgba(217, 70, 239, 0.2);
  --calc-input-focus: #d946ef;
  --calc-success-color: #10b981;
  --calc-warning-color: #f59e0b;
  --calc-error-color: #dc2626;
  --calc-blur-strong: blur(20px) saturate(180%);
  --calc-shadow-glow: 0 8px 32px rgba(217, 70, 239, 0.15);
}

/* PERFORMANCE: Add CSS containment for isolated components */
.household-member,
.calculator-section,
.sibling-item {
  contain: layout style;
}

/* PERFORMANCE: Use will-change for animated elements */
.household-member,
.currency-badge,
.status-info-panel {
  will-change: transform, opacity;
}

/* Body & Background - Match Index Page */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: #0a0e1a;
  color: #f0f4f8;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* PERFORMANCE: Enable hardware acceleration */
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Gradient - Match Index */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  animation: gradientShift 20s ease infinite;
  z-index: -1;
  pointer-events: none;
  /* PERFORMANCE: Use will-change for animations */
  will-change: opacity;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Language Selector - Floating */
.lang-selector-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-selector-floating select {
  padding: 10px 15px;
  border-radius: 8px;
  background: rgba(10, 8, 21, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  color: #f0f4f8;
  border: 1px solid rgba(217, 70, 239, 0.4);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(217, 70, 239, 0.15);
}

.lang-selector-floating select:hover {
  border-color: #d946ef;
  background: rgba(217, 70, 239, 0.2);
  box-shadow: 0 12px 32px rgba(217, 70, 239, 0.25);
  backdrop-filter: blur(25px) saturate(200%);
}

.lang-selector-floating select:focus {
  outline: none;
  border-color: #d946ef;
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.3);
}

.lang-selector-floating select option {
  background: #1f2937;
  color: #f0f4f8;
  padding: 10px;
}

/* Particle Canvas Background */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.4;
}

/* Main Calculator Container - Enhanced Glass Morphism */
.calculator-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 40px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.92));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 32px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(99, 102, 241, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    0 0 100px rgba(99, 102, 241, 0.15);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
  overflow: hidden;
}

.calculator-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  animation: rotateGlow 20s linear infinite;
  pointer-events: none;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Return to Home Button */
.btn-return-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  margin-bottom: 20px;
  background: rgba(99, 102, 241, 0.15);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  color: #f0f4f8;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-return-home:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #6366f1;
  transform: translateX(-5px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-return-home .arrow-left {
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

.btn-return-home:hover .arrow-left {
  transform: translateX(-3px);
}

/* RTL support for return button */
[dir="rtl"] .btn-return-home {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn-return-home:hover {
  transform: translateX(5px);
}

[dir="rtl"] .btn-return-home .arrow-left {
  transform: scaleX(-1);
}

[dir="rtl"] .btn-return-home:hover .arrow-left {
  transform: scaleX(-1) translateX(-3px);
}

/* Calculator Header */
.calculator-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  padding: 30px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(217, 70, 239, 0.1));
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  border: 1px solid rgba(217, 70, 239, 0.3);
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.calculator-header::before {
  content: '🧮';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.calculator-header::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.calculator-header h1 {
  color: #f0f4f8;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 2.8em;
  font-weight: 800;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #7c3aed, #d946ef, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 0 40px rgba(217, 70, 239, 0.3);
  animation: gradientFlow 5s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.calculator-header .arabic-subtitle {
  color: #a5b4fc;
  font-size: 1.4em;
  margin-top: 12px;
  direction: rtl;
  font-family: 'Cairo', 'Inter', sans-serif;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.calculator-header p {
  color: #cbd5e1;
  font-size: 1.1em;
  margin-top: 15px;
  font-weight: 500;
}

/* Calculator Sections - Responsive Card Grid */
.calculator-section {
  margin-bottom: 40px;
  padding: 35px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(217, 70, 239, 0.08));
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(217, 70, 239, 0.3);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.calculator-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #7c3aed, #d946ef, #ec4899);
  box-shadow: 0 0 20px rgba(217, 70, 239, 0.8);
  transition: all 0.3s ease;
}

.calculator-section:hover {
  transform: translateY(-5px);
  border-color: rgba(217, 70, 239, 0.5);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(217, 70, 239, 0.12));
  box-shadow: 
    0 24px 60px rgba(124, 58, 237, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(200%);
}

.calculator-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #6366f1, #8b5cf6, #ec4899);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
  transition: all 0.3s ease;
}

.calculator-section:hover::before {
  width: 8px;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
}

.calculator-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

/* Section Headers */
.calculator-section h2 {
  color: #f0f4f8;
  font-size: 1.75em;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section-number {
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  font-weight: 800;
  box-shadow: 
    0 8px 24px rgba(217, 70, 239, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 
      0 8px 24px rgba(217, 70, 239, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 
      0 12px 36px rgba(217, 70, 239, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #f0f4f8;
  font-weight: 600;
  font-size: 1.05em;
  transition: color 0.3s ease;
}

.form-group label:hover {
  color: #6366f1;
}

/* Input Fields - Glass Style */
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  font-size: 1em;
  background: rgba(17, 24, 39, 0.8);
  color: #f0f4f8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Select dropdown options styling */
.form-group select option {
  background: #1f2937;
  color: #f0f4f8;
  padding: 10px;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 
    0 0 0 3px rgba(99, 102, 241, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-group input[type="number"]:hover,
.form-group select:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

/* Read-only input styling */
.form-group input[readonly] {
  background: rgba(99, 102, 241, 0.1);
  cursor: not-allowed;
  color: rgba(240, 244, 248, 0.9);
  border: 2px solid rgba(99, 102, 241, 0.3);
}

.form-group input[readonly]:hover,
.form-group input[readonly]:focus {
  border-color: rgba(99, 102, 241, 0.3);
  outline: none;
}

/* Input with Currency Display */
.input-with-currency {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-with-currency input {
  flex: 1;
  padding-right: 80px !important;
}

/* RTL support for currency input */
[dir="rtl"] .input-with-currency input {
  padding-right: 20px !important;
  padding-left: 80px !important;
}

.currency-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

/* RTL support for currency badge */
[dir="rtl"] .currency-badge {
  right: auto;
  left: 12px;
}

/* Select Dropdown Styling */
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f0f4f8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 45px;
}

/* Currency Selector */
.currency-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.currency-option {
  flex: 1;
  padding: 15px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.currency-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.currency-option:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.currency-option:hover::before {
  left: 100%;
}

.currency-option.selected {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.2));
  color: white;
  box-shadow: 
    0 4px 16px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.currency-option input[type="radio"] {
  display: none;
}

.currency-option div {
  font-size: 1.1em;
  font-weight: 500;
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
  border-left: 4px solid #3b82f6;
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  font-size: 0.95em;
  color: #f0f4f8;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(10px);
}

.info-box strong {
  color: #60a5fa;
  font-weight: 600;
}

/* Household Member Cards */
.household-member {
  background: rgba(255, 255, 255, 0.08);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.household-member::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.household-member:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateX(5px);
}

.household-member:hover::before {
  opacity: 1;
}

.household-member h3 {
  color: #f0f4f8;
  margin-bottom: 15px;
  font-size: 1.1em;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

/* Inline Fields Grid */
.inline-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* Checkbox Groups */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  cursor: pointer;
  user-select: none;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #6366f1;
  flex-shrink: 0;
}

.checkbox-group label {
  margin-bottom: 0 !important;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-group:hover label {
  color: #6366f1;
}

/* Document Checklist */
.document-checklist {
  display: grid;
  gap: 12px;
}

.document-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.document-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.2), transparent);
  transition: width 0.3s ease;
}

.document-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

.document-item.checked {
  border-color: #27ae60;
  background: rgba(39, 174, 96, 0.15);
}

.document-item.checked::before {
  width: 100%;
}

.document-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #27ae60;
}

.document-item label {
  margin-bottom: 0 !important;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
}

/* Buttons */
.calculate-btn,
.add-member-btn,
.remove-member-btn {
  padding: 18px 32px;
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.calculate-btn::before,
.add-member-btn::before,
.remove-member-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.calculate-btn:hover::before,
.add-member-btn:hover::before,
.remove-member-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Calculate Button */
.calculate-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  background-size: 200% 200%;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.3em;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  margin-top: 40px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 30px rgba(99, 102, 241, 0.4),
    0 0 60px rgba(139, 92, 246, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  animation: gradientSlide 3s ease infinite;
}

@keyframes gradientSlide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.calculate-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.6s, height 0.6s;
}

.calculate-btn:hover::before {
  width: 500px;
  height: 500px;
}

.calculate-btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 
    0 15px 45px rgba(99, 102, 241, 0.6),
    0 0 80px rgba(139, 92, 246, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.calculate-btn:active {
  transform: translateY(-2px) scale(0.98);
}

/* Add Member Button */
.add-member-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 14px 28px;
  font-size: 1.05em;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.add-member-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

/* Remove Member Button */
.remove-member-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 10px 20px;
  font-size: 0.9em;
  margin-top: 10px;
}

.remove-member-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

/* Result Container - Responsive Card Grid */
.result-container {
  display: none;
  margin-top: 50px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  color: white;
  border-radius: 24px;
  text-align: center;
  box-shadow: 
    0 30px 70px rgba(102, 126, 234, 0.6),
    0 0 100px rgba(118, 75, 162, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  animation: resultGradient 5s ease infinite;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
/* Responsive Grid for Calculator Cards */
.calculator-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
}

@media (max-width: 600px) {
  .calculator-container {
    padding: 10px;
    border-radius: 0;
    margin: 0;
    min-width: 100vw;
    box-shadow: none;
  }
  .calculator-section,
  .result-container {
    padding: 18px 6px;
    border-radius: 12px;
    min-width: 0;
    max-width: 100vw;
    margin: 18px 0;
  }
  .calculator-header {
    padding: 16px 4px;
    border-radius: 10px;
    margin-bottom: 24px;
  }
  .result-container {
    padding: 18px 6px;
    border-radius: 12px;
    margin-top: 24px;
  }
  .fee-cards {
    flex-direction: column;
    gap: 12px;
  }
  .fee-card {
    min-width: 0;
    width: 100%;
  }
}

@keyframes resultGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.result-container::before {
  content: '🎉';
  position: absolute;
  font-size: 8rem;
  top: -40px;
  right: -40px;
  opacity: 0.2;
  animation: float 6s ease-in-out infinite;
}

.result-container::after {
  content: '✨';
  position: absolute;
  font-size: 6rem;
  bottom: -30px;
  left: -30px;
  opacity: 0.2;
  animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

.result-container.show {
  display: block;
  animation: 
    resultGradient 5s ease infinite,
    zoomIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-container h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5em;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.result-value {
  font-size: 4em;
  font-weight: 900;
  font-family: 'Poppins', sans-serif;
  margin: 30px 0;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  animation: scaleUp 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s both;
}

@keyframes scaleUp {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideInScale {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-container h2 {
  font-size: 2em;
  margin-bottom: 10px;
  font-family: 'Poppins', sans-serif;
  position: relative;
  z-index: 1;
}

.result-value {
  font-size: 3.5em;
  font-weight: 800;
  margin: 20px 0;
  font-family: 'Poppins', sans-serif;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.result-container > p {
  font-size: 1.1em;
  opacity: 0.95;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

/* Eligibility Guide */
.eligibility-guide {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 12px;
  margin-top: 20px;
  text-align: left;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.eligibility-guide h3 {
  margin-bottom: 15px;
  font-size: 1.5em;
  font-family: 'Poppins', sans-serif;
}

.eligibility-guide ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.eligibility-guide li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.05em;
  line-height: 1.6;
}

.eligibility-guide li:last-child {
  border-bottom: none;
}

/* ========================================
   FINANCIAL BREAKDOWN SECTION
   Enhanced tuition and benefits display
   ======================================== */

.financial-breakdown {
  margin: 30px 0;
  padding: 25px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(33, 150, 243, 0.05));
  border-radius: 16px;
  border: 1px solid rgba(76, 175, 80, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.financial-breakdown h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1976d2;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Fee Comparison Cards */
.fee-comparison {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.fee-cards {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.fee-card {
  flex: 1;
  min-width: 200px;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fee-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.fee-card.standard-fee {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
}

.fee-card.reduced-fee {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
}

.fee-label {
  font-size: 0.9rem;
  opacity: 0.95;
  margin-bottom: 10px;
  font-weight: 500;
}

.fee-amount {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 10px 0;
  letter-spacing: -1px;
}

.fee-amount.highlight {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fee-sublabel {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 5px;
}

.fee-arrow {
  font-size: 2.5rem;
  color: #4caf50;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.fee-savings {
  margin-top: 15px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(139, 195, 74, 0.1));
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  color: #2e7d32;
  border: 2px dashed #4caf50;
}

/* Benefits Table */
.benefits-table-container {
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  overflow-x: auto;
}

.benefits-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.benefits-table thead {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: white;
}

.benefits-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.benefits-table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease;
}

.benefits-table tbody tr:hover {
  background: rgba(33, 150, 243, 0.05);
}

.benefits-table tbody tr.eligible {
  background: rgba(76, 175, 80, 0.05);
}

.benefit-row td {
  padding: 15px;
}

.benefit-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: #333;
}

.benefit-icon {
  font-size: 1.5rem;
}

.benefit-desc {
  color: #666;
  font-size: 0.9rem;
}

.benefit-status {
  text-align: center;
  font-size: 1.5rem;
}

.benefit-value {
  text-align: right;
  font-weight: 600;
  font-size: 1.1rem;
  color: #2e7d32;
}

.benefits-table tfoot {
  background: linear-gradient(135deg, #f5f5f5, #eeeeee);
  border-top: 3px solid #4caf50;
}

.total-row td {
  padding: 20px 15px;
  font-size: 1.2rem;
}

.total-label {
  color: #333;
}

.total-value {
  text-align: right;
  color: #2e7d32;
  font-size: 1.5rem !important;
}

/* Total Savings Box */
.total-savings-box {
  margin: 30px 0;
  padding: 30px;
  background: linear-gradient(135deg, #4caf50, #45a049);
  border-radius: 16px;
  color: white;
  display: flex;
  align-items: center;
  gap: 25px;
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.3);
  position: relative;
  overflow: hidden;
}

.total-savings-box::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.savings-icon {
  font-size: 4rem;
  flex-shrink: 0;
  animation: bounce 3s infinite;
  z-index: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.savings-content {
  flex: 1;
  z-index: 1;
}

.savings-content h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: white;
}

.savings-amount {
  font-size: 3rem;
  font-weight: 800;
  margin: 15px 0;
  letter-spacing: -2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.savings-desc {
  font-size: 1rem;
  opacity: 0.95;
  line-height: 1.6;
  margin-bottom: 15px;
}

.savings-breakdown-mini {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.savings-breakdown-mini span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.savings-breakdown-mini strong {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Financial Disclaimer */
.financial-disclaimer {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 193, 7, 0.05));
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555;
}

.financial-disclaimer strong {
  color: #e65100;
}

.financial-disclaimer ul {
  margin: 10px 0 10px 20px;
  padding: 0;
}

.financial-disclaimer li {
  margin: 8px 0;
}

/* Responsive Design for Financial Breakdown */
@media (max-width: 768px) {
  .fee-cards {
    flex-direction: column;
  }
  
  .fee-arrow {
    transform: rotate(90deg);
    margin: 10px 0;
  }
  
  .total-savings-box {
    flex-direction: column;
    text-align: center;
  }
  
  .savings-amount {
    font-size: 2.5rem;
  }
  
  .benefits-table {
    font-size: 0.85rem;
  }
  
  .benefits-table th,
  .benefits-table td {
    padding: 10px 8px;
  }
  
  .benefit-icon {
    font-size: 1.2rem;
  }
  
  .savings-breakdown-mini {
    flex-direction: column;
    gap: 10px;
  }
}

/* Missing Documents Alert */
.missing-docs {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.15));
  border-left: 4px solid #ffc107;
  padding: 20px;
  margin-top: 20px;
  border-radius: 12px;
  color: #fff3cd;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
}

.missing-docs h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.3em;
  font-family: 'Poppins', sans-serif;
}

.missing-docs p {
  margin-bottom: 10px;
  opacity: 0.95;
}

.missing-docs ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.missing-docs li {
  padding: 8px 0;
  font-size: 1em;
  line-height: 1.5;
}

.missing-docs li:before {
  content: "⚠️ ";
  margin-right: 8px;
}

/* Back to Home Button */
.back-home-btn {
  display: inline-block;
  margin-top: 30px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
  font-family: 'Poppins', sans-serif;
}

.back-home-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 5px;
  cursor: help;
  color: #60a5fa;
  font-weight: bold;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 250px;
  background-color: rgba(17, 24, 39, 0.95);
  color: #f0f4f8;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -125px;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 0.9em;
  font-weight: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.3);
  backdrop-filter: blur(10px);
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes bounceStrong {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-8px) scale(1.15); }
  50% { transform: translateY(0) scale(1); }
  75% { transform: translateY(-4px) scale(1.05); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== MODAL STYLES ===== */
.summary-modal,
.docs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.summary-modal-content,
.docs-modal-content {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(99, 102, 241, 0.2);
    animation: slideInScale 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Summary Modal Header */
.summary-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.summary-header h2 {
    font-family: var(--ff-accent);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    animation: gradientFlow 5s ease infinite;
}

.summary-header p {
    color: rgba(240, 244, 248, 0.7);
    font-size: 1rem;
    margin: 0;
}

.summary-modal-content h2,
.docs-modal-content h2 {
    font-family: var(--ff-accent);
    font-size: 2rem;
    font-weight: 700;
    color: var(--clr-accent);
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Summary Table Container */
.summary-table-container {
    margin: 2rem 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: rgba(17, 24, 39, 0.6);
}

.summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.summary-table thead {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
}

.summary-table th {
    padding: 1rem;
    text-align: left;
    font-family: var(--ff-accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    border-bottom: 2px solid rgba(99, 102, 241, 0.5);
}

.summary-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.summary-table tbody tr {
    background: rgba(17, 24, 39, 0.4);
    transition: all 0.3s ease;
}

.summary-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.01);
}

.summary-table tbody tr:last-child td {
    border-bottom: none;
}

/* Included/Excluded Row Styles */
.included-row {
    background: rgba(16, 185, 129, 0.08) !important;
    border-left: 3px solid #10b981;
}

.excluded-row {
    background: rgba(239, 68, 68, 0.08) !important;
    border-left: 3px solid #ef4444;
    opacity: 0.7;
}

.included-row:hover {
    background: rgba(16, 185, 129, 0.15) !important;
}

.excluded-row:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* View Docs Button */
.view-docs-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--ff-accent);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.view-docs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

/* Summary Totals */
.summary-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.total-item {
    text-align: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.3s ease;
}

.total-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.total-label {
    display: block;
    font-family: var(--ff-accent);
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(240, 244, 248, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.total-value {
    display: block;
    font-family: var(--ff-accent);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 5s ease infinite;
}

/* Summary Actions */
.summary-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(99, 102, 241, 0.2);
}

.btn-secondary,
.btn-primary {
    flex: 1;
    max-width: 280px;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-family: var(--ff-accent);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: gradientSlide 3s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.badge-success,
.badge-danger {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-proceed,
.btn-cancel,
.btn-view-docs {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-family: var(--ff-accent);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-proceed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-proceed:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-cancel {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.btn-view-docs {
    background: linear-gradient(135deg, var(--clr-accent), #8b5cf6);
    color: #fff;
    margin-top: 1rem;
    width: 100%;
}

.btn-view-docs:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Status Info Panels */
.status-info-panel {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 4px solid #d946ef;
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(124, 58, 237, 0.1));
    backdrop-filter: blur(15px) saturate(180%);
    animation: slideInUp 0.3s ease;
    box-shadow: 0 8px 24px rgba(217, 70, 239, 0.1);
}

.status-info-panel h4 {
    font-family: var(--ff-accent);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--clr-accent);
    margin-bottom: 0.5rem;
}

.status-info-panel p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.alert-panel {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(244, 63, 94, 0.1));
    backdrop-filter: blur(10px) saturate(180%);
    animation: pulse 2s ease infinite;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.1);
}

.alert-panel p {
    color: #fbbf24;
    font-weight: 500;
    margin: 0;
}

.info-panel {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(139, 92, 246, 0.1));
    backdrop-filter: blur(10px) saturate(180%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
}

.info-panel p {
    color: #60a5fa;
    font-weight: 500;
    margin: 0;
}

/* Required Documents Display */
.required-docs-display {
    margin-top: 1rem;
    padding: 1.25rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.required-docs-display h4 {
    font-family: var(--ff-accent);
    font-size: 1rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required-docs-display ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.required-docs-display li {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required-docs-display li::before {
    content: '📄';
    font-size: 1rem;
}

/* Document Summary in Results */
.document-summary {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.8));
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.document-summary h3 {
    font-family: var(--ff-accent);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-accent);
    margin-bottom: 1rem;
}

.doc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.doc-summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.doc-summary-item:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateX(5px);
}

.doc-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--clr-accent);
}

.doc-summary-item label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    flex: 1;
}

.btn-download {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: var(--ff-accent);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

/* Household Composition Info */
.household-composition-info {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--clr-accent);
}

.household-composition-info p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.household-composition-info strong {
    color: var(--clr-accent);
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .summary-modal,
    .docs-modal {
        padding: 1rem;
    }
    
    .summary-modal-content,
    .docs-modal-content {
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    .summary-modal-content h2,
    .docs-modal-content h2 {
        font-size: 1.5rem;
    }
    
    .summary-table {
        font-size: 0.85rem;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-proceed,
    .btn-cancel {
        width: 100%;
    }
    
    .doc-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .summary-table {
        display: block;
        overflow-x: auto;
    }
    
    .summary-table th,
    .summary-table td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}
@media (max-width: 768px) {
  .calculator-container {
    padding: 20px;
    margin: 20px 10px;
    border-radius: 18px;
  }

  .calculator-header h1 {
    font-size: 1.8em;
  }

  .calculator-header .arabic-subtitle {
    font-size: 1.1em;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .currency-selector {
    flex-direction: column;
  }

  .calculator-section {
    padding: 20px;
    margin-bottom: 25px;
  }

  .section-number {
    width: 30px;
    height: 30px;
    font-size: 1em;
  }

  .result-value {
    font-size: 2.5em;
  }
}

@media (max-width: 480px) {
  .calculator-container {
    padding: 15px;
    margin: 15px 5px;
    border-radius: 16px;
  }

  .calculator-header h1 {
    font-size: 1.5em;
  }

  .calculator-header .arabic-subtitle {
    font-size: 1em;
  }

  .calculator-section h2 {
    font-size: 1.2em;
  }

  .form-group input[type="number"],
  .form-group select {
    padding: 10px 12px;
    font-size: 0.95em;
  }

  .calculate-btn {
    padding: 14px 24px;
    font-size: 1em;
  }

  .result-value {
    font-size: 2em;
  }

  .eligibility-guide {
    padding: 15px;
  }

  .eligibility-guide li {
    font-size: 0.95em;
  }
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 20px;
  color: #f0f4f8;
  font-size: 1.1em;
  font-weight: 600;
}

/* Success Animation */
.success-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.4);
  z-index: 10001;
  animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.2em;
  font-weight: 700;
}

@keyframes successPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.success-icon {
  font-size: 2em;
  animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
  0%, 50% {
    transform: scale(0) rotate(-45deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Smooth Transitions for Adding/Removing Members */
.household-member,
.calculator-section {
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.household-member.removing {
  animation: slideOutDown 0.3s cubic-bezier(0.6, 0, 0.8, 0.2) forwards;
}

@keyframes slideOutDown {
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    height: 0;
    margin: 0;
    padding: 0;
  }
}

/* Input Validation Styles */
input.error,
select.error {
  border-color: #ef4444 !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.error-message {
  color: #ef4444;
  font-size: 0.85em;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-icon {
  font-size: 1.1em;
}

/* Progress Indicator */
.progress-indicator {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 0 0 20px 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 100;
  animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.progress-bar-container {
  background: rgba(99, 102, 241, 0.2);
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f0f4f8;
  font-size: 0.9em;
}

.progress-percentage {
  font-weight: 700;
  font-size: 1.1em;
  color: #8b5cf6;
}

/* Print Styles */
@media print {
  body::before,
  #particleCanvas {
    display: none;
  }

  .calculator-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .back-home-btn {
    display: none;
  }

  .result-container {
    background: #f0f0f0;
    color: #000;
  }
  
  .loading-overlay,
  .progress-indicator {
    display: none;
  }
}

/* Accessibility Improvements */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #f0f4f8;
}

::-moz-selection {
  background: rgba(99, 102, 241, 0.3);
  color: #f0f4f8;
}

/* ========================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS
   Enhanced for all device sizes
   ======================================== */

/* Tablets and Small Laptops (641px - 1024px) */
@media (max-width: 1024px) {
  .calculator-container {
    margin: 30px 20px;
    padding: 30px 25px;
    border-radius: 24px;
  }
  
  .calculator-header h1 {
    font-size: 2.2em;
  }
  
  .calculator-section {
    padding: 25px 20px;
    margin-bottom: 30px;
  }
  
  .inline-fields {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
}

/* Mobile Devices (max-width: 768px) - Primary Mobile Breakpoint */
@media (max-width: 768px) {
  /* Safe area padding for notched devices */
  body {
    padding-top: max(env(safe-area-inset-top), 10px);
    padding-bottom: max(env(safe-area-inset-bottom), 10px);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  /* Main Container */
  .calculator-container {
    margin: 15px 10px;
    padding: 25px 18px;
    border-radius: 20px;
    max-width: 100%;
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(99, 102, 241, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  
  /* Language Selector */
  .lang-selector-floating {
    top: max(env(safe-area-inset-top), 10px);
    right: 10px;
  }
  
  .lang-selector-floating select {
    padding: 8px 12px;
    font-size: 0.85em;
  }
  
  /* Return to Home Button */
  .btn-return-home {
    padding: 10px 16px;
    font-size: 0.9em;
    margin-bottom: 15px;
  }
  
  /* Header */
  .calculator-header {
    padding: 20px 15px;
    margin-bottom: 30px;
  }
  
  .calculator-header::before {
    font-size: 2.5rem;
    top: -25px;
  }
  
  .calculator-header h1 {
    font-size: 1.9em;
    line-height: 1.3;
  }
  
  .calculator-header .arabic-subtitle {
    font-size: 1.2em;
  }
  
  .calculator-header p {
    font-size: 1em;
  }
  
  /* Sections */
  .calculator-section {
    padding: 20px 16px;
    margin-bottom: 25px;
    border-radius: 16px;
  }
  
  .calculator-section h2 {
    font-size: 1.4em;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .section-number {
    width: 38px;
    height: 38px;
    font-size: 1.1em;
  }
  
  /* Form Elements - Touch Optimized */
  .form-group {
    margin-bottom: 18px;
  }
  
  .form-group label {
    font-size: 1em;
    margin-bottom: 8px;
  }
  
  .form-group input[type="number"],
  .form-group select,
  .form-group textarea {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 12px;
    min-height: 48px; /* Touch-friendly */
  }
  
  /* Inline Fields - Stack on Mobile */
  .inline-fields {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Currency Selector */
  .currency-selector {
    flex-direction: column;
    gap: 12px;
  }
  
  .currency-option {
    flex: 1;
    padding: 16px;
    min-height: 54px;
  }
  
  /* Household Members */
  .household-member {
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 14px;
  }
  
  .member-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .member-number {
    width: 35px;
    height: 35px;
    font-size: 0.95em;
  }
  
  .member-title {
    font-size: 1.05em;
  }
  
  .delete-member-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    min-height: 38px;
  }
  
  /* Buttons - Touch Friendly */
  .add-member-btn,
  .add-sibling-btn,
  .calculate-btn,
  .reset-btn {
    padding: 15px 24px;
    font-size: 1rem;
    min-height: 52px;
    border-radius: 12px;
    width: 100%;
    margin: 10px 0;
  }
  
  .button-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .button-group .calculate-btn,
  .button-group .reset-btn {
    width: 100%;
  }
  
  /* Results Container */
  .result-container {
    padding: 25px 18px;
    margin-top: 25px;
    border-radius: 18px;
  }
  
  .result-value {
    font-size: 2.8em;
    margin: 15px 0;
  }
  
  .result-range {
    font-size: 1.1em;
  }
  
  /* Eligibility Guide */
  .eligibility-guide {
    padding: 20px 16px;
    margin-top: 25px;
    border-radius: 16px;
  }
  
  .eligibility-guide h3 {
    font-size: 1.3em;
  }
  
  .eligibility-guide li {
    font-size: 0.95em;
    padding: 10px 0;
  }
  
  /* Progress Indicator */
  .progress-indicator {
    padding: 12px 16px;
    font-size: 0.9em;
  }
  
  .progress-bar {
    height: 6px;
  }
  
  /* Info Panels */
  .status-info-panel,
  .info-box {
    padding: 16px;
    margin: 15px 0;
    border-radius: 12px;
  }
  
  .info-box h4 {
    font-size: 1.1em;
  }
  
  /* Financial Breakdown Mobile Optimization */
  .financial-breakdown {
    padding: 20px 16px;
    border-radius: 16px;
  }
  
  .financial-breakdown h3 {
    font-size: 1.4em;
  }
  
  .fee-comparison {
    margin: 20px 0;
  }
  
  .fee-cards {
    flex-direction: column;
    gap: 15px;
  }
  
  .fee-card {
    padding: 18px;
  }
  
  .fee-arrow {
    transform: rotate(90deg);
    margin: 15px 0;
    font-size: 1.8em;
  }
  
  .fee-amount {
    font-size: 2em;
  }
  
  .fee-details {
    font-size: 0.85em;
  }
  
  .total-savings-box {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .savings-amount {
    font-size: 2.8rem;
  }
  
  .savings-breakdown-mini {
    flex-direction: column;
    gap: 12px;
  }
  
  .benefits-table {
    font-size: 0.88rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .benefits-table thead,
  .benefits-table tbody,
  .benefits-table tr {
    display: block;
  }
  
  .benefits-table thead {
    display: none;
  }
  
  .benefits-table tr {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
  }
  
  .benefits-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
  }
  
  .benefits-table td:last-child {
    border-bottom: none;
  }
  
  .benefits-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: rgba(99, 102, 241, 0.9);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    min-width: 100px;
  }
  
  .benefit-icon {
    font-size: 1.3rem;
  }
  
  /* Modals on Mobile */
  .summary-modal,
  .docs-modal {
    padding: 0;
    align-items: flex-end;
  }
  
  .summary-modal-content,
  .docs-modal-content {
    padding: 20px 16px;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  
  .summary-modal-content h2,
  .docs-modal-content h2 {
    font-size: 1.5rem;
  }
  
  .modal-close-btn {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
  
  .modal-actions {
    flex-direction: column-reverse;
    gap: 12px;
  }
  
  .btn-proceed,
  .btn-cancel {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    min-height: 48px;
  }
  
  .doc-summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .summary-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.88rem;
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .calculator-container {
    margin: 10px 8px;
    padding: 20px 14px;
    border-radius: 18px;
  }
  
  .calculator-header {
    padding: 18px 12px;
    margin-bottom: 20px;
  }
  
  .calculator-header::before {
    font-size: 2.2rem;
    top: -22px;
  }
  
  .calculator-header h1 {
    font-size: 1.6em;
  }
  
  .calculator-header .arabic-subtitle {
    font-size: 1.05em;
  }
  
  .calculator-header p {
    font-size: 0.95em;
  }
  
  .calculator-section {
    padding: 16px 14px;
    margin-bottom: 20px;
    border-radius: 14px;
  }
  
  .calculator-section h2 {
    font-size: 1.2em;
    gap: 10px;
  }
  
  .section-number {
    width: 34px;
    height: 34px;
    font-size: 1em;
  }
  
  .form-group input[type="number"],
  .form-group select {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
  
  .household-member {
    padding: 14px;
  }
  
  .member-number {
    width: 32px;
    height: 32px;
    font-size: 0.9em;
  }
  
  .member-title {
    font-size: 1em;
  }
  
  .add-member-btn,
  .add-sibling-btn,
  .calculate-btn,
  .reset-btn {
    padding: 13px 20px;
    font-size: 0.95rem;
    min-height: 48px;
  }
  
  .result-value {
    font-size: 2.4em;
  }
  
  .result-range {
    font-size: 1em;
  }
  
  .eligibility-guide {
    padding: 16px 14px;
  }
  
  .eligibility-guide h3 {
    font-size: 1.2em;
  }
  
  .eligibility-guide li {
    font-size: 0.9em;
    padding: 8px 0;
  }
  
  .fee-amount {
    font-size: 1.8em;
  }
  
  .savings-amount {
    font-size: 2.4rem;
  }
  
  .benefit-icon {
    font-size: 1.2rem;
  }
  
  .benefits-table td {
    font-size: 0.85rem;
    padding: 8px 0;
  }
  
  .benefits-table td::before {
    font-size: 0.7rem;
    min-width: 90px;
  }
}

/* Extra Small Devices (max-width: 380px) - iPhone SE, small Android */
@media (max-width: 380px) {
  .calculator-container {
    margin: 8px 5px;
    padding: 16px 12px;
  }
  
  .calculator-header h1 {
    font-size: 1.4em;
  }
  
  .calculator-header .arabic-subtitle {
    font-size: 1em;
  }
  
  .calculator-section {
    padding: 14px 12px;
  }
  
  .calculator-section h2 {
    font-size: 1.1em;
  }
  
  .section-number {
    width: 30px;
    height: 30px;
    font-size: 0.95em;
  }
  
  .form-group label {
    font-size: 0.95em;
  }
  
  .form-group input[type="number"],
  .form-group select {
    padding: 11px 12px;
    font-size: 0.92rem;
    min-height: 44px;
  }
  
  .household-member {
    padding: 12px;
  }
  
  .add-member-btn,
  .add-sibling-btn,
  .calculate-btn,
  .reset-btn {
    padding: 12px 18px;
    font-size: 0.92rem;
    min-height: 46px;
  }
  
  .result-value {
    font-size: 2.2em;
  }
  
  .fee-amount {
    font-size: 1.6em;
  }
  
  .savings-amount {
    font-size: 2.2rem;
  }
  
  .benefits-table td::before {
    min-width: 80px;
    font-size: 0.68rem;
  }
}

/* Landscape Orientation Optimization for Mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .calculator-header::before {
    position: relative;
    top: 0;
    margin-bottom: 10px;
  }
  
  .calculator-header {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .calculator-section {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .result-container {
    padding: 20px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  button,
  input[type="number"],
  input[type="submit"],
  select,
  .currency-option,
  .delete-member-btn {
    min-height: 48px;
    touch-action: manipulation;
  }
  
  /* Prevent double-tap zoom on buttons */
  button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  }
  
  /* Better hover feedback for touch devices */
  .calculator-section:active {
    transform: scale(0.99);
  }
  
  .currency-option:active,
  button:active {
    transform: scale(0.97);
  }
}

/* High DPI Displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders and shadows */
  .calculator-container {
    border-width: 1.5px;
  }
  
  .calculator-section {
    border-width: 1.5px;
  }
}

/* Print Optimization */
@media print {
  .lang-selector-floating,
  .btn-return-home,
  .add-member-btn,
  .add-sibling-btn,
  .delete-member-btn,
  .button-group,
  .progress-indicator {
    display: none;
  }
  
  .calculator-container {
    box-shadow: none;
    border: 1px solid #333;
    background: white;
  }
  
  .calculator-header h1,
  .calculator-section h2,
  .form-group label {
    color: #000;
  }
  
  .result-container {
    background: #f5f5f5;
    border: 2px solid #333;
  }
}
