@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Nanum+Pen+Script&family=Gaegu:wght@400;700&display=swap');
/* Casual Baby Fonts - Gaegu for extra casual feel */

:root {
    /* 🤰 Pregnancy Pink/Lavender Theme */
    --primary-color: #E91E8C;
    /* Hot Pink */
    --primary-light: #FCE4EC;
    --primary-dark: #AD1457;
    --secondary-color: #9C27B0;
    /* Lavender */
    --secondary-light: #E1BEE7;
    --accent-color: #CE93D8;
    /* Light Purple */
    --accent-light: #F3E5F5;
    --gradient-start: #F48FB1;
    --gradient-end: #CE93D8;

    /* Background & Cards */
    --bg-color: #FFF9F5;
    /* Warm cream background */
    --card-bg: #FFFFFF;
    --card-shadow: 0 8px 30px rgba(255, 158, 170, 0.15);

    /* Text */
    --text-main: #5D4E4E;
    /* Warm brown */
    --text-sub: #9B8A8A;
    --text-accent: #FF7A8A;

    /* Borders & Effects */
    --border-color: #FFE4E8;
    --shadow: 0 10px 25px rgba(255, 158, 170, 0.12);
    --radius: 28px;
    --radius-small: 16px;

    /* Fonts */
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-casual: 'Jua', 'Gaegu', cursive;
    --font-handwriting: 'Gaegu', 'Nanum Pen Script', cursive;
}

[data-theme="dark"] {
    /* Cozy Night Theme */
    --primary-color: #FFB5BD;
    --primary-light: #4A3538;
    --secondary-color: #7ECFBE;
    --bg-color: #2A2424;
    --card-bg: #3D3333;
    --text-main: #FFF0F2;
    --text-sub: #C9B5B8;
    --border-color: #4A3538;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.7;
    /* Cute polka dot pattern */
    background-image:
        radial-gradient(circle, var(--primary-light) 2px, transparent 2px),
        radial-gradient(circle, var(--secondary-light) 1.5px, transparent 1.5px);
    background-size: 40px 40px, 60px 60px;
    background-position: 0 0, 20px 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 10px 0;
}

/* Search-first homepage hero */
.main-header.home-hero {
    display: block;
    position: relative;
    max-width: 760px;
    margin: 0 auto 16px;
    padding: 0;
}

.home-theme-toggle {
    position: absolute;
    top: 12px;
    right: max(12px, calc((100% - 620px) / 2 + 10px));
    z-index: 6;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(125, 79, 83, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 5px 18px rgba(91, 58, 54, 0.12);
    font-size: 1.15rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.home-theme-toggle:focus-visible {
    outline: 3px solid rgba(233, 30, 140, 0.28);
    outline-offset: 3px;
}

.home-hero-art {
    position: relative;
    width: min(calc(100% - 24px), 620px);
    height: auto;
    aspect-ratio: 12 / 5;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(197, 141, 129, 0.2);
    border-radius: 24px;
    background: #fff9ee;
    box-shadow: 0 14px 38px rgba(112, 77, 69, 0.12);
}

.home-hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-hero-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 252, 243, 0.38) 0%, rgba(255, 252, 243, 0.1) 52%, transparent 72%);
    pointer-events: none;
}

.home-hero-copy {
    position: absolute;
    top: 47%;
    left: clamp(22px, 4.5vw, 38px);
    z-index: 2;
    width: 58%;
    transform: translateY(-50%);
    color: #503933;
    text-align: left;
}

