/*
 * Sleep Cycle Calculator global styles (mobile-first, futuristic).
 * Author: Umar Riaz
 */
:root {
    --bg: #050b1f;
    --bg-2: #0b1634;
    --ink: #0f1f3c;
    --surface: #ffffff;
    --muted: #607091;
    --line: #d6e0f7;
    --primary: #2d79ff;
    --primary-2: #65b4ff;
    --success: #18b57a;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, #d9e8ff 0%, rgba(217,232,255,0) 50%),
        radial-gradient(900px 500px at 100% 0%, #d5ebff 0%, rgba(213,235,255,0) 45%),
        linear-gradient(165deg, #f6f9ff 0%, #eef4ff 45%, #f9fbff 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: #081a3b;
    line-height: 1.2;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.main-header {
    background: rgba(5, 11, 31, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(2, 8, 25, 0.35);
}

.navbar-brand, .navbar-dark .navbar-nav .nav-link { color: #fff; }
.navbar-dark .navbar-nav .nav-link:hover { color: #c3daff; }
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    line-height: 1;
}
.brand-logo {
    border-radius: 9px;
    box-shadow: 0 6px 14px rgba(6, 17, 38, 0.35);
}
.brand-text-wrap { display: inline-flex; flex-direction: column; gap: .1rem; }
.brand-title { font-size: .95rem; color: #fff; letter-spacing: .1px; }
.brand-subtitle { font-size: .68rem; color: #aecdff; font-weight: 600; }
#themeToggle { border-color: rgba(255,255,255,0.35); }
#themeToggle:hover { background: rgba(255,255,255,0.12); }

.site-main { min-height: 72vh; }

.hero-app {
    background: linear-gradient(135deg, #081730 0%, #112b58 50%, #1a4c95 100%);
    border-radius: 24px;
    padding: 1rem;
    box-shadow: 0 24px 52px rgba(10, 28, 64, 0.35);
    color: #f3f8ff;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.hero-grid-wide { grid-template-columns: 1fr; }

.hero-copy h1,
.hero-copy p,
.hero-copy h2,
.hero-copy span,
.hero-copy .lead { color: #f3f8ff; }
.hero-points {
    display: grid;
    gap: .5rem;
    color: #d6e8ff;
    font-size: 0.95rem;
}

.hero-points span i { margin-right: .35rem; }

.glass-panel {
    border-radius: 20px;
    padding: 1rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}

.hero-widget .form-control,
.hero-widget .form-select {
    border-radius: 12px;
    border: 1px solid #bdd8ff;
}

.mini-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: .5rem;
}

.mini-result {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 12px;
    text-align: center;
    padding: .55rem .45rem;
    color: #eef6ff;
    font-size: .8rem;
}

.mini-result strong {
    display: block;
    font-size: .95rem;
    color: #fff;
}
.mini-result.recommended {
    border-color: #9ac2ff;
    background: rgba(155, 198, 255, 0.22);
}

.calculator-dominant { min-height: 100%; }
.chip-dark {
    background: rgba(255,255,255,0.18);
    color: #e7f2ff;
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: 999px;
    padding: .2rem .55rem;
    font-size: .75rem;
    font-weight: 700;
}

.stock-banner,
.card,
.calculator-card,
.newsletter-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(20, 54, 104, 0.08);
}

.panel-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(20, 54, 104, 0.08);
}

.page-hero {
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    background: linear-gradient(140deg, #ffffff 0%, #f2f7ff 100%);
    border: 1px solid #cfe0ff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 700;
    color: #355d94;
    background: #eaf2ff;
    border: 1px solid #cfe2ff;
    border-radius: 999px;
    padding: .2rem .55rem;
    margin-bottom: .65rem;
}

.chip-muted {
    background: #edf4ff;
    color: #3e5f92;
    border: 1px solid #cfe2ff;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .55rem;
}

.app-input {
    border-radius: 12px;
    border: 1px solid #bfd6fb;
    background: #fcfdff;
}

.futuristic-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #4f78b6 50%),
        linear-gradient(135deg, #4f78b6 50%, transparent 50%),
        linear-gradient(to right, #e2edff, #e2edff);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px),
        calc(100% - 2.3rem) 0.45rem;
    background-size: 6px 6px, 6px 6px, 1px 1.8rem;
    background-repeat: no-repeat;
}

.app-input:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 .2rem rgba(47, 125, 255, 0.15);
}

.app-list-links li + li { margin-top: .4rem; }
.app-list-links a {
    color: #22477f;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.quick-answer-card {
    background: #f5f9ff;
    border: 1px solid #d6e5ff;
    border-radius: 12px;
    padding: .8rem;
    height: 100%;
}
.quick-answer-card h3 { color: #143568; }
.quick-answer-card p {
    color: #355585;
    font-size: .9rem;
    margin: 0;
}
.nap-tile {
    border: 1px solid #d4e3ff;
    background: #f6faff;
    border-radius: 12px;
    padding: .55rem .65rem;
}
.nap-tile strong {
    display: block;
    color: #0f2a57;
    font-size: .95rem;
}
.nap-tile span { color: #2e4f82; font-size: .84rem; }

.cycle-graphic {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .5rem;
}
.cycle-graphic .phase {
    border-radius: 12px;
    text-align: center;
    padding: .7rem .45rem;
    font-size: .82rem;
    font-weight: 700;
}
.cycle-graphic .light { background: #eaf4ff; color: #2f5d9a; border: 1px solid #cfe4ff; }
.cycle-graphic .deep { background: #dbe9ff; color: #204a86; border: 1px solid #bfd8ff; }
.cycle-graphic .rem { background: #edf5ff; color: #27538f; border: 1px solid #d0e4ff; }
.cycle-graphic .phase.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(48, 93, 161, 0.18);
}

.blog-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(20, 54, 104, 0.12);
}

.doc-page h2 { margin-top: 1.25rem; }
.doc-page p, .doc-page li { color: #2b436c; }

.score-ring {
    --score-angle: calc((var(--score) / 100) * 360deg);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(#2f7dff var(--score-angle), #dde8ff 0);
    display: grid;
    place-items: center;
}

.score-ring-inner {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    color: #15366a;
}

.score-ring-inner strong { font-size: 1.7rem; line-height: 1; }
.score-ring-inner span { font-size: .8rem; color: #5678aa; }

.score-chip {
    background: #f3f8ff;
    border: 1px solid #d6e5ff;
    border-radius: 10px;
    padding: .45rem .55rem;
    color: #2a4d83;
    font-weight: 600;
}

.stock-img {
    height: 200px;
    object-fit: cover;
}

.feature-tile i {
    color: var(--primary);
}

.result-card.recommended {
    border-color: #89b8ff;
    background: linear-gradient(150deg, #f3f8ff, #e8f2ff);
}

.btn {
    border-radius: 12px;
    font-weight: 600;
}

.btn-primary {
    border: none;
    background: linear-gradient(120deg, #2c76ff, #4f9cff);
}

.btn-primary:hover { filter: brightness(0.98); }

.site-footer {
    margin-top: 2rem;
    background: var(--bg);
    color: #d3e3ff;
}

.footer-link {
    color: #d3e3ff;
    margin-left: .85rem;
    font-size: .92rem;
}
.footer-logo {
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(6, 16, 36, 0.35);
}

.cookie-banner {
    position: fixed;
    right: .8rem;
    bottom: .8rem;
    max-width: 320px;
    background: #0f2347;
    border: 1px solid #355b98;
    color: #fff;
    border-radius: 12px;
    padding: .85rem;
    z-index: 1050;
    box-shadow: 0 12px 32px rgba(6, 18, 39, 0.4);
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .5s ease, transform .5s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.content-body h2,
.content-body h3 { margin-top: 1.25rem; }
.blog-single .content-body { line-height: 1.75; }
.blog-single .content-body p,
.blog-single .content-body li { color: #233f67; }

.accordion-item {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid #d9e6ff;
}

.ad-slot .ad-placeholder {
    border: 1px dashed #91b2de;
    border-radius: 12px;
    padding: .85rem;
    text-align: center;
    color: #3e5f90;
    background: #f3f8ff;
}

.admin-login,
.admin-body { background: #f2f6ff; }

.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f3f7ff;
}

.mobile-action-dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: .75rem;
    z-index: 1035;
    width: calc(100% - 1.1rem);
    max-width: 560px;
    background: rgba(10, 24, 50, 0.92);
    border: 1px solid rgba(150, 188, 246, 0.35);
    border-radius: 16px;
    padding: .45rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
    box-shadow: 0 16px 32px rgba(4, 12, 26, 0.45);
    backdrop-filter: blur(8px);
}

.dock-btn {
    border: 0;
    background: rgba(255,255,255,0.08);
    color: #e8f2ff;
    border-radius: 12px;
    min-height: 46px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    font-size: .68rem;
    font-weight: 700;
}

.dock-btn i { font-size: 1rem; }
.dock-btn:active { transform: scale(0.98); }

@media (min-width: 992px) {
    .hero-app { padding: 1.6rem; }
    .hero-grid { grid-template-columns: 1.3fr .9fr; gap: 1.2rem; }
    .hero-grid-wide { grid-template-columns: 1fr 1.2fr; }
    .stock-img { height: 100%; min-height: 230px; }
}

@media (max-width: 576px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .site-main { padding-bottom: 4.8rem; }
    .hero-app h1 { font-size: 1.7rem; }
    .hero-copy .lead { font-size: 1rem; }
    .mini-result { font-size: .74rem; }
    .cycle-graphic { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .brand-subtitle { display: none; }
    .site-footer .text-lg-end { text-align: left !important; margin-top: .75rem; }
    .footer-link { margin-left: 0; margin-right: .65rem; }
}

[data-theme="dark"] body {
    color: #dce8ff;
    background:
        radial-gradient(1200px 600px at 10% -10%, #142545 0%, rgba(20,37,69,0) 50%),
        radial-gradient(900px 500px at 100% 0%, #132847 0%, rgba(19,40,71,0) 45%),
        linear-gradient(165deg, #060d20 0%, #091429 45%, #0c1730 100%);
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 { color: #f2f7ff; }
[data-theme="dark"] .panel-card,
[data-theme="dark"] .card,
[data-theme="dark"] .page-hero {
    background: linear-gradient(180deg, #0f1e3a 0%, #132449 100%);
    border-color: #263b67;
    color: #d9e7ff;
}
[data-theme="dark"] .brand-subtitle { color: #c8dcff; }
[data-theme="dark"] .mobile-action-dock {
    background: rgba(7, 15, 31, 0.95);
    border-color: rgba(94, 127, 184, 0.55);
}
[data-theme="dark"] .dock-btn { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .text-muted { color: #a9bbdc !important; }
[data-theme="dark"] .app-input,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #0c1a36;
    color: #e6f0ff;
    border-color: #2a4372;
}
[data-theme="dark"] .futuristic-select {
    background-image:
        linear-gradient(45deg, transparent 50%, #9abdf2 50%),
        linear-gradient(135deg, #9abdf2 50%, transparent 50%),
        linear-gradient(to right, #2d4470, #2d4470);
}
[data-theme="dark"] .app-input:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: #4d78c4;
    box-shadow: 0 0 0 .2rem rgba(67, 123, 214, 0.25);
}
[data-theme="dark"] .accordion-item {
    border-color: #2b416f;
}
[data-theme="dark"] .accordion-button,
[data-theme="dark"] .accordion-body {
    background: #0f1d39;
    color: #deebff;
}
[data-theme="dark"] .nap-tile {
    background: #0f203f;
    border-color: #2a4472;
}
[data-theme="dark"] .nap-tile strong { color: #e8f2ff; }
[data-theme="dark"] .nap-tile span { color: #bcd2f2; }
[data-theme="dark"] .cycle-graphic .light,
[data-theme="dark"] .cycle-graphic .deep,
[data-theme="dark"] .cycle-graphic .rem {
    background: #0f203f;
    color: #d9eaff;
    border-color: #2a4574;
}
[data-theme="dark"] .quick-answer-card {
    background: #0f203f;
    border-color: #2a4472;
}
[data-theme="dark"] .quick-answer-card h3 { color: #ebf4ff; }
[data-theme="dark"] .quick-answer-card p { color: #bdd1ef; }
[data-theme="dark"] .score-ring { background: conic-gradient(#68a7ff var(--score-angle), #2a3f67 0); }
[data-theme="dark"] .score-ring-inner {
    background: #0f1f3e;
    color: #eaf2ff;
}
[data-theme="dark"] .score-ring-inner span { color: #adc4e8; }
[data-theme="dark"] .score-chip {
    background: #102241;
    border-color: #2d4876;
    color: #cbe0ff;
}
[data-theme="dark"] .cycle-graphic .phase.active {
    box-shadow: 0 10px 20px rgba(8, 18, 37, 0.5);
}

@media print {
    .main-header,
    .site-footer,
    .cookie-banner,
    #copyResult { display: none !important; }
    body { background: #fff; }
}
