/* Glassmorphism V2 Utilities */
.glass-card {
    background: rgba(var(--card-bg-rgb), 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Sophisticated border */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    overflow: hidden;
}

/* Glass Grain Effect Overlay */
.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.light-theme .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-nav-blur {
    background: rgba(var(--bg-color-rgb), 0.7) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
}

/* Background Video Overlay */
.video-bg-container {
    position: relative;
    overflow: hidden;
}

.video-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(var(--bg-color-rgb), 0.8), rgba(var(--bg-color-rgb), 0.9));
    z-index: 1;
}

/* -------------------------------------------------------------------------- */
/*                                Root Variables                             */
/* -------------------------------------------------------------------------- */
:root {
    --bg-color: #050505;
    --bg-color-rgb: 5, 5, 5;
    --bg-off-color: #0a0a0a;
    --text-color: #ffffff;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.08);
    --card-bg: #0f0f0f;
    --card-bg-rgb: 15, 15, 15;

    /* Brand Colors */
    --brand-pink: #FF3278;
    --brand-dark: #cc1e58;
    --brand-accent: #FF5C93;

    /* Gradients */
    --brand-gradient: linear-gradient(135deg, #FF3278 0%, #FF5C93 100%);
    --dark-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
    --card-gradient: linear-gradient(145deg, #0f0f0f, #050505);

    /* Shapes & Borders */
    --skew-degree: -3deg;
    --border-radius-sm: 4px;
    --border-radius-md: 12px;
    --border-radius-lg: 24px;
}

.light-theme {
    --bg-color: #ffffff;
    --bg-color-rgb: 255, 255, 255;
    --bg-off-color: #f8f9fa;
    --text-color: #0c0c0c;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --card-bg-rgb: 255, 255, 255;
    --brand-pink: #FF3278;
    --card-gradient: linear-gradient(145deg, #ffffff, #f3f4f6);
}

/* -------------------------------------------------------------------------- */
/*                                Global Reset                                */
/* -------------------------------------------------------------------------- */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

/* Force dark text for adaptive classes in light mode if tailwind misses them */
.light-theme .text-adaptive {
    color: #000000 !important;
}

.light-theme .bg-adaptive {
    background-color: #ffffff !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-font {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- V3: ORGANIC FLUIDITY & SIRI-STYLE OVERHAUL --- */

/* Siri-Style Mesh Gradient Background */
.siri-glow-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
    filter: blur(140px);
}

.siri-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(circle at 50% 50%,
            var(--brand-pink) 0%,
            rgba(255, 50, 120, 0.4) 25%,
            transparent 50%);
    animation: siri-fluid 15s infinite alternate ease-in-out;
}

.siri-glow:nth-child(2) {
    background: radial-gradient(circle at 30% 70%,
            #4f46e5 0%,
            rgba(79, 70, 229, 0.3) 30%,
            transparent 60%);
    animation-delay: -5s;
    animation-duration: 22s;
}

.siri-glow:nth-child(3) {
    background: radial-gradient(circle at 80% 20%,
            #0ea5e9 0%,
            rgba(14, 165, 233, 0.3) 30%,
            transparent 60%);
    animation-delay: -12s;
    animation-duration: 18s;
}

@keyframes siri-fluid {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(10%, -10%) rotate(120deg) scale(1.2);
    }

    66% {
        transform: translate(-15%, 5%) rotate(240deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(360deg) scale(1);
    }
}

/* Organic Notched Blob Shapes */
.shape-notch-blob {
    clip-path: url(#notch-blob-clip);
}

/* Wavy Section Separators */
.organic-divider-top {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    transform: rotate(180deg);
}

.organic-divider-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
}

.organic-divider-svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

/* Media Overlays for Contrast */
.media-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

[data-theme="dark"] .media-overlay {
    background: linear-gradient(to bottom, rgba(10, 10, 12, 0.85), rgba(10, 10, 12, 0.6));
}

[data-theme="light"] .media-overlay {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
}

/* V3 Glass Refinement */
.v3-glass {
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .v3-glass {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .v3-glass {
    background: rgba(10, 10, 12, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Animated Flow Gradient Text */
.text-flow-gradient {
    background: linear-gradient(90deg, var(--brand-pink), #4f46e5, #0ea5e9, var(--brand-pink));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flow-text 8s linear infinite;
}

@keyframes flow-text {
    to {
        background-position: 300% center;
    }
}

/* Section Contrast Fixes */
.v3-text-visibility {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .v3-text-visibility {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .v3-text-visibility {
    color: rgba(10, 10, 12, 0.95);
}

/* Theme Awareness Utilities */
.text-theme-text {
    color: var(--text-color);
}

.text-theme-muted {
    color: var(--text-muted);
}

/* Force light text in dark media sections during light mode */
[data-theme="light"] .v3-force-light-text .v3-text-visibility,
[data-theme="light"] .v3-force-light-text h1,
[data-theme="light"] .v3-force-light-text h2,
[data-theme="light"] .v3-force-light-text h3,
[data-theme="light"] .v3-force-light-text p,
[data-theme="light"] .v3-force-light-text .text-theme-text {
    color: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .v3-force-light-text .text-theme-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-pink);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-accent);
}

/* -------------------------------------------------------------------------- */
/*                               Utility Classes                              */
/* -------------------------------------------------------------------------- */
/* Text */
.text-brand {
    color: var(--brand-pink);
}

.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-outline {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
    color: transparent;
}

.light-theme .text-outline {
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
}

/* Backgrounds */
.bg-brand {
    background-color: var(--brand-pink);
}

.bg-gradient-brand {
    background: var(--brand-gradient);
}

.bg-card-gradient {
    background: var(--card-gradient);
}

/* Buttons */
.btn-brand {
    position: relative;
    padding: 12px 32px;
    background: var(--brand-gradient);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 50, 120, 0.3);
    padding-right: 40px;
}

.btn-brand::after {
    content: '→';
    position: absolute;
    right: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.btn-brand:hover::after {
    opacity: 1;
    right: 15px;
}

/* Clip Path Shapes */
.clip-diagonal {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.clip-diagonal-reverse {
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

.clip-card {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 90% 100%, 0 100%);
}

/* V2 Animated Borders */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--brand-gradient);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.border-glow:hover::before {
    opacity: 1;
}

/* Improved Modern Cards */
.modern-card {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.modern-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--brand-pink);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 50, 120, 0.1);
}

/* -------------------------------------------------------------------------- */
/*                                 Animations                                 */
/* -------------------------------------------------------------------------- */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 50, 120, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 50, 120, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 50, 120, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* -------------------------------------------------------------------------- */
/*                            Loading Screen                                  */
/* -------------------------------------------------------------------------- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: #333;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--brand-gradient);
    animation: loadProgress 2s ease-in-out forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* -------------------------------------------------------------------------- */
/*                             Specific Components                            */
/* -------------------------------------------------------------------------- */
/* Navbar */
.glass-nav {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 0;
    width: 100%;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.form-input:focus {
    outline: none;
    border-bottom-color: var(--brand-pink);
}

.form-label {
    position: absolute;
    top: 12px;
    left: 0;
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-input:focus~.form-label,
.form-input:not(:placeholder-shown)~.form-label {
    top: -10px;
    font-size: 0.8rem;
    color: var(--brand-pink);
}