/**
 * KEITUMETSE MADISHA - MASTER PRODUCTION STYLESHEET
 * VERSION: 6.5 (FULL EXPANDED SOURCE)
 * AGENCY: TIVARATECH SOLUTIONS
 * STATUS: FULL UNABRIDGED BUILD
 */

/* -----------------------------------------------------------
   1. EXTERNAL RESOURCES
----------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

/* -----------------------------------------------------------
   2. VARIABLE ARCHITECTURE
----------------------------------------------------------- */
:root {
    /* VIBRANT PALETTE - JEWEL TONES */
    --primary: #f0abfc;       /* Light Fuchsia - High Contrast Text */
    --primary-glow: rgba(240, 171, 252, 0.6);
    --secondary: #c084fc;     /* Bright Violet - Secondary Accents */
    --accent: #fb7185;        /* Rose Pop - Errors/Highlights */
    
    /* BACKGROUND ARCHITECTURE */
    --bg-deep: #2e1065; 
    --bg-vibrant: #4a044e;
    --gradient-body: linear-gradient(135deg, #1e1b4b 0%, #4c0519 100%); /* Midnight Blue -> Deep Rose */
    
    /* TEXT SYSTEM */
    --text: #ffffff;
    --text-muted: #e9d5ff;    /* Light Lilac for better readability on purple */
    
    /* GLASSMORPHISM SYSTEM (DESKTOP) */
    --glass: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    /* ANIMATION CONSTANTS */
    --transition: cubic-bezier(0.23, 1, 0.32, 1);
    
    /* LAYOUT DIMENSIONS */
    --container-width: 1400px;
    
    /* FONT STACKS */
    --font-main: 'Inter', sans-serif;
    --font-luxe: 'Playfair Display', serif;
}

/* -----------------------------------------------------------
   3. GLOBAL RESET & BASE STYLES
----------------------------------------------------------- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

html { 
    scroll-behavior: smooth; 
    background-color: var(--bg-deep);
    font-size: 16px;
    overflow-x: hidden;
}

body {
    background: var(--gradient-body);
    background-attachment: fixed; /* Creates parallax feel */
    background-size: 200% 200%;
    animation: gradientFlow 15s ease infinite;
    
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Animation: Background Shift */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* -----------------------------------------------------------
   4. CUSTOM SCROLLBAR (WEBKIT)
----------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    border: 2px solid rgba(0,0,0,0.1); /* Creates 'floating' look */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* -----------------------------------------------------------
   5. TYPOGRAPHY & TEXT UTILITIES
----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
    letter-spacing: -0.02em;
}

.glow-text { 
    color: #fff;
    text-shadow: 0 0 20px var(--primary-glow), 0 0 40px var(--secondary);
}

.luxe-serif { 
    font-family: var(--font-luxe) !important; 
}

/* -----------------------------------------------------------
   6. ORB BACKGROUND ANIMATION
----------------------------------------------------------- */
.orb-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Behind content, in front of background */
    overflow: hidden;
    pointer-events: none;
    mix-blend-mode: overlay;
    will-change: transform;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: floatOrb 20s infinite ease-in-out;
}

.orb-1 {
    top: -20%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: #ff00cc; /* Hot Pink Spotlight */
    animation-delay: 0s;
}

.orb-2 {
    bottom: -20%;
    right: -20%;
    width: 50vw;
    height: 50vw;
    background: #3300ff; /* Deep Blue Spotlight */
    animation-delay: -5s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 80px) scale(1.1); }
}

/* -----------------------------------------------------------
   7. HARDWARE CURSOR (DESKTOP ONLY)
----------------------------------------------------------- */
@media (pointer: fine) and (hover: hover) {
    body { cursor: none; }
    
    #custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 24px;
        height: 24px;
        z-index: 9999999;
        pointer-events: none;
        
        border: 2px solid #fff;
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(255,255,255,0.5);
        
        transform: translate3d(-50%, -50%, 0);
        transition: width 0.3s, height 0.3s, background 0.3s, border-color 0.3s;
        will-change: transform;
    }

    #custom-cursor::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 4px;
        height: 4px;
        background: #fff;
        border-radius: 50%;
        transform: translate(-50%, -50%);
    }

    #custom-cursor.active {
        width: 60px;
        height: 60px;
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--primary);
        backdrop-filter: blur(2px);
    }
}

/* STRICT MOBILE OVERRIDE: Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    #custom-cursor { display: none !important; } 
    body { cursor: auto !important; } 
}

/* -----------------------------------------------------------
   8. NAVIGATION SYSTEM
----------------------------------------------------------- */
.hamburger-trigger {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
    
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: 0.3s var(--transition);
}

.hamburger-trigger:hover {
    background: rgba(255,255,255,0.2);
    border-color: #fff;
    transform: scale(1.1);
}

.hamburger-trigger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: 0.4s var(--transition);
}

