/* 
    IDEAPRENEUR COMPONENT LIBRARY
    Version: Expert Refactor v2
*/

/* Navigation */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: background 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(42, 157, 143, 0.1);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo Fix: No gap between Idea and preneur, Larger size */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.03em;
}

.logo img {
    height: 80px;
    width: auto;
    margin-right: 0.25rem;
}

.logo-idea { color: var(--color-gold); }
.logo-preneur { color: var(--color-teal); }

.logo-light { display: none; }

[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
[data-theme="light"] .logo .logo-idea { color: #0c1a2e !important; }
[data-theme="light"] .logo .logo-preneur { color: #177a6d !important; }

/* Theme Toggle UI - Sliding Pill Design */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    width: 52px;
    height: 28px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--color-teal);
    box-shadow: 0 0 10px rgba(42, 157, 143, 0.2);
}

.toggle-knob {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle svg {
    width: 12px;
    height: 12px;
    transition: all 0.3s ease;
}

.icon-sun { display: none; color: var(--color-gold); }
.icon-moon { color: var(--color-teal); }

[data-theme="light"] .toggle-knob {
    transform: translateX(24px);
    background: rgba(255,255,255,0.92);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* Background hints for the toggle */
.theme-toggle::before,
.theme-toggle::after {
    position: absolute;
    font-size: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.theme-toggle::before {
    content: "☾";
    right: 8px;
}

.theme-toggle::after {
    content: "☀";
    left: 8px;
    opacity: 0;
}

[data-theme="light"] .theme-toggle::before { opacity: 0; }
[data-theme="light"] .theme-toggle::after { opacity: 0.3; }

/* Nav dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
    white-space: nowrap;
}

.nav-dropdown-trigger::after {
    content: " ▾";
    font-size: 0.6em;
    vertical-align: middle;
    opacity: 0.6;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 17, 32, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    padding: 0.75rem 0.5rem 0.5rem;
    min-width: 240px;
    z-index: 1001;
    list-style: none;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

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

.nav-dropdown-item {
    display: block;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: rgba(42, 157, 143, 0.1);
    color: var(--color-teal);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.375rem 0.5rem;
}

[data-theme="light"] .nav-dropdown-menu {
    background: rgba(253, 248, 244, 0.97);
}

/* Grid Systems */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Stack Cards */
.stack-card {
    background: rgba(27, 42, 74, 0.4);
    border: 1px solid rgba(42, 157, 143, 0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stack-card ul {
    flex: 1;
}

.stack-card .btn {
    margin-top: 1.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-card:hover {
    border-color: var(--color-teal);
    background: rgba(27, 42, 74, 0.6);
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Marquee */
.marquee-bar {
    background: rgba(42, 157, 143, 0.05);
    border-top: 1px solid rgba(42, 157, 143, 0.1);
    border-bottom: 1px solid rgba(42, 157, 143, 0.1);
    padding: 1rem 0;
    overflow: hidden;
}

.marquee-inner {
    display: flex;
    gap: 4rem;
    animation: marquee 40s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Visual Placeholder for Articles/Work */
.visual-box {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--color-navy-light), var(--color-navy-dark));
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(42, 157, 143, 0.1);
}

.visual-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(42, 157, 143, 0.1) 0%, transparent 70%);
}

/* Cards */
.card {
    background: rgba(27, 42, 74, 0.4);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.card:hover {
    background: rgba(27, 42, 74, 0.65);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-color: var(--color-teal);
}

.card-accent {
    border-color: rgba(244, 164, 0, 0.25);
    background: rgba(244, 164, 0, 0.04);
}

.card-accent:hover {
    border-color: var(--color-gold);
}

/* Grid layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Button variants */
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
    background: rgba(42, 157, 143, 0.08);
}

.btn-lg { padding: 1.125rem 2.5rem; font-size: 1.0625rem; }
.btn-sm { padding: 0.625rem 1.25rem; font-size: 0.875rem; }

.btn-ghost {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}
.btn-ghost:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.btn-nav {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn-nav:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

/* ─── Light mode overrides ───────────────────────────────── */
[data-theme="light"] .nav.scrolled {
    background: rgba(240, 249, 255, 0.88);
    backdrop-filter: blur(16px);
    border-bottom-color: rgba(42, 157, 143, 0.15);
    box-shadow: 0 1px 24px rgba(42, 100, 160, 0.08);
}

[data-theme="light"] .stack-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border-color: rgba(42, 157, 143, 0.18);
    box-shadow: 0 4px 20px rgba(30, 80, 140, 0.07), 0 1px 4px rgba(0,0,0,0.04);
}

[data-theme="light"] .stack-card:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 40px rgba(30, 80, 140, 0.12), 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-color: rgba(42, 157, 143, 0.18);
    box-shadow: 0 4px 16px rgba(30, 80, 140, 0.07), 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .card:hover {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 36px rgba(30, 80, 140, 0.12), 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .card-accent {
    background: rgba(244, 164, 0, 0.06);
    border-color: rgba(244, 164, 0, 0.22);
}

[data-theme="light"] .marquee-bar {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border-color: rgba(42, 157, 143, 0.12);
}

[data-theme="light"] .visual-box {
    background: linear-gradient(135deg, #d4e8f7, #e8f4ee);
    border-color: rgba(42, 157, 143, 0.15);
}

[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(42, 157, 143, 0.3);
}

[data-theme="light"] .btn-outline {
    border-color: rgba(42, 157, 143, 0.4);
    background: rgba(255, 255, 255, 0.4);
}

/* ─── Mobile Navigation ───────────────────────────────────── */
.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.nav-hamburger:hover { border-color: var(--color-teal); }

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    backdrop-filter: blur(4px);
}

.nav-sidebar-overlay.open { display: block; }

.nav-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 1200;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.nav-sidebar.open { right: 0; }

.nav-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.nav-sidebar-header .logo { font-size: 1.4rem; }
.nav-sidebar-header .logo img { height: 36px; }

.nav-sidebar-close {
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-sidebar-close:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.nav-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
}

.nav-sidebar-link {
    display: block;
    padding: 0.65rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.nav-sidebar-link:hover {
    background: rgba(42, 157, 143, 0.08);
    color: var(--color-teal);
}

.nav-sidebar-section {
    display: block;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.75rem 0.875rem 0.25rem;
}

.nav-sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.nav-sidebar-cta {
    padding-top: 1.25rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav-actions .btn-primary { display: none; }
    .nav-inner { width: 100%; }
    .logo { font-size: 1.4rem; }
    .logo img { height: 48px; }
}

[data-theme="light"] .nav-sidebar {
    background: var(--bg-primary);
}

[data-theme="light"] .nav-hamburger {
    border-color: rgba(42, 157, 143, 0.3);
}

[data-theme="light"] .btn-outline:hover {
    background: rgba(42, 157, 143, 0.1);
}

[data-theme="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(42, 157, 143, 0.25);
}

[data-theme="light"] .section-divided {
    border-color: rgba(42, 157, 143, 0.12);
}

/* Hero grid overlay */
.hero-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(42, 157, 143, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 157, 143, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
