/* ═══════════════════════════════════════════════════════
   MISTY HAVEN - Complete Theme System
   Moonlit Mist (Night) + Cloud Sanctuary (Day)
   ═══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   MOONLIT MIST THEME (Night/Default)
   ═══════════════════════════════════════════════════════ */
:root,
[data-theme="moonlit"] {
    /* Backgrounds - Deep Purple Night */
    --bg-primary: #1A0B2E;
    --bg-secondary: #2D1B4E;
    --bg-tertiary: #4A2B6F;
    --bg-card: rgba(74, 43, 111, 0.6);
    
    /* Text Colors */
    --text-primary: #E8E0F5;
    --text-secondary: #B8A9D4;
    --text-muted: #8B7BA8;
    --text-inverse: #1A0B2E;
    
    /* Purple Accents */
    --purple-primary: #A78BFA;
    --purple-light: #C4B5FD;
    --purple-dark: #8B5CF6;
    --purple-glow: #C084FC;
    
    /* Pink Touch */
    --pink-primary: #E8A5D4;
    --pink-light: #F9C7E3;
    --pink-dark: #D87FB8;
    --pink-glow: rgba(232, 165, 212, 0.3);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    
    /* Effects */
    --mist-overlay: rgba(139, 123, 168, 0.1);
    --shadow-sm: 0 2px 8px rgba(139, 92, 246, 0.2);
    --shadow-md: 0 4px 16px rgba(139, 92, 246, 0.3);
    --shadow-lg: 0 8px 32px rgba(139, 92, 246, 0.4);
    --glow: 0 0 20px rgba(167, 139, 250, 0.5);
}

/* ═══════════════════════════════════════════════════════
   CLOUD SANCTUARY THEME (Day)
   ═══════════════════════════════════════════════════════ */
[data-theme="cloud"] {
    /* Backgrounds - Soft Lavender Day */
    --bg-primary: #F8F5FF;
    --bg-secondary: #E8E0F5;
    --bg-tertiary: #D4C5F0;
    --bg-card: #FFFFFF;
    
    /* Text Colors */
    --text-primary: #2D1B4E;
    --text-secondary: #4A2B6F;
    --text-muted: #8B7BA8;
    --text-inverse: #FFFFFF;
    
    /* Purple Accents */
    --purple-primary: #8B5CF6;
    --purple-light: #A78BFA;
    --purple-dark: #7C3AED;
    --purple-glow: #C084FC;
    
    /* Pink Touch */
    --pink-primary: #E8A5D4;
    --pink-light: #F9C7E3;
    --pink-dark: #D87FB8;
    --pink-glow: rgba(232, 165, 212, 0.2);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
    
    /* Effects */
    --mist-overlay: rgba(232, 224, 245, 0.5);
    --shadow-sm: 0 2px 8px rgba(139, 92, 246, 0.08);
    --shadow-md: 0 4px 16px rgba(139, 92, 246, 0.12);
    --shadow-lg: 0 8px 32px rgba(139, 92, 246, 0.16);
    --glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* ═══════════════════════════════════════════════════════
   GLOBAL STYLES
   ═══════════════════════════════════════════════════════ */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    transition: background-color 0.8s ease, color 0.4s ease;
    margin: 0;
    padding: 0;
}

/* Mist Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, var(--mist-overlay) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--pink-glow) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, var(--mist-overlay) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: mistFloat 30s ease-in-out infinite;
}

@keyframes mistFloat {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════════
   HEADER - Glassmorphic Sticky
   ═══════════════════════════════════════════════════════ */
.mh-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 15px 0;
    transition: all 0.3s ease;
}

.mh-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.mh-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--purple-primary), var(--pink-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mh-logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px var(--purple-glow));
}

/* Navigation */
.mh-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.mh-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mh-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple-primary), var(--pink-primary));
    transition: width 0.3s;
}

.mh-nav-link:hover {
    color: var(--text-primary);
}

.mh-nav-link:hover::after {
    width: 100%;
}

/* Discord Icon Link */
.mh-discord-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.mh-discord-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

/* Search Bar */
.mh-search {
    position: relative;
}

.mh-search-input {
    width: 250px;
    padding: 10px 40px 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.mh-search-input:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px var(--pink-glow);
    width: 300px;
}

.mh-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

/* Login Button */
.mh-login-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--purple-primary), var(--pink-primary));
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: inline-block;
}

.mh-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow);
}

/* Theme Toggle */
.mh-theme-toggle {
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.6s;
    box-shadow: var(--shadow-sm);
}

.mh-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.mh-theme-toggle.rotating {
    animation: rotate360 0.6s ease-in-out;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════
   SMOOTH THEME TRANSITION
   ═══════════════════════════════════════════════════════ */
* {
    transition: background-color 0.5s ease, 
                color 0.4s ease, 
                border-color 0.4s ease,
                box-shadow 0.4s ease;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .mh-nav {
        gap: 20px;
    }
    
    .mh-search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .mh-header-inner {
        padding: 0 20px;
    }
    
    .mh-nav {
        display: none; /* Will add mobile menu */
    }
    
    .mh-search-input {
        width: 150px;
    }
}