.hamburger-trigger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-trigger.active span:nth-child(2) { opacity: 0; }
.hamburger-trigger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(46, 16, 101, 0.98); /* Deep Purple */
    z-index: 9000;
    display: none; /* JS toggles display:flex */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(30px);
}

.menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4vh;
}

.menu-links a {
    font-family: var(--font-luxe);
    font-size: clamp(2rem, 5vw, 4rem);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-style: italic;
    transition: 0.5s var(--transition);
}

.menu-links a:hover {
    color: #fff;
    text-shadow: 0 0 30px var(--primary);
    transform: scale(1.05);
}

/* -----------------------------------------------------------
   9. LAYOUT UTILITIES & HERO
----------------------------------------------------------- */
.container-main {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
    z-index: 5;
}

.sub-header {
    width: 100%;
    padding: 60px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.sub-logo {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
}

.hero-minimal {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    z-index: 5;
}

.hero-logo {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 40px rgba(240, 171, 252, 0.4));
}

/* -----------------------------------------------------------
   10. COMPONENTS: GLASS CARDS & BUTTONS
----------------------------------------------------------- */
.glass-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, background 0.3s;
}

.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 50px;
}

.btn-gold:hover {
    background: #fff;
    color: var(--bg-deep); /* Invert text color */
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255,255,255,0.4);
    transform: translateY(-3px);
    font-weight: 800;
}

.auth-input, .cinematic-input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 20px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    border-radius: 12px;
}

.auth-input:focus, .cinematic-input:focus {
    border-color: var(--primary);
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 15px rgba(240, 171, 252, 0.2);
}

/* -----------------------------------------------------------
   11. AUTHENTICATION SYSTEM (3D FLIP)
----------------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 5;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    height: 600px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.auth-container.flipped {
    transform: rotateY(180deg);
}

.auth-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
}

.auth-back {
    transform: rotateY(180deg);
}

.auth-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* -----------------------------------------------------------
   12. ADMIN DASHBOARD STYLES
----------------------------------------------------------- */
.admin-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 5% 100px;
    position: relative;
    z-index: 5;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 30px;
}

.admin-nav {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.admin-nav button {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 12px 30px;
    border-radius: 40px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.admin-nav button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(240, 171, 252, 0.4);
}

.admin-nav button:hover:not(.active) {
    color: #fff;
    text-shadow: 0 0 10px var(--primary);
}

/* Storage Gauge */
.storage-card {
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    width: 0%;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 15px var(--primary);
}

/* Split Layouts for Admin */
.split-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.media-item {
    aspect-ratio: 1;
    position: relative;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: 0.5s;
}

.media-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.media-item:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* -----------------------------------------------------------
   13. GRID SYSTEMS (MOBILE SAFE)
----------------------------------------------------------- */
/* Sets a safe minimum width (280px) to prevent iPhone SE horizontal scrolling */
.blog-grid, 
.gallery-grid, 
.curated-grid, 
.media-grid, 
.thread-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* -----------------------------------------------------------
   14. ANIMATION UTILITIES
----------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 1s var(--transition);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

/* -----------------------------------------------------------
   15. MEGA FOOTER
----------------------------------------------------------- */
.main-footer {
    width: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(40px);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    padding-top: 80px;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5% 60px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 60px;
}

.footer-brand h2 {
    font-family: var(--font-luxe);
    font-size: 1.8rem;
    font-style: italic;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.4);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.8;
}

.footer-col h4 {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 25px;
    font-weight: 800;
    opacity: 0.8;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.95rem;
    transition: 0.3s;
}

.footer-col a:hover {
    color: #fff;
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.footer-bar {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    max-width: var(--container-width);
    margin: 0 auto;
}

/* -----------------------------------------------------------
   16. MOBILE PERFORMANCE PATCH (THE FIX)
   This section overrides heavy effects ONLY on small screens
----------------------------------------------------------- */
@media (max-width: 900px) {
    /* 1. Disable Heavy GPU Blur */
    .glass-card, 
    .main-footer, 
    .menu-overlay, 
    .hamburger-trigger, 
    .modal-content,
    .auth-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(20, 10, 50, 0.95) !important; /* Solid dark fallback */
    }
    
    /* 2. Simplify Shadows */
    .glass-card {
        box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
    }
    
    /* 3. Stop Background Animation */
    body {
        animation: none !important;
        background-attachment: scroll !important;
    }
    
    /* 4. Freeze Orbs (Static Background) */
    .orb {
        animation: none !important;
        filter: blur(60px);
        opacity: 0.4;
    }
    
    /* 5. Mobile Layout Stacking */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-logo {
        width: 70%;
        max-width: 300px;
    }
    
    /* Admin Mobile Fixes */
    .admin-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .admin-nav button {
        flex: 1;
        text-align: center;
        padding: 12px 10px;
        font-size: 0.7rem;
    }
    
    .split-layout {
        grid-template-columns: 1fr !important;
    }
    
    /* Container Padding Fixes */
    .luxe-form-container { padding: 30px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .glass-card { padding: 30px 20px; }
}