.home-hero-kicker {
    display: inline-block;
    margin-bottom: 7px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: #9f3e60;
    font-size: 0.84rem;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.home-hero-copy h1 {
    margin: 0;
    color: #432d29;
    font-family: var(--font-casual);
    font-size: clamp(1.65rem, 4vw, 2.3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.home-hero-copy p {
    margin: 10px 0 0;
    color: #6b4c46;
    font-size: clamp(0.9rem, 1.8vw, 1.02rem);
    font-weight: 800;
    line-height: 1.55;
}

.home-search {
    --search-muted: #6f5f62;
    position: relative;
    z-index: 8;
    width: calc(100% - 34px);
    margin: -28px auto 0;
    padding: 13px 14px 12px;
    border: 1px solid rgba(233, 30, 140, 0.14);
    border-radius: 22px;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 96%, transparent);
    box-shadow: 0 16px 38px rgba(91, 58, 54, 0.16);
    backdrop-filter: blur(14px);
}

[data-theme="dark"] .home-search {
    --search-muted: #d2c4c6;
}

[data-theme="dark"] .home-search-examples button:hover,
[data-theme="dark"] .site-search-fallback {
    color: #ffb5bd;
}

.home-search-control {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px 6px 18px;
    border: 2px solid #df4f89;
    border-radius: 18px;
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.home-search-control:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(233, 30, 140, 0.12);
}

.home-search-icon {
    flex: 0 0 auto;
    color: #bd3c73;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    transform: rotate(-18deg);
}

.home-search input[type='search'] {
    min-width: 0;
    flex: 1;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1.03rem;
    font-weight: 650;
    line-height: 1.4;
}

.home-search input[type='search']::placeholder {
    color: #756568;
    font-weight: 550;
}

.home-search input[type='search']::-webkit-search-cancel-button {
    display: none;
}

.home-search-clear {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--text-sub);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.home-search-submit {
    min-width: 74px;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #c82468, #8f1f5a);
    box-shadow: 0 7px 18px rgba(202, 40, 112, 0.25);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
}

.home-search-clear:focus-visible,
.home-search-submit:focus-visible,
.home-search-examples button:focus-visible,
.site-search-result:focus-visible {
    outline: 3px solid rgba(233, 30, 140, 0.28);
    outline-offset: 2px;
}

.home-search-examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.home-search-examples > span {
    padding-left: 3px;
    color: var(--search-muted);
    font-size: 0.88rem;
    font-weight: 750;
}

.home-search-examples button {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
}

.home-search-examples button:hover {
    border-color: #e18cac;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.home-search-note {
    margin: 8px 3px 0;
    color: var(--search-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.site-search-panel {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: 0 12px 26px rgba(91, 58, 54, 0.11);
}

.site-search-panel[hidden],
.site-search-safety[hidden],
.home-search-clear[hidden] {
    display: none;
}

.site-search-safety {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0b6b2;
    background: #fff0ef;
    color: #7f2420;
    font-size: 0.9rem;
    line-height: 1.55;
}

.site-search-safety strong {
    font-size: 0.98rem;
}

.site-search-safety a {
    width: fit-content;
    margin-top: 3px;
    color: #a11f1a;
    font-weight: 800;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.site-search-status {
    min-height: 24px;
    margin: 0;
    padding: 11px 15px 7px;
    color: var(--search-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.site-search-list {
    display: grid;
}

.site-search-result {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 3px 9px;
    min-height: 72px;
    padding: 13px 15px;
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
}

.site-search-result:hover,
.site-search-result.is-active {
    background: var(--primary-light);
}

.site-search-result-category {
    grid-row: 1;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f7e4eb;
    color: #a62e65;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.site-search-result strong {
    grid-column: 2;
    font-size: 0.97rem;
    line-height: 1.4;
}

.site-search-result-description {
    grid-column: 1 / -1;
    display: -webkit-box;
    overflow: hidden;
    color: var(--search-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.site-search-empty {
    display: block;
    padding: 22px 16px;
    border-top: 1px solid var(--border-color);
    color: var(--search-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: center;
}

.site-search-fallback {
    color: var(--primary-dark);
    font-weight: 750;
    text-decoration: none;
}

.site-search-disclaimer {
    margin: 0;
    padding: 10px 15px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    background: color-mix(in srgb, var(--bg-color) 72%, transparent);
    color: var(--search-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.home-hero-secondary {
    display: flex;
    justify-content: flex-end;
    width: calc(100% - 38px);
    margin: 8px auto 0;
}

.home-hero-secondary a {
    color: #6f5f62;
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}

.home-hero-secondary a span {
    color: var(--primary-dark);
    font-weight: 800;
}

[data-theme="dark"] .home-hero-secondary a {
    color: #d2c4c6;
}

[data-theme="dark"] .home-hero-secondary a span {
    color: #ffb5bd;
}

@media (max-width: 600px) {
    .home-page .app-container {
        padding: 10px;
    }

    .main-header.home-hero {
        margin-bottom: 10px;
    }

    .home-hero-art {
        width: 100%;
        height: auto;
        aspect-ratio: 2.08 / 1;
        border-radius: 19px;
    }

    .home-hero-image {
        object-position: 62% center;
    }

    .home-hero-copy {
        left: 18px;
        width: 61%;
    }

    .home-hero-kicker {
        margin-bottom: 4px;
        padding: 2px 7px;
        font-size: 0.75rem;
    }

    .home-hero-copy h1 {
        font-size: clamp(1.38rem, 6.4vw, 1.7rem);
    }

    .home-hero-copy p {
        margin-top: 7px;
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .home-theme-toggle {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
    }

    .home-search {
        width: calc(100% - 16px);
        margin-top: -18px;
        padding: 10px;
        border-radius: 19px;
    }

    .home-search-control {
        min-height: 56px;
        gap: 6px;
        padding-left: 13px;
        border-radius: 15px;
    }

    .home-search-icon {
        font-size: 1.55rem;
    }

    .home-search input[type='search'] {
        font-size: 0.94rem;
    }

    .home-search-submit {
        min-width: 58px;
        height: 44px;
        padding: 0 13px;
        border-radius: 12px;
        font-size: 0.9rem;
    }

    .home-search-examples {
        gap: 6px;
    }

    .home-search-examples button {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 0.84rem;
    }

    .home-search-note,
    .home-hero-secondary a {
        font-size: 0.86rem;
    }

    .site-search-result {
        padding: 12px;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo .icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.age-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
}

/* Tab Styles */
.tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-sub);
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}

/* Monetization & Lock Styles */
.blur-content {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.5s ease;
}

.unlocked .blur-content {
    filter: blur(0);
    user-select: auto;
    pointer-events: auto;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
    border-radius: var(--radius);
}

.lock-btn {
    background: #2D3436;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lock-btn:hover {
    transform: scale(1.05);
}

.premium-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #2D3436;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-sub);
}

#theme-toggle:not(.home-theme-toggle) {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#theme-toggle:not(.home-theme-toggle):hover {
    background-color: var(--border-color);
}

/* Cards - Soft Bubble Design */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(255, 158, 170, 0.2);
}

.card:hover::before {
    opacity: 1;
}

/* Form */
.input-section h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 20px;
}

.form-group-row {
    display: flex;
    gap: 15px;
}

.form-group-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-sub);
    font-size: 0.9rem;
}

input[type="date"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-number);
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 10px;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.radio-label input:checked+.radio-btn {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
}

/* Button - Playful Gradient */
.btn-primary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFB5BD 50%, var(--secondary-color) 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-casual);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 158, 170, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 158, 170, 0.45);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Results */
.hidden {
    display: none !important;
}

/* Result Tab Panels */
.result-tab-content {
    display: none;
}

.result-tab-content.active {
    display: block;
}

/* Result Tab Buttons */
.result-tab-btn {
    transition: all 0.3s ease !important;
}

.result-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 158, 170, 0.3);
}

.result-tab-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(255, 158, 170, 0.4) !important;
}

.summary-cheader {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

h1 {
    font-family: var(--font-casual);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

h2,
h3,
h4 {
    font-family: var(--font-casual);
    letter-spacing: -0.5px;
}

.age-text {
    font-size: 1.2rem;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.percentile-badges {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 12px;
    flex: 1;
}

.badge .label {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.badge .value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-number);
    color: var(--primary-color);
}

/* Charts */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card {
    position: relative;
    height: 400px;
    /* Fixed height for chart visibility */
}

.chart-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.chart-desc {
    margin-top: 15px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-sub);
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-sub);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .form-group-row {
        flex-direction: column;
        gap: 0;
    }

    .percentile-badges {
        flex-direction: column;
    }

    .badge {
        flex-direction: row;
        justify-content: space-between;
        padding: 15px 20px;
    }
}

/* Baby Icon Animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Accessibility - Screen reader only (SEO용 숨겨진 h1 등) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    background: #000;
    color: #fff;
    padding: 10px 20px;
    z-index: 99999;
    text-decoration: none;
    font-weight: bold;
}

/* ===========================================
   Sidebar Layout - Google AdSense Style
   =========================================== */

.sidebar-layout {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 📋 Week Sidebar (Left Navigation) */
.week-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    padding: 15px 10px;
}

.week-sidebar::-webkit-scrollbar {
    width: 6px;
}

.week-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.week-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.week-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.sidebar-title {
    font-family: var(--font-casual);
    font-size: 1rem;
    color: var(--primary-color);
    padding: 10px 12px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    text-align: center;
}

/* Trimester Group */
.trimester-group {
    margin-bottom: 15px;
}

.trimester-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-sub);
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trimester-header.t1 {
    border-left: 3px solid #E91E8C;
}

