/* =========================================
   1. CORE & ANIMATIONS
   ========================================= */

html {
    scroll-behavior: smooth;
}

/* GLOBAL BACKGROUND (New Identity: "Signal Night") */
body {
    background-color: #0b1120; /* Darker, richer slate */
    background-image: 
        /* sharp diagonal mesh pattern */
        linear-gradient(45deg, rgba(20, 184, 166, 0.05) 25%, transparent 25%, transparent 75%, rgba(20, 184, 166, 0.05) 75%, rgba(20, 184, 166, 0.05)),
        linear-gradient(45deg, rgba(20, 184, 166, 0.05) 25%, transparent 25%, transparent 75%, rgba(20, 184, 166, 0.05) 75%, rgba(20, 184, 166, 0.05)),
        radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.15) 0%, transparent 60%);
    background-size: 60px 60px, 60px 60px, 100% 100%;
    background-position: 0 0, 30px 30px, 0 0;
    color: #e2e8f0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

img {
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* =========================================
   2. HERO SECTION (New Shape: Angled/Sharp)
   ========================================= */

.hero-modern {
    background: linear-gradient(135deg, #0f172a 0%, #112a2e 100%); /* Slate to Dark Teal */
    position: relative;
    overflow: hidden;
    /* Changed from round curve to a sharp diagonal slice */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    z-index: 10;
    padding-bottom: 6rem; /* Extra padding for the slice */
}

/* =========================================
   3. UI ELEMENTS (Glassmorphism + Teal Glow)
   ========================================= */

.modern-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(45, 212, 191, 0.1); /* Teal tinted border */
    border-radius: 0.5rem; /* Sharper corners */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    /* height: 100%; <-- REMOVED to fix stretching issue on feed pages */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modern-card:hover {
    transform: translateY(-5px);
    background: rgba(15, 23, 42, 0.9); 
    border-color: rgba(45, 212, 191, 0.4); /* Brighter teal on hover */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.modern-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    /* Teal to Cyan gradient */
    background: linear-gradient(90deg, #0d9488, #22d3ee);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modern-card:hover::after { opacity: 1; }

.icon-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* Sharper */
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box i {
    text-shadow: 0 0 15px rgba(45, 212, 191, 0.3);
}

.btn {
    transition: all 0.3s ease;
}
.btn:hover, .btn:active {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.3); /* Teal glow */
}

/* =========================================
   4. NAVIGATION BAR
   ========================================= */

.navbar {
    background-color: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
    transition: all 0.3s ease;
    padding: 1rem 0;
}

@media (min-width: 640px) {
    .navbar { padding: 1.5rem 0; }
    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between !important;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
    }
    .menu {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        background: none !important;
        width: auto !important;
        height: auto !important;
        box-shadow: none !important;
        gap: 1.5rem;
    }
    .menu-toggle + label { display: none !important; }
    
    .navbar a:not(.btn) {
        color: #e2e8f0;
    }
    .navbar a:not(.btn):hover {
        color: #2dd4bf; /* Teal hover */
    }
}

.navbar.condensed {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    background-color: rgba(11, 17, 32, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Mobile Menu */
.menu-toggle { display: none; }
@media (max-width: 639px) {
    .navbar .container {
        display: flex; justify-content: space-between; align-items: center; padding: 0 1rem;
    }
    .menu-toggle + label {
        display: block !important; cursor: pointer; font-size: 1.5rem; color: #e2e8f0; z-index: 60;
    }
    .menu {
        display: none; position: fixed !important; top: 0; left: 0; width: 100vw; height: 100vh;
        background: #0b1120;
        flex-direction: column; justify-content: center; align-items: center; z-index: 55;
    }
    .menu-toggle:checked ~ .menu { display: flex !important; }
    .menu a:not(.btn) { color: #f1f5f9; font-size: 1.2rem; margin-bottom: 1rem;}
}

/* =========================================
   5. FOOTER & MISC
   ========================================= */

footer a { transition: all 0.2s ease; }
footer a:not(.rounded-full):hover {
    padding-left: 4px;
    color: #2dd4bf; /* Teal hover */
}

/* Typography Overrides */
h1, h2, h3, h4, .text-gray-900 {
    color: #f0f9ff !important;
}
p, li, .text-gray-600 {
    color: #94a3b8 !important;
}
h1, h2, h3 { font-size: clamp(1.5rem, 5vw, 2.5rem); }
.hero-modern h1 { font-size: clamp(2rem, 6vw, 4rem); }

/* =========================================
   6. SUCCESS MODAL (CRITICAL SECTION)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Dark background */
    backdrop-filter: blur(8px); /* Blur effect behind */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* FIX: Force height to auto to prevent stretching */
    height: auto !important; 
    max-height: 90vh; /* Safety cap so it doesn't overflow small screens */
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}