/* ==============================================
   DEVIVE — Shared Components CSS
   Header, Footer, Mobile Nav, Cookie Banner, Buttons
   ============================================== */

/* Ensure all needed CSS variables exist */
:root {
    --bg-primary: #0D0D12;
    --bg-secondary: #13131A;
    --bg-card: #1A1A24;
    --bg-card-hover: #22222E;
    --card-dark: #0A0A0F;
    --accent: #E63946;
    --accent-hover: #d32f3d;
    --accent-glow: rgba(230, 57, 70, 0.4);
    --text-dark: #1A1A2E;
    --text-light: #FFFFFF;
    --text-muted: #6B7280;
    --text-muted-dark: #8B8B9E;
    --grad-purple: #8B5CF6;
    --grad-pink: #EC4899;
    --grad-orange: #F97316;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Lato', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --max-width: 1200px;
    --text-xs: 0.875rem;
    --text-sm: 1rem;
    --text-base: 1.125rem;
    --text-md: 1.25rem;
    --text-lg: 1.5rem;
}

/* ====================== CONTAINER ====================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

/* ====================== BUTTONS ====================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 10px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #c62d3a 100%);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(230,57,70,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(230,57,70,0.4); }
.btn-light { background: var(--text-light); color: var(--text-dark); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(0,0,0,0.3); }

/* ====================== HEADER ====================== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(13,13,18,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.3s ease;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    transition: padding 0.3s ease;
}
.header.scrolled .header-inner { padding: 10px 24px; }
.header.scrolled .nav-cta { padding: 10px 20px; font-size: 0.875rem; }
.header.scrolled .logo { font-size: 1.3rem; }
.header.scrolled .logo-pulse { width: 18px; height: 18px; }
.logo { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg); letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 8px; transition: font-size 0.3s ease; color: var(--text-light); text-decoration: none; }
.logo-pulse { width: 22px; height: 22px; flex-shrink: 0; transition: width 0.3s ease, height 0.3s ease; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav-link { font-family: var(--font-heading); font-weight: 500; font-size: var(--text-sm); color: var(--text-muted-dark); transition: color 0.2s; text-decoration: none; }
.nav-link:hover { color: var(--text-light); }
.nav-cta { margin-left: 16px; transition: padding 0.3s ease, font-size 0.3s ease; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text-light); margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* Mobile menu */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13,13,18,0.97);
    backdrop-filter: blur(20px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-family: var(--font-heading); font-size: var(--text-md); font-weight: 500; color: var(--text-light); text-decoration: none; }
.mobile-nav-close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: var(--text-light); font-size: 2rem; cursor: pointer; }

/* ====================== FOOTER + CTA ====================== */
.footer { background: var(--card-dark); position: relative; overflow: hidden; }
.footer-cta { padding: 64px 0 96px; position: relative; overflow: hidden; }
.cta-card {
    padding: 56px 40px;
    text-align: center;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.cta-card h2 { font-family: var(--font-heading); font-weight: 500; line-height: 1.2; font-size: 2.25rem; margin-bottom: 16px; letter-spacing: -0.02em; }
.cta-card > p { font-size: var(--text-base); opacity: 0.85; margin-bottom: 32px; max-width: 520px; }
.cta-buttons { display: flex; gap: 16px; margin-bottom: 16px; }
.cta-note { font-size: var(--text-xs); opacity: 0.6; }

.footer-content { padding: 48px 0 24px; position: relative; }
.footer-content::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.5), rgba(236,72,153,0.5), rgba(249,115,22,0.5), transparent);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .logo { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.footer-brand p { color: var(--text-muted); margin-bottom: 20px; font-size: var(--text-base); max-width: 280px; line-height: 1.6; }
.footer-social { display: flex; gap: 8px; }
.social-link {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
    text-decoration: none;
}
.social-link:hover { background: var(--accent); border-color: var(--accent); }
.social-link svg { width: 18px; height: 18px; }
.footer-column h4 { font-family: var(--font-heading); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px; color: var(--text-muted); font-weight: 500; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-light); font-size: var(--text-base); opacity: 0.85; transition: color 0.2s; text-decoration: none; }
.footer-links a:hover { color: var(--accent); opacity: 1; }
.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { color: var(--text-muted); text-decoration: none; opacity: 0.7; transition: opacity 0.2s; }
.footer-legal a:hover { opacity: 1; }