.trimester-header.t2 {
    border-left: 3px solid #9C27B0;
}

.trimester-header.t3 {
    border-left: 3px solid #7B1FA2;
}

/* Week Button in Sidebar */
.sidebar-week-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-week-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.sidebar-week-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(233, 30, 140, 0.3);
}

.sidebar-week-btn.active::before {
    content: '▶';
    position: absolute;
    left: -2px;
    font-size: 0.6rem;
}

/* Week emoji/icon */
.sidebar-week-btn .week-emoji {
    margin-right: 8px;
    font-size: 1rem;
}

/* Main Content Area (Right) */
.main-content-area {
    flex: 1;
    min-width: 0;
}

/* Mobile: Hide sidebar, show dropdown */
.mobile-week-select {
    display: none;
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--primary-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23E91E8C' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/pregnancy/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.1);
}

.mobile-week-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.2);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar-layout {
        flex-direction: column;
        padding: 0 15px;
    }

    .week-sidebar {
        display: none;
    }

    .mobile-week-select {
        display: block;
    }

    .main-content-area {
        width: 100%;
    }
}

/* Extra small screens - compact grids to single column */
@media (max-width: 600px) {
    .compact-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================
   🍼 Baby Name Tab Animations
   =========================================== */

/* Pulse glow animation for baby name tab button */
@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 140, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(233, 30, 140, 0.6);
    }
}

