/* index.css - Barbie x Unicorn Light Premium Theme + Rainbow Beam Animation on H1 for Phi */
/* Pastel rainbow smoothness, consistent Barbie-pink-magenta-lavender-mint flow, dreamy glassmorphism */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-start:      #fff0f8;     /* soft blush pink */
    --bg-end:        #f0e8ff;     /* very light lavender */
    --surface:       #ffffff;
    --surface2:      rgba(255, 255, 255, 0.88);
    --text:          DarkSlateGray;          /* deep plum for contrast */
    --text-secondary:#6b4f7e;          /* muted lavender-gray */
    --accent:        DarkMagenta;          /* hot but pastel Barbie pink */
    --accent-dark:   #e0117f;          /* deeper magenta-pink */
    --accent-glow:   rgba(255, 93, 162, 0.35);
    --rainbow-pink:  #ff9fd6;
    --rainbow-peach: #febde2;
    --rainbow-yellow:#fff3ad;
    --rainbow-mint:  #bcffbc;
    --rainbow-cyan:  #a2edff;
    --rainbow-lav:   #c9b1ff;
    --border:        rgba(255, 93, 162, 0.20);
    --radius:        22px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /* Smooth pastel rainbow – many stops for buttery transitions */
    background: linear-gradient(
        to bottom,
        var(--bg-start)           0%,
        #fff5fa               10%,
        #ffebf5               20%,
        #ffe0f0               28%,
        #ffd4eb               35%,     /* strong pink */
        #ffccde               42%,
        #fec7d9               48%,
        #febde2               54%,     /* peach-pink */
        #ffe0cc               60%,
        #fff3ad               66%,     /* soft sunny yellow */
        #f0ffcc               72%,
        #d9ffcc               78%,     /* mint green */
        #a2edff               84%,     /* dreamy cyan */
        #c9b1ff               94%,     /* soft lavender */
        var(--bg-end)        100%
    );
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 1.05rem;
    overflow-x: hidden;
    min-height: 100vh;
}

/* NAV */
nav.sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 240, 248, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: relative;
}

.logo {
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #ff2d95, #c026d3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a,
.nav-links .dropdown-toggle {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links .dropdown-toggle:hover,
.nav-links .dropdown.active .dropdown-toggle {
    color: var(--accent);
}

/* Dropdown Container */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-toggle .arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-links .dropdown:hover .dropdown-toggle .arrow,
.nav-links .dropdown:focus-within .dropdown-toggle .arrow,
.nav-links .dropdown.open .dropdown-toggle .arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu Popup */
.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(255, 245, 250, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem 0;
    min-width: 170px;
    box-shadow: 0 16px 36px -6px rgba(255, 93, 162, 0.2);
    list-style: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1010;
}

.nav-links .dropdown:hover .dropdown-menu,
.nav-links .dropdown:focus-within .dropdown-menu,
.nav-links .dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(6px);
}

.nav-links .dropdown-menu li {
    margin: 0;
    padding: 0;
    display: block;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.55rem 1.35rem;
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 0;
}

.nav-links .dropdown-menu a:hover,
.nav-links .dropdown-menu a.active {
    background: rgba(255, 93, 162, 0.12);
    color: var(--accent);
    padding-left: 1.6rem;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

.nav-toggle .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
    position: relative;
    transition: background 0.2s;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--accent);
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease;
}

.nav-toggle .hamburger::before {
    top: -7px;
}

.nav-toggle .hamburger::after {
    top: 7px;
}

.nav-toggle.open .hamburger {
    background: transparent;
}

.nav-toggle.open .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.open .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* HERO */
header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: transparent;
}


.hero-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    margin-left: -6px;
    background: linear-gradient(90deg,
        var(--rainbow-pink) 0%,   var(--rainbow-peach) 14%,
        #fff3ad             28%,  var(--rainbow-mint) 42%,
        var(--rainbow-cyan) 56%,  var(--rainbow-lav)  70%,
        #ff9fd6             84%,  var(--rainbow-pink) 100%);
    background-size: 520% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    animation: rainbowBeam 4.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero-content h1:hover {
    animation: rainbowBeam 3.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    text-shadow: 0 0 80px HotPink;
}

section > div > p {
   padding-top: 25px;
}

@keyframes rainbowBeam {
    0%   { background-position: -90% 90%; }
    50%  { background-position: 0% -90%; }
}

.hero-subtitle {
    font-size: 1.15rem;
    max-width: 620px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* SECTIONS */
main {
    max-width: 1380px;
    margin: 0 auto;
    padding: 5rem clamp(1.5rem, 4vw, 5rem) 8rem;
    background: transparent;
}

section {
    margin-bottom: 6rem;
}

h2 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 2.5rem;
    text-align: center;
    color: HotPink;
}

/* PRODUCT / PACKAGE GRID */
.package-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.product-card, .package-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(12px);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.product-card:hover, .package-card:hover {
    transform: translateY(-16px);
    border-color: var(--accent);
    box-shadow: 0 30px 60px -15px rgba(0, 245, 196, 0.25);
}

.package-card h3, .product-card h3 {
    font-size: 1.65rem;
    margin-bottom: 1rem;
    color: HotPink;
}

.package-card p, .product-card p {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 1.05rem;
}

/* CARDS */

.package-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    gap: 2rem 2.4rem;
    align-items: start;
}

.package-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.6rem 1.9rem;
    backdrop-filter: blur(14px);
    transition: all 0.32s ease;
    box-shadow: 0 10px 28px -8px rgba(0,0,0,0.5);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.package-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 18px 40px -12px rgba(0,245,196,0.22);
}

