/* --- PROFESSIONAL & MOBILE FRIENDLY THEME --- */
:root {
  --fd-bg-page: #F0F4F8;
  --fd-bg-card: #FFFFFF;
  --fd-primary: #1E40AF; /* Deep Blue */
  --fd-primary-light: #3B82F6;
  --fd-accent: #0EA5E9;
  --fd-text-dark: #1E293B;
  --fd-text-gray: #64748B;
  --fd-border: #E2E8F0;
  
  /* States */
  --fd-success-bg: #DCFCE7; --fd-success-text: #166534;
  --fd-warn-bg: #FEF9C3;    --fd-warn-text: #854D0E;
  --fd-err-bg: #FEE2E2;     --fd-err-text: #991B1B;
}

/* SHELL & WRAPPER */
.fd-shell {
  min-height: 100vh;
  padding: 10px 10px 30px;
  background: linear-gradient(180deg, #DBEAFE 0%, #F1F5F9 100%);
  box-sizing: border-box;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--fd-text-dark);
}

/* Leave room for mobile sticky CTA */
@media (max-width: 600px) {
  .fd-shell { padding-bottom: 110px; }
}
.fd-wrap {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* CARDS */
.fd-card {
  background: var(--fd-bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #FFFFFF;
}
@media(min-width: 768px) {
  .fd-card { padding: 24px; }
}

/* HERO SECTION - PREMIUM SaaS */
.fd-hero {
  background: radial-gradient(1200px 400px at 20% 0%, rgba(255,255,255,0.22), rgba(255,255,255,0) 55%),
              linear-gradient(135deg, #0F172A 0%, #1E3A8A 45%, #3B82F6 100%);
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 18px 45px rgba(2,6,23,0.35);
}

.fd-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fd-hero-logo {
  width: 44px;
  height: auto;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
}

.fd-hero-titlewrap { min-width: 0; }

.fd-hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-hero-subtitle {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255,255,255,0.85);
}

.fd-hero-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.fd-hero-valid {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}

.fd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fd-pill--ok { background: rgba(34, 197, 94, 0.18); color: #DCFCE7; }
.fd-pill--warn { background: rgba(234, 179, 8, 0.20); color: #FEF9C3; border-color: rgba(234,179,8,0.45); }
.fd-pill--err { background: rgba(239, 68, 68, 0.18); color: #FEE2E2; border-color: rgba(239,68,68,0.45); }
.fd-pill--neutral { background: rgba(148, 163, 184, 0.16); color: #E2E8F0; }

.fd-hero-cta {
  white-space: nowrap;
}

/* Sticky renew / buy button for mobile */
.fd-sticky-cta {
  display: none;
}

@media (max-width: 600px) {
  .fd-hero { padding: 14px; }
  .fd-hero-title { font-size: 18px; }
  .fd-hero-meta { flex-direction: column; align-items: flex-start; }
  .fd-hero-cta { width: 100%; text-align: center; }

  .fd-sticky-cta {
    display: block;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 9999;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 14px 35px rgba(2,6,23,0.45);
  }
}

.fd-btn-block { width: 100%; display: block; text-align: center; }

/* TYPOGRAPHY */
.fd-step-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--fd-text-dark); }
.fd-step-sub { font-size: 13px; color: var(--fd-text-gray); margin-bottom: 16px; line-height: 1.5; }
.fd-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--fd-text-gray); margin-bottom: 6px; letter-spacing: 0.5px; }

/* FORMS */
.fd-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media(min-width:600px){ .fd-form-grid { grid-template-columns: 1fr 1fr 1fr; } }

.fd-input, .fd-select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--fd-border);
  background: #F8FAFC;
  font-size: 15px;
  color: #000;
}
.fd-input:focus, .fd-select:focus {
  background: #FFF;
  border-color: var(--fd-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* BUTTONS */
.fd-btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.fd-btn {
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(to right, #2563EB, #1D4ED8);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.1s;
}
.fd-btn:active { transform: scale(0.96); }
.fd-btn.secondary { background: white; color: var(--fd-text-dark); border: 1px solid var(--fd-border); box-shadow: none; }
/* PDF Button */
.fd-btn-pdf {
  background: linear-gradient(to right, #DC2626, #991B1B);
  color: white;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.fd-btn-pdf:hover {
    box-shadow: 0 6px 15px rgba(220, 38, 38, 0.4);
}
.fd-btn-pdf:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* TABLES - FIXED MOBILE FRIENDLY */
.fd-table-wrap {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--fd-border);
}
.fd-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* This forces it to fit screen */
  background: white;
}
.fd-table th, .fd-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  word-wrap: break-word;
}
.fd-table th {
  background: #F8FAFC;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--fd-text-gray);
  font-weight: 700;
}
.fd-table td { font-size: 13px; color: var(--fd-text-dark); }
.fd-table tr:last-child td { border-bottom: none; }

/* Mobile tweaks for table */
@media (max-width: 500px) {
  .fd-table th, .fd-table td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .fd-table th:nth-child(1) { width: 40%; }
  .fd-table th:nth-child(2) { width: 15%; text-align: center; }
  .fd-table th:nth-child(3) { width: 15%; text-align: center; }
  .fd-table th:nth-child(4) { width: 30%; text-align: right; }
  
  .fd-table td:nth-child(2), .fd-table td:nth-child(3) { text-align: center; }
  .fd-table td:nth-child(4) { text-align: right; }
}

/* CHIPS */
.fd-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.fd-chip.missing { background: var(--fd-err-bg); color: var(--fd-err-text); }
.fd-chip.balanced { background: var(--fd-success-bg); color: var(--fd-success-text); }
.fd-chip.high { background: var(--fd-warn-bg); color: var(--fd-warn-text); }
.fd-chip.very-high { background: #FECACA; color: #991B1B; }

/* INFO BLOCKS */
.fd-grid-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.fd-info-box {
  background: #F8FAFC;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}
.fd-info-box.highlight {
  background: #F0F9FF;
  border-color: #BAE6FD;
  border-left: 4px solid #0EA5E9;
}
.fd-info-box.gold {
  background: #FFFFF0;
  border-color: #FEF08A;
  border-left: 4px solid #EAB308;
}
.fd-info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--fd-text-gray); margin-bottom: 4px; }
.fd-info-val { font-size: 14px; font-weight: 600; color: var(--fd-text-dark); line-height: 1.4; }

/* DAY CARDS */
.fd-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}
.fd-day-card{
  width:100%;
  text-align:left;
  background: linear-gradient(135deg, #0F172A, #111827);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  padding: 10px 10px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  color:#fff;
}
.fd-day-card:hover{
  transform: translateY(-2px);
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 10px 30px rgba(2,6,23,0.25);
}
.fd-day-card:active{
  transform: translateY(0);
}
.fd-day-card:hover { border-color: #93C5FD; transform: translateY(-2px); }
.fd-day-card.active{
  border-color: rgba(59,130,246,0.95);
  background: linear-gradient(135deg, #0B1224, #111827);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.35), 0 14px 40px rgba(0,0,0,0.28);
}
.fd-day-card.active .fd-day-title{ color:#fff; }
.fd-day-card.active .fd-day-sub{ color: rgba(226,232,240,0.90); }

.fd-day-title{font-weight:800; color:#fff; font-size:14px; letter-spacing:0.2px;}
.fd-day-sub{font-size:12px; color: rgba(226,232,240,0.85); margin-bottom:6px;}
.fd-badge-sev { display: inline-block; font-size: 10px; padding: 3px 6px; border-radius: 4px; font-weight: 700; background:#E2E8F0; color:#475569; }
.fd-badge-sev.good { background: #DCFCE7; color: #166534; }
.fd-badge-sev.alert { background: #FEF9C3; color: #854D0E; }
.fd-badge-sev.critical { background: #FEE2E2; color: #991B1B; }

/* GUIDANCE & SONG - UPDATED */
.fd-guidance-text { font-size: 14px; line-height: 1.6; color: #334155; }
.fd-guidance-text li { margin-bottom: 6px; }
.fm-song-panel {
  margin-top: 20px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  padding: 16px;
  border-radius: 16px;
  color: white;
  position: relative;
  overflow: hidden;
}

/* Audio Waves Animation */
.fm-audio-waves {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 30px;
  gap: 5px;
  margin-bottom: 12px;
}
.fm-audio-waves span {
  display: block;
  width: 5px;
  height: 10px;
  background: rgba(255,255,255,0.7);
  animation: fm-wave 1.2s ease-in-out infinite;
  border-radius: 3px;
}
.fm-audio-waves span:nth-child(2) { animation-delay: 0.2s; }
.fm-audio-waves span:nth-child(3) { animation-delay: 0.4s; }
.fm-audio-waves span:nth-child(4) { animation-delay: 0.6s; }
.fm-audio-waves span:nth-child(5) { animation-delay: 0.8s; }
@keyframes fm-wave {
  0%, 100% { height: 10px; background: rgba(255,255,255,0.7); }
  50% { height: 35px; background: rgba(255,255,255,1); }
}

audio { width: 100%; margin-top: 8px; height: 36px; border-radius: 8px; opacity: 0.9; }

/* FOOTER CREDIT - NEW */
.fd-footer-credit {
  text-align: center;
  font-size: 12px;
  color: #64748B;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #E2E8F0;
  font-weight: 600;
}

/* MISC */
.fd-sep { border: 0; border-top: 1px dashed #E2E8F0; margin: 20px 0; }

/* Download Container */
.fd-download-area {
  margin-top: 30px;
  margin-bottom: 10px;
  text-align: center;
}

/* --- SPECIAL PREDICTION BOXES --- */
.fd-special-prediction {
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border-left: 5px solid;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.fd-special-prediction.moolank-high {
  background: #F5F3FF; /* Light Purple */
  border-color: #7C3AED; /* Purple */
  color: #4C1D95;
}
.fd-special-prediction.bhagyank-high {
  background: #FFF7ED; /* Light Orange */
  border-color: #EA580C; /* Orange */
  color: #7C2D12;
}
.fd-sp-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fd-sp-sub {
  font-size: 14px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fd-special-prediction ul {
  margin: 8px 0 8px 20px;
  padding: 0;
}
.fd-special-prediction li {
  margin-bottom: 6px;
}

/* --- FEAT BIRTH GRID STYLES --- */
.fd-birth-grid-container {
  margin-top: 24px;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.fd-birth-grid-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  margin-top: 0px;
  margin-bottom: 20px;
}

.fd-birth-grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0px;
  width: 100%;
}

.fd-birth-grid {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
  max-width: 400px;
}

.fd-birth-grid td {
  width: 33.33%;
  height: 70px;
  border: 2px solid var(--fd-text-dark);
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  padding: 0;
  color: var(--fd-text-dark);
  font-weight: 600;
  background-color: white;
  transition: background-color 0.3s ease;
}

.fd-grid-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-text-gray);
  margin-top: 10px;
  text-align: center;
}

.fd-number-sections-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}

.fd-number-section {
  display: flex;
  align-items: center;
  background: var(--fd-primary);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  justify-content: space-between;
  width: 100%;
  transition: background-color 0.3s ease;
}

.fd-number-section.lucky {
  background: var(--fd-success-text);
  color: #D0FD9C;
}

.fd-number-section.enemy {
  background: var(--fd-err-text);
  color: white;
}

.fd-note-section {
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: var(--fd-text-gray);
  margin-top: 20px;
  text-align: center;
  line-height: 1.5;
  width: 100%;
  max-width: 400px;
}

/* Responsive adjustments for birth grid */
@media (max-width: 768px) {
  .fd-birth-grid td {
    height: 60px;
    font-size: 13px;
  }
  
  .fd-number-section {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .fd-birth-grid td {
    height: 50px;
    font-size: 12px;
  }
}

/* Add to existing styles */
.fd-pdf-format p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.fd-pdf-format ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.fd-pdf-format li {
  margin-bottom: 5px;
  line-height: 1.5;
}

/* Ensure content doesn't get cut */
.fd-content-wrapper {
  page-break-inside: avoid;
}

/* Handle page breaks */
@media print {
  .page-break {
    page-break-before: always;
  }
  
  .avoid-break {
    page-break-inside: avoid;
  }
}
.fd-day-card:focus-visible{outline: 2px solid rgba(59,130,246,0.85); outline-offset: 2px;}


/* ===== Logged-out marketing view ===== */
.fd-hero-meta--stack{flex-direction: column; align-items: flex-start;}
.fd-cta-row{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px;}
.fd-btn.ghost{background: transparent; border:1px solid rgba(148,163,184,0.45); color:#E2E8F0;}
.fd-btn.ghost:hover{border-color: rgba(148,163,184,0.75);}

.fd-card--marketing h2{margin-top:0;}
.fd-feature-grid{display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; margin-top:10px;}
.fd-feature{background: rgba(15,23,42,0.45); border:1px solid rgba(148,163,184,0.14); border-radius:14px; padding:12px;}
.fd-feature-title{font-weight:800; color:#F8FAFC; font-size:14px; margin-bottom:4px;}
.fd-feature-desc{color:#CBD5E1; font-size:13px; line-height:1.45;}

.fd-steps{margin:10px 0 0 18px; color:#E2E8F0;}
.fd-steps li{margin:8px 0; line-height:1.45;}
.fd-note{margin-top:12px; padding:10px 12px; border-radius:12px; background: rgba(30,64,175,0.15); border:1px solid rgba(59,130,246,0.25); color:#E2E8F0; font-size:13px;}

.fd-btn-block-sm{padding:10px 14px;}
@media (max-width: 720px){
  .fd-feature-grid{grid-template-columns: 1fr;}
}
@media (max-width: 600px){
  .fd-cta-row{flex-direction: column;}
  .fd-cta-row .fd-btn{width:100%; text-align:center;}
}



/* MARKETING (logged-out / locked) — ensure contrast */
.fd-card--marketing{
  background: radial-gradient(900px 320px at 15% 0%, rgba(59,130,246,0.18), rgba(15,23,42,0) 60%),
              linear-gradient(135deg, #0B1220 0%, #0F172A 55%, #111827 100%);
  border: 1px solid rgba(255,255,255,0.12);
  color: #F8FAFC;
}
.fd-card--marketing h2{ color:#FFFFFF; }
.fd-card--marketing p,
.fd-card--marketing ol,
.fd-card--marketing li{ color:#E2E8F0; }
.fd-card--marketing .fd-feature{ background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.10); }
.fd-card--marketing .fd-feature-title{ color:#FFFFFF; }
.fd-card--marketing .fd-feature-desc{ color:rgba(255,255,255,0.78); }
.fd-card--marketing .fd-note{ background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); color:#E2E8F0; }

/* Force hero typography (avoid theme overrides) */
.fd-hero .fd-hero-title{ color:#FFFFFF !important; }
.fd-hero .fd-hero-subtitle{ color: rgba(255,255,255,0.88) !important; }
.fd-hero .fd-hero-valid{ color: rgba(255,255,255,0.85) !important; }



/* Birth Grid: Moolank/Bhagyank inline line */
.fd-number-section.core{
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.25);
  color:#0F172A;
  border-radius:10px;
  padding:8px 10px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.fd-number-section.core .label{
  color:#0F172A;
  font-weight:700;
  font-size:12px;
}


@media (max-width: 520px){
  .fd-day-grid{ grid-template-columns: 1fr; }
}
