:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: rgba(59, 130, 246, 0.1);
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-heading: #1E293B;
    --text-body: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --code-bg: #0F172A;
    --indigo: #6366F1;
    --male: #0284C7;
    --male-light: rgba(2, 132, 199, 0.05);
    --female: #DB2777;
    --female-light: rgba(219, 39, 119, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease;
}

/* --- Header --- */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 72px;
    height: auto;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo small {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.logo-symbols {
    display: flex;
    gap: 0.25rem;
    font-size: 1.35rem;
    margin-left: 0.2rem;
}

.logo-symbols .male {
    color: var(--male);
}

.logo-symbols .female {
    color: var(--female);
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-heading);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.menu-btn:hover {
    background-color: var(--bg-card);
}

nav a {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--text-body);
    background: var(--bg-body);
}

.lang-btn.active {
    color: var(--primary);
    border-color: var(--primary-light);
    background: var(--primary-light);
}

/* --- Main Layout --- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 72px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* --- Home View --- */
.hero {
    text-align: center;
    margin-top: 5rem;
    margin-bottom: 6rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.06em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero p {
    font-size: 1.35rem;
    color: var(--text-body);
    max-width: 650px;
    margin: 0 auto 3.5rem;
    font-weight: 400;
}

#v1Badge {
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.8125rem;
    text-transform: uppercase;
    background: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
}

#v1Badge.badge-link {
    cursor: pointer;
    transition: var(--transition);
}

#v1Badge.badge-link:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.search-hub {
    max-width: 650px;
    margin: 4rem auto 0;
    position: relative;
    transition: var(--transition);
}

.tooltip-container {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: help;
}

.tooltip-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.tooltip-icon:hover {
    color: var(--primary);
}

.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: var(--text-heading);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    line-height: 1.4;
    position: absolute;
    z-index: 10;
    bottom: 150%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-heading) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.search-box {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 1.25rem;
    border: 2px solid var(--border);
    display: flex;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-family: inherit;
    background: transparent;
    color: var(--text-heading);
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.search-box button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* --- Result States --- */
.result-panel {
    margin-top: -1.75rem;
    text-align: left;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 1.5rem;
    padding: 5rem 3.5rem 3.5rem;
    box-shadow: var(--shadow-md);
    display: none;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.baby-container {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 250px;
    height: 250px;
    opacity: 0;
    transition: all 0.8s ease 0.2s;
    pointer-events: none;
}

.baby-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.res-item .label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
}

.res-item .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
}

.gender-display {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.gender-symbol {
    font-size: 3.5rem;
}

.gender-badge {
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Gender Themes */
.state-male {
    background-color: #f0f9ff !important;
    border-color: #bae6fd !important;
}

.state-male .gender-badge {
    background: var(--male);
    color: white;
}

.state-male .gender-symbol {
    color: var(--male);
}

.state-male .baby-container {
    opacity: 0.8;
    transform: rotate(-5deg);
}

.state-female {
    background-color: #fdf2f8 !important;
    border-color: #fbcfe8 !important;
}

.state-female .gender-badge {
    background: var(--female);
    color: white;
}

.state-female .gender-symbol {
    color: var(--female);
}

.state-female .baby-container {
    opacity: 0.8;
    transform: rotate(5deg);
}

/* --- Documentation View --- */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
}

.docs-sidebar {
    position: sticky;
    top: 120px;
    height: calc(100vh - 140px);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-section {
    margin-bottom: 3rem;
}

.sidebar-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.sidebar-nav li a {
    display: block;
    padding: 0.65rem 0;
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    padding-left: 1.25rem;
    transition: var(--transition);
}

.sidebar-nav li a:hover {
    color: var(--text-heading);
    border-left-color: var(--border);
}

.sidebar-nav li a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

.docs-content {
    max-width: 850px;
}

.docs-content section {
    margin-bottom: 5rem;
}

.docs-content h2 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.docs-content h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    margin: 3rem 0 1.25rem;
    letter-spacing: -0.02em;
}

.docs-content p {
    margin-bottom: 1.5rem;
    color: var(--text-body);
    font-size: 1.0625rem;
}

/* --- Components --- */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary-light);
    color: var(--primary-hover);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9em;
    font-weight: 500;
}

.code-block {
    background: var(--code-bg);
    border-radius: 1rem;
    padding: 1.75rem;
    margin: 2rem 0;
    position: relative;
    box-shadow: var(--shadow-md);
}

.code-block code {
    background: transparent;
    color: #E2E8F0;
    padding: 0;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.admonition {
    background: var(--primary-light);
    border-left: 5px solid var(--primary);
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    margin: 2.5rem 0;
}

.admonition.ethics-alert {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.admonition>strong:first-child {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 800;
}

.admonition.ethics-alert>strong:first-child {
    color: #b45309;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
}

th {
    text-align: left;
    padding: 1rem 1.25rem;
    border-bottom: 3px solid var(--border);
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text-heading);
    text-transform: uppercase;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
}

footer {
    margin-top: 6rem;
    padding: 5rem 2rem;
    border-top: 2px solid var(--border);
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* --- Utility --- */
.highlight {
    color: var(--primary);
}

@media (max-width: 950px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        display: none;
    }

    .hero h1 {
        font-size: 2.75rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .baby-container {
        width: 150px;
        height: 150px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    main {
        padding: 1.5rem 1rem;
    }

    .hero {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0.5rem;
    }

    .search-box input {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    .search-box button {
        width: 100%;
        margin-top: 0.5rem;
    }

    .result-panel {
        padding: 2.5rem 1.25rem 1.25rem;
        border-radius: 1rem;
    }

    .result-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .res-item[style*="grid-column: span 2;"] {
        grid-column: span 1 !important;
    }

    .gender-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .baby-container {
        display: block;
        width: 120px;
        height: 120px;
        right: -5px;
        bottom: -5px;
    }

    .state-male .baby-container,
    .state-female .baby-container {
        opacity: 0.45 !important;
    }

    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .docs-sidebar {
        display: none;
    }

    .docs-content {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .docs-content p,
    .docs-content li,
    .docs-content h1,
    .docs-content h2,
    .docs-content h3,
    .docs-content h4 {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .docs-content p code {
        display: inline-block;
        max-width: 100%;
        white-space: nowrap;
        overflow-x: auto;
        vertical-align: bottom;
    }

    .code-block {
        padding: 1rem;
        border-radius: 0.5rem;
        max-width: 100%;
        overflow-x: auto;
    }

    .code-block pre {
        white-space: pre-wrap;
        word-break: break-all;
    }

    .admonition {
        padding: 1rem;
        max-width: 100%;
        word-break: break-word;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    .docs-content table {
        width: 100%;
        white-space: nowrap;
    }

    .search-hub {
        margin: 2rem auto 0;
    }

    /* Navbar Responsiveness - Material Design Hamburger */
    .nav-container {
        padding: 0 1rem;
        height: 72px;
        position: relative;
    }

    .menu-btn {
        display: flex;
        margin-left: auto;
    }

    nav#mainNav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1.5rem 1.5rem;
        box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.12);
        border-bottom: 2px solid var(--border);
        gap: 0.25rem;
        z-index: 200;
    }

    nav#mainNav.active {
        display: flex;
    }

    nav#mainNav a {
        padding: 0.75rem 0.5rem;
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    nav#mainNav a:last-of-type {
        border-bottom: none;
    }

    .lang-switcher {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
}