.package-card h3 {
    font-size: 1.68rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: HotPink;
}

h3 { max-width:720px;margin:0 auto;margin-top:30px; }

section > p { max-width:720px;margin:0 auto;margin-top:30px; }

.package-card hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.8rem 0 1.1rem;
}

.package-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.6;
}

.package-card li {
    margin: 0.28rem 0;
}

.package-card a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.22s ease, padding-left 0.22s ease;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.package-card a:hover {
    color: var(--accent);
    padding-left: 0.5rem;
}

/* CODE SNIPPET – responsive & layout fit for desktop/mobile */
.code-snippet,
.package-card pre,
.product-card pre,
pre {
    background: #fff5fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--accent);
    margin: 1.5rem 0 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.grid-2 > * {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.library-index {
    padding: 100px;
}

/* LIBRARY INDEX – rainbow text matches hero */
.library-index h1 {
    font-size: clamp(3.2rem, 7vw, 5.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-align: center;
    margin: 0 0 4.2rem;
    background: linear-gradient(90deg,
        var(--rainbow-pink) 0%,   var(--rainbow-peach) 14%,
        #fff3ad             28%,  var(--rainbow-mint) 42%,
        var(--rainbow-cyan) 56%,  var(--rainbow-lav)  70%,
        #ff9fd6             84%,  var(--rainbow-pink) 100%);
    background-size: 520% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowBeam 4.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.library-index h1:hover {
    text-shadow: 0 0 45px var(--accent-glow);
}



/* DOCUMENTATION STYLES - World Class Barbie Unicorn Style */
.module-header {
    text-align: center;
    margin-bottom: 4.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.module-header h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.module-header .subtitle {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.module-description {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0 auto 4rem; /* Adjusted from 5rem for tighter flow to first H2 */
    max-width: 720px;
    text-align: center;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 4rem; /* Spacing between major sections */
    background: linear-gradient(135deg, HotPink, DarkMagenta);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

section:first-of-type h2 {
    margin-top: 0; /* Remove top margin for the very first H2 */
}

.doc-entry {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3.5rem; /* Spacious padding from index.html cards */
    margin-bottom: 5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 60px -20px rgba(255, 93, 162, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.doc-entry:hover {
    transform: translateY(-12px);
    border-color: var(--accent);
    box-shadow: 0 40px 80px -20px rgba(255, 93, 162, 0.3);
}

.doc-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: HotPink;
    margin-bottom: 2rem;
    max-width: none;
    margin-top: 0;
}

.doc-signature {
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.9;
}

.doc-description {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
    max-width: 100%;
    margin-top: 0;
}

.doc-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: DarkMagenta;
    margin-bottom: 1.25rem;
    opacity: 0.7;
}

.doc-implementation, .doc-example {
    background: transparent !important; /* Force transparency to avoid card-in-card */
    border: none !important;
    border-left: 3px solid rgba(255, 105, 180, 0.25) !important; /* Stronger left accent */
    border-radius: 0;
    padding: 0.5rem 0 0.5rem 2.5rem;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 1.1rem;
    line-height: 1.7;
    overflow-x: auto;
    color: var(--text-primary);
    margin-bottom: 3.5rem;
    white-space: pre;
}

.doc-example {
    margin-bottom: 0;
    color: var(--accent-dark);
}

/* FOOTER */
footer {
    background: linear-gradient(to bottom, #c9b1ff 50%);
    border-top: 1px solid var(--border);
    padding: 2.5rem clamp(2.5rem, 4vw, 1rem) 3rem;
}

.footer-columns {
    max-width: 1380px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
}

.footer-columns h4 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-columns a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-columns a:hover {
    color: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 860px) {
    .package-cards-grid { gap: 1.8rem 2rem; }
    .package-card { padding: 1.5rem 1.7rem; }

    .nav-container {
        padding: 0.85rem 1.25rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 240, 248, 0.98);
        backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.23, 1, 0.32, 1), padding 0.35s ease;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    }

    .nav-links.open {
        max-height: 600px;
        padding: 0.75rem 0;
        overflow-y: auto;
    }

    .nav-links > li {
        width: 100%;
    }

    .nav-links > li > a,
    .nav-links > li > .dropdown-toggle {
        padding: 0.75rem 1.5rem;
        width: 100%;
        justify-content: space-between;
        font-size: 1.05rem;
    }

    .nav-links .dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.45);
        border-radius: 12px;
        margin: 0.25rem 1.25rem 0.5rem 1.5rem;
        padding: 0.25rem 0;
        display: none;
    }

    .nav-links .dropdown:hover .dropdown-menu,
    .nav-links .dropdown:focus-within .dropdown-menu,
    .nav-links .dropdown.open .dropdown-menu {
        display: block;
    }

    .nav-links .dropdown-menu a {
        padding: 0.55rem 1.25rem;
        font-size: 0.95rem;
        white-space: normal;
    }

    .nav-links .dropdown-menu a:hover,
    .nav-links .dropdown-menu a.active {
        padding-left: 1.5rem;
    }
}

@media (max-width: 768px) {
    main { padding: 3.5rem 1.5rem 6rem; }
    h2 { font-size: 2.15rem; }
}

@media (max-width: 620px) {
    .library-index { padding: 2.5rem 1rem 5rem; }
    .library-index h1 { margin-bottom: 3.2rem; font-size: clamp(2.6rem, 9vw, 4rem); }
}