/* Fade in up animation for result reveal */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale pop animation for main baby name */
@keyframes scalePop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Shimmer effect for featured elements */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Baby name result card animation */
#babyname-result-section .card {
    animation: fadeInUp 0.5s ease-out;
}

/* Baby name tab button special styling */
.result-tab-btn[data-tab="babyname"] {
    position: relative;
    overflow: hidden;
}

.result-tab-btn[data-tab="babyname"]::after {
    content: '✨';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.8rem;
    animation: bounce 1s infinite;
}

/* Gender option hover effect */
.gender-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.2);
}

/* Style option hover effect */
.style-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.15);
}

/* Popular baby name badges */
#popular-babynames span:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

/* Saved section celebration animation */
#babyname-saved-section {
    animation: fadeInUp 0.5s ease-out, scalePop 0.5s ease-out 0.1s;
}

/* ===========================================
   🆕 UI/UX Improvements (2026-01)
   =========================================== */

/* Hide scrollbar for result tabs (cross-browser) */
#result-tabs::-webkit-scrollbar {
    display: none;
}

#result-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Loading skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-color: #f0f0f0;
    }

    50% {
        background-color: #e0e0e0;
    }

    100% {
        background-color: #f0f0f0;
    }
}

.skeleton {
    animation: skeleton-loading 1.2s ease-in-out infinite;
    border-radius: 8px;
    min-height: 20px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 32px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
}

/* Sidebar smooth scroll behavior */
.week-sidebar {
    scroll-behavior: smooth;
}

/* Highlight effect for current week */
.sidebar-week-btn.current {
    position: relative;
}

.sidebar-week-btn.current::after {
    content: '←Today';
    position: absolute;
    right: 5px;
    font-size: 0.6rem;
    color: #FF6B6B;
    font-weight: 700;
}

/* Improved mobile tab navigation */
@media (max-width: 600px) {
    #result-tabs {
        padding: 12px 8px;
        gap: 6px;
    }

    #result-tabs button {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
    }
}

/* Story and Season option animations */
.story-option:hover,
.season-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 30, 140, 0.15);
}

/* Card loading state */
.card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}