/* Card styles used in CTA */
.dark-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}
.dark-card > * { position: relative; z-index: 1; }
.grain-overlay { position: relative; }
.grain-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    mix-blend-mode: overlay;
    border-radius: inherit;
}
.gradient-pink-purple::before {
    content: "";
    position: absolute;
    bottom: -30%; left: 10%;
    width: 80%; height: 80%;
    background: radial-gradient(ellipse at center, rgba(236,72,153,0.4) 0%, rgba(139,92,246,0.25) 50%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Section divider (used before footer) */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(139,92,246,0.3) 25%, rgba(236,72,153,0.3) 50%, rgba(230,57,70,0.3) 75%, transparent 100%);
    border: none;
}

/* ====================== COOKIE BANNER ====================== */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner__inner { max-width: var(--max-width); margin: 0 auto; padding: 28px 24px; }
.cookie-banner__text { margin-bottom: 20px; }
.cookie-banner__title { font-family: var(--font-heading); font-size: var(--text-md); font-weight: 600; margin-bottom: 8px; color: var(--text-light); }
.cookie-banner__text p { font-size: var(--text-sm); color: var(--text-muted-dark); line-height: 1.6; margin: 0; }
.cookie-banner__link { color: var(--accent) !important; text-decoration: underline !important; opacity: 1 !important; }
.cookie-banner__link:hover { color: var(--accent-hover) !important; }
.cookie-banner__buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 160px;
    text-align: center;
}
.cookie-btn--primary { background: linear-gradient(135deg, var(--accent) 0%, #c62d3a 100%); color: var(--text-light); box-shadow: 0 4px 15px rgba(230,57,70,0.3); }
.cookie-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(230,57,70,0.4); }
.cookie-btn--secondary { background: rgba(255,255,255,0.05); color: var(--text-light); border: 1px solid rgba(255,255,255,0.15); }
.cookie-btn--secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.cookie-btn--save { margin-top: 16px; flex: none; width: 100%; }
.cookie-settings { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.4s ease; margin-top: 0; }
.cookie-settings.open { max-height: 500px; margin-top: 24px; }
.cookie-settings__option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cookie-settings__option:last-of-type { border-bottom: none; }
.cookie-settings__info { flex: 1; }
.cookie-settings__info strong { display: block; font-family: var(--font-heading); font-size: var(--text-sm); font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
.cookie-settings__info span { font-size: var(--text-xs); color: var(--text-muted-dark); line-height: 1.5; }
.cookie-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; }
.cookie-toggle__slider { position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.1); border-radius: 26px; transition: 0.3s; }
.cookie-toggle__slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: var(--text-light); border-radius: 50%; transition: 0.3s; }
.cookie-toggle input:checked + .cookie-toggle__slider { background: var(--accent); }
.cookie-toggle input:checked + .cookie-toggle__slider::before { transform: translateX(22px); }
.cookie-toggle--disabled .cookie-toggle__slider { cursor: not-allowed; opacity: 0.5; }
.cookie-toggle--disabled input:checked + .cookie-toggle__slider { background: rgba(230,57,70,0.4); }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu-btn { display: block; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-brand p { margin: 0 auto 20px; }
    .footer-social { justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
    .cta-card { padding: 32px; }
    .cta-card h2 { font-size: 1.75rem; }
    .cta-buttons { flex-direction: column; width: 100%; }
    .cta-buttons .btn { width: 100%; }
    .cookie-banner__inner { padding: 20px 16px; }
    .cookie-banner__buttons { flex-direction: column; }
    .cookie-btn { min-width: auto; width: 100%; }
}
