/* Import Design Tokens */
@import url('design-tokens.css');

/* Import OpenDyslexic Font for Accessibility */
@import url('https://fonts.googleapis.com/css2?family=OpenDyslexic:wght@400;700&display=swap');

/* CSS Variables */
:root {
    /* Primary Brand Colors */
    --primary-color: #5865f2;
    --secondary-color: #7289da;

    /* Background Colors */
    --background-dark: #0a0a0f;
    --background-light: #1a1a2e;
    --background-accent: #16213e;
    --card-background: rgba(26, 26, 46, 0.7);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;

    /* Status Colors */
    --success-color: #43b581;
    --warning-color: #faa61a;
    --danger-color: #f04747;
    --idle-color: #faa61a;
    --dnd-color: #f04747;
    --offline-color: #747f8d;

    /* Special Colors */
    --spotify-green: #1DB954;

    /* Glass Morphism */
    --glass-background: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* RGBA Variations - Primary Color */
    --primary-alpha-10: rgba(88, 101, 242, 0.1);
    --primary-alpha-15: rgba(88, 101, 242, 0.15);
    --primary-alpha-20: rgba(88, 101, 242, 0.2);
    --primary-alpha-30: rgba(88, 101, 242, 0.3);
    --primary-alpha-40: rgba(88, 101, 242, 0.4);
    --primary-alpha-50: rgba(88, 101, 242, 0.5);
    --primary-alpha-60: rgba(88, 101, 242, 0.6);

    /* RGBA Variations - Secondary Color */
    --secondary-alpha-10: rgba(114, 137, 218, 0.1);

    /* RGBA Variations - Success Color */
    --success-alpha-08: rgba(67, 181, 129, 0.08);
    --success-alpha-20: rgba(67, 181, 129, 0.2);

    /* RGBA Variations - Warning Color */
    --warning-alpha-20: rgba(250, 166, 26, 0.2);

    /* RGBA Variations - Danger Color */
    --danger-alpha-10: rgba(240, 71, 71, 0.1);
    --danger-alpha-20: rgba(240, 71, 71, 0.2);
    --danger-alpha-30: rgba(240, 71, 71, 0.3);

    /* RGBA Variations - Spotify */
    --spotify-alpha-10: rgba(30, 215, 96, 0.1);
    --spotify-alpha-30: rgba(30, 215, 96, 0.3);
    --spotify-alpha-60: rgba(30, 215, 96, 0.6);

    /* Shadow */
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'OpenDyslexic', sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-light) 50%, var(--background-accent) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    /* overflow-x: hidden; */ /* Removed for testing */
    position: relative;
    max-width: 100vw;
}

html {
    /* overflow-x: hidden; */ /* Removed for testing */
    max-width: 100vw;
}

/* ===================================
   Custom Glass Morphism Scrollbar
   =================================== */

/* Custom scrollbar container */
.custom-scrollbar {
    position: fixed;
    right: 0;
    top: 0;
    width: 16px;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
}

.custom-scrollbar-track {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 12px;
    height: calc(100% - 8px);
    background: rgba(10, 10, 15, 0.2);
    border-radius: var(--sub-card-radius);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: all;
}

.custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 40px;
    border-radius: var(--sub-card-radius);
    cursor: pointer;
    pointer-events: all;

    /* True glass morphism effect with backdrop-filter */
    background: rgba(88, 101, 242, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);

    /* Glass border and shimmer */
    border: 1.5px solid rgba(255, 255, 255, 0.18);

    /* Gradient overlay for depth */
    background-image: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(88, 101, 242, 0.3) 30%,
        rgba(114, 137, 218, 0.25) 50%,
        rgba(88, 101, 242, 0.3) 70%,
        rgba(255, 255, 255, 0.15) 100%
    );

    /* Realistic glass shadows */
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 2px 4px rgba(255, 255, 255, 0.2) inset,
        0 -2px 4px rgba(0, 0, 0, 0.2) inset;

    /* Use will-change for transform optimization */
    will-change: transform;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-scrollbar-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--sub-card-radius);
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.25);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    border-color: rgba(255, 255, 255, 0.3);

    background-image: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(88, 101, 242, 0.5) 30%,
        rgba(114, 137, 218, 0.4) 50%,
        rgba(88, 101, 242, 0.5) 70%,
        rgba(255, 255, 255, 0.25) 100%
    );

    box-shadow:
        0 6px 20px rgba(88, 101, 242, 0.6),
        0 0 30px rgba(88, 101, 242, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 3px 6px rgba(255, 255, 255, 0.3) inset,
        0 -3px 6px rgba(0, 0, 0, 0.3) inset;
}

.custom-scrollbar-thumb:hover::before {
    opacity: 1;
}

.custom-scrollbar-thumb:active {
    background: rgba(88, 101, 242, 0.35);
    border-color: rgba(255, 255, 255, 0.4);

    box-shadow:
        0 4px 16px rgba(88, 101, 242, 0.8),
        0 0 40px rgba(88, 101, 242, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.3) inset,
        0 4px 8px rgba(0, 0, 0, 0.4) inset;
}

/* Hide native scrollbar completely - all elements */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

html,
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Ensure scrolling is still enabled */
html {
    overflow-y: scroll;
}

/* Fallback for Firefox (no custom scrollbar) */
@supports not (backdrop-filter: blur(10px)) {
    body {
        scrollbar-width: thin;
        scrollbar-color: rgba(88, 101, 242, 0.5) rgba(10, 10, 15, 0.3);
    }

    .custom-scrollbar {
        display: none;
    }
}

/* Disable custom scrollbar and restore native scrollbar on mobile devices */
@media (max-width: 768px) {
    .custom-scrollbar {
        display: none !important;
    }

    /* Restore native scrollbar on mobile */
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        width: initial !important;
        height: initial !important;
        display: initial !important;
    }

    html,
    body {
        -ms-overflow-style: auto !important;
        scrollbar-width: auto !important;
    }

    /* Remove universal scrollbar hiding on mobile */
    *::-webkit-scrollbar {
        width: initial !important;
        height: initial !important;
        display: initial !important;
    }
}

/* Parallax Background */
.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease-out;
}

.parallax-layer-1 {
    background: radial-gradient(circle at 20% 50%, var(--primary-alpha-15) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

.parallax-layer-2 {
    background: radial-gradient(circle at 80% 80%, var(--secondary-alpha-10) 0%, transparent 50%);
    animation: float 25s ease-in-out infinite reverse;
}

.parallax-layer-3 {
    background: radial-gradient(circle at 50% 20%, var(--success-alpha-08) 0%, transparent 50%);
    animation: float 30s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

/* Particles Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 60px; /* Increased top padding for breathing room */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--card-padding-standard);
    position: relative;
    z-index: 1;
}

/* Profile Card */
.profile-card {
    width: 100%;
    max-width: 1200px;
    min-height: 400px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    padding: var(--card-padding-standard);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 1; /* Layer 1 - Base container */
    overflow: visible;
}

/* NOTE: Profile card is a STATIC CONTAINER - no hover effects per v2.1.0 */
/* Removed: hover transform, scale, transition properties */

/* Avatar */
.avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    z-index: 2;
}

.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Avatar Link Wrapper */
.avatar-link {
    position: relative;
    width: 150px;
    height: 150px;
    display: block;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--hover-transition);
    /* Dual shadow base (v2.1.0) */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px var(--primary-alpha-20);
}

/* Streak effect for avatar */
.avatar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 10;
}

.avatar-link:hover::before {
    opacity: 1;
}

.avatar-link:hover {
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px var(--primary-alpha-50);
}

.avatar {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    animation: fadeIn 1s ease-out;
    display: block;
}

/* Status Indicator */
.status-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--background-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--background-light);
    z-index: 2;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--offline-color);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.status-indicator.online .status-dot {
    background: var(--success-color);
    box-shadow: 0 0 15px var(--success-color);
}

.status-indicator.idle .status-dot {
    background: var(--idle-color);
    box-shadow: 0 0 15px var(--idle-color);
}

.status-indicator.dnd .status-dot {
    background: var(--dnd-color);
    box-shadow: 0 0 15px var(--dnd-color);
}

.status-indicator.offline .status-dot {
    background: var(--offline-color);
}

/* Username Sub-Card - Interactive clickable card (v2.1.0) */
.username-subcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--sub-card-radius);
    border: 1px solid var(--glass-border);
    max-width: 400px;
    margin: 20px auto;
    position: relative;
    z-index: 2;
    /* Interactive element styles (v2.1.0) */
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: var(--hover-transition);
    /* Dual shadow base: elevation + colored glow */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(88, 101, 242, 0.2);
}

/* Streak effect for username card */
.username-subcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
    z-index: 0;
}

.username-subcard:hover::before {
    left: 100%;
}

/* All card content above streak */
.username-subcard > * {
    position: relative;
    z-index: 1;
}

.username-subcard:hover {
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px rgba(88, 101, 242, 0.5);
}

/* Username */
.username {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease-out 0.2s backwards;
    transition: all 0.3s ease;
}

.username-subcard:hover .username {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.discriminator {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

/* Status Badge */
.status-container {
    margin: 20px 0;
    animation: fadeIn 1s ease-out 0.4s backwards;
    position: relative;
    z-index: 2;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-weight: 500;
    text-transform: capitalize;
    transition: all 0.3s ease;
    max-width: 90%;
}

.status-badge #status-text {
    min-width: 0;
    max-width: 600px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.status-badge i {
    font-size: 0.8rem;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.online {
    border-color: var(--success-color);
    box-shadow: 0 0 20px var(--success-alpha-20);
}

.status-badge.online i {
    color: var(--success-color);
}

.status-badge.idle {
    border-color: var(--idle-color);
    box-shadow: 0 0 20px var(--warning-alpha-20);
}

.status-badge.idle i {
    color: var(--idle-color);
}

.status-badge.dnd {
    border-color: var(--dnd-color);
    box-shadow: 0 0 20px var(--danger-alpha-20);
}

.status-badge.dnd i {
    color: var(--dnd-color);
}

.status-badge.offline {
    border-color: var(--offline-color);
}

.status-badge.offline i {
    color: var(--offline-color);
}

/* Custom Status - Floating Thought Bubble */
.custom-status-container {
    position: absolute;
    top: 75px;
    left: calc(50% + 120px);
    z-index: 999;
    /* Transition duration set dynamically by JavaScript */
    will-change: transform, opacity;
}

.custom-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: var(--main-card-radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    max-width: 450px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out;
}

/* Thought bubble tail - connecting bubbles */
.custom-status::before,
.custom-status::after {
    content: '';
    position: absolute;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.1s ease;
}

/* Medium bubble (closer to thought bubble) */
.custom-status::before {
    width: 16px;
    height: 16px;
    left: -30px;
    top: 50%;
    transform: translate(
        var(--bubble-medium-x, 0px),
        calc(-50% + var(--bubble-medium-y, 0px))
    );
    opacity: var(--bubble-medium-opacity, 0.9);
    transition: var(--bubble-medium-transition, transform 1s ease-in-out, opacity 1s ease-in-out);
    will-change: transform, opacity;
}

/* Small bubble (closer to avatar) */
.custom-status::after {
    width: 10px;
    height: 10px;
    left: -50px;
    top: 50%;
    transform: translate(
        var(--bubble-tiny-x, 0px),
        calc(-50% + var(--bubble-tiny-y, 0px))
    );
    opacity: var(--bubble-tiny-opacity, 0.85);
    transition: var(--bubble-tiny-transition, transform 1s ease-in-out, opacity 1s ease-in-out);
    will-change: transform, opacity;
}

.custom-status-emoji {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.custom-status-text {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Activity Card */
.activity-container {
    width: 100%;
    margin-top: 30px;
    animation: slideInUp 0.5s ease-out;
    position: relative;
    z-index: 2;
}

.activity-card {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    transition: all 0.3s ease;
}

.activity-card:hover {
    transform: translateX(5px);
    border-color: var(--primary-alpha-50);
    box-shadow: 0 5px 20px var(--primary-alpha-20);
}

.activity-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    min-width: 50px;
    width: 50px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.activity-type {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.activity-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.activity-state,
.activity-details-text,
.activity-elapsed {
    font-size: 0.95rem;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.activity-elapsed {
    margin-top: 5px;
    font-style: italic;
    opacity: 0.9;
}

/* Spotify Card */
.spotify-container {
    width: 100%;
    margin-top: 0;
    opacity: 0;
    max-height: 0;
    overflow: visible; /* Changed to visible so it floats above profile */
    transition: opacity 0.8s ease, max-height 0.8s ease, margin-top 0.8s ease;
    pointer-events: none;
    position: relative;
    z-index: 50; /* Higher z-index to float above profile card */
}

.spotify-container.visible {
    opacity: 1;
    max-height: 300px;
    margin-top: 30px;
    pointer-events: auto;
}

.spotify-card {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: linear-gradient(135deg, var(--spotify-alpha-10) 0%, var(--glass-background) 100%);
    border: 1px solid var(--spotify-alpha-30);
    border-radius: var(--sub-card-radius);
    transition: all 0.3s ease;
}

.spotify-card[style*="cursor: pointer"]:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--spotify-alpha-60);
    box-shadow: 0 8px 25px var(--spotify-alpha-30);
}

.spotify-album {
    width: 80px;
    height: 80px;
    border-radius: var(--sub-card-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: rotate 20s linear infinite;
}

.spotify-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.spotify-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--spotify-green);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.spotify-header i {
    font-size: 1.2rem;
}

.spotify-song {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-artist {
    font-size: 1rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Social Container */
.social-container {
    width: 100%;
    max-width: 800px;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Layer 2: Social Title Base */
.social-title-base {
    width: fit-content;
    margin: 0 auto 30px;
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.social-title-base:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Layer 3: Social Title Text */
.social-title {
    text-align: center;
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 3;
}

/* Layer 1: Social Grid Base */
.social-grid-base {
    width: 100%;
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--card-padding-standard);
    width: 100%;
}

/* First row: 3 items, each spanning 2 columns */
.social-grid .social-link:nth-child(1) {
    grid-column: 1 / 3;
}

.social-grid .social-link:nth-child(2) {
    grid-column: 3 / 5;
}

.social-grid .social-link:nth-child(3) {
    grid-column: 5 / 7;
}

/* Second row: 2 items centered, each spanning 2 columns */
.social-grid .social-link:nth-child(4) {
    grid-column: 2 / 4;
}

.social-grid .social-link:nth-child(5) {
    grid-column: 4 / 6;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Dual shadow base state (v2.1.0) */
    box-shadow: var(--hover-shadow-base);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
}

.social-icon {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
    transition: all 0.6s ease;
}

.social-link:hover .social-icon {
    transform: rotate(var(--hover-icon-rotation)) scale(var(--hover-icon-scale));
}

.social-info {
    flex: 1;
}

.social-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.social-handle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Social Platform Colors */
.social-link.twitter:hover {
    border-color: #1DA1F2;
    box-shadow: 0 15px 40px rgba(29, 161, 242, 0.3);
}

.social-link.twitter .social-icon {
    color: #1DA1F2;
}

.social-link.github:hover {
    border-color: #ffffff;
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
}

.social-link.github .social-icon {
    color: #ffffff;
}

.social-link.discord:hover {
    border-color: #5865f2;
    box-shadow: 0 15px 40px var(--primary-alpha-30);
}

.social-link.discord .social-icon {
    color: #5865f2;
}

.social-link.youtube:hover {
    border-color: #FF0000;
    box-shadow: 0 15px 40px rgba(255, 0, 0, 0.3);
}

.social-link.youtube .social-icon {
    color: #FF0000;
}

.social-link.twitch:hover {
    border-color: #9146FF;
    box-shadow: 0 15px 40px rgba(145, 70, 255, 0.3);
}

.social-link.twitch .social-icon {
    color: #9146FF;
}

.social-link.instagram:hover {
    border-color: #E1306C;
    box-shadow: 0 15px 40px rgba(225, 48, 108, 0.3);
}

.social-link.instagram .social-icon {
    color: #E1306C;
}

.social-link.linkedin:hover {
    border-color: #0A66C2;
    box-shadow: 0 15px 40px rgba(10, 102, 194, 0.3);
}

.social-link.linkedin .social-icon {
    color: #0A66C2;
}

.social-link.email:hover {
    border-color: #EA4335;
    box-shadow: 0 15px 40px rgba(234, 67, 53, 0.3);
}

.social-link.email .social-icon {
    color: #EA4335;
}

.social-link.website:hover {
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px var(--primary-alpha-30);
}

.social-link.website .social-icon {
    color: var(--primary-color);
}

/* Modern Header (Info Pages Style) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-sm) var(--space-md);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.logo {
    font-size: var(--font-size-h3);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Page Selector Dropdown */
.page-selector {
    position: relative;
    display: inline-block;
}

.page-selector-btn {
    background: var(--glass-background);
    color: var(--text-primary);
    padding: var(--card-padding-standard);
    font-size: var(--font-size-small);
    font-weight: 700;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    transition: all 0.3s ease;
    font-family: 'OpenDyslexic', sans-serif;
}

.page-selector-btn:hover {
    background: var(--primary-alpha-20);
    transform: translateY(-2px);
}

.page-selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    min-width: 200px;
    box-shadow: var(--shadow);
    z-index: 1001;
}

.page-selector-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.page-selector-dropdown a {
    display: block;
    padding: var(--card-padding-standard);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: var(--font-size-small);
}

.page-selector-dropdown a:first-child {
    border-radius: var(--sub-card-radius) var(--sub-card-radius) 0 0;
}

.page-selector-dropdown a:last-child {
    border-radius: 0 0 var(--sub-card-radius) var(--sub-card-radius);
}

.page-selector-dropdown a:hover {
    background: var(--primary-alpha-20);
    color: var(--text-primary);
}

.page-selector-dropdown a.active {
    background: var(--primary-color);
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--card-padding-standard);
    border-radius: 50px;
    font-size: var(--font-size-small);
    font-weight: 700;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--glass-background);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* Legacy Tab Navigation (Deprecated - Use .header instead) */
.tab-navigation {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

body.initial-load .tab-navigation {
    animation: fadeInDown 0.8s ease-out;
}

.tab-nav-container {
    display: flex;
    gap: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--card-padding-standard);
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--text-secondary);
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.tab-button:hover:not(.active) {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-button:hover:not(.active)::before {
    opacity: 0.2;
}

.tab-button:focus {
    outline: none;
}

.tab-button:focus:not(.active) {
    transform: none;
}

.tab-button:focus:not(.active)::before {
    opacity: 0;
}

.tab-button.active {
    color: var(--text-primary);
    background: var(--primary-color);
}

.tab-button.active::before {
    opacity: 1;
}

.tab-button i {
    font-size: 1.1rem;
}

.tab-button span {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOOD CALENDAR TAB SYSTEM (v2.1.0)
   ═══════════════════════════════════════════════════════════════════════════

   Structure:
   ├── Tab Content (hidden by default, flex column when active)
   ├── Mood Form Link (main card wrapper → interactive link)
   ├── Mood Calendar Container (main card)
   │   ├── Calendar Header (sub-card)
   │   │   ├── Nav Button (interactive, circular)
   │   │   ├── Calendar Title (static text)
   │   │   └── Nav Button (interactive, circular)
   │   ├── Calendar Legend (sub-card)
   │   │   ├── Legend Item (gradient bar + label)
   │   │   └── Legend Update (sync icon + timestamp)
   │   ├── Calendar Grid Container
   │   │   ├── Weekdays (7 static labels)
   │   │   └── Calendar Grid (JS-generated days, interactive)
   │   └── Mood Stats (grid of 3 static stat cards)
   ├── Mood User Header (sub-card with avatar + sign out button)
   └── Auth Gate (Google sign-in card for unauthenticated users)

   Interactive Elements (v2.1.0 Hover: Lift + Dual Glow + Streak):
   ✓ mood-form-link
   ✓ calendar-nav-btn
   ✓ calendar-day
   ✓ mood-sign-out-btn

   Static Elements (NO hover):
   ✗ mood-calendar-container (main card container)
   ✗ calendar-header, calendar-legend (sub-cards)
   ✗ stat-card (display only)
   ✗ mood-user-header (sub-card)
   ✗ auth-card (main card)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tab Content */
.tab-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--card-padding-standard); /* Standard 14px gap between all elements */
}

/* Protected Content Wrapper - Controls layout and max-width */
#mood-protected-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: var(--card-padding-standard); /* Standard 14px gap between grid and calendar */
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CARD: Mood Calendar Container (30px radius)
   ═══════════════════════════════════════════════════════════════════════════ */
.mood-calendar-container {
    width: 100%;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    padding: var(--card-padding-standard);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease-out;
    display: flex;
    flex-direction: column;
    gap: var(--card-padding-standard);
}

/* ───────────────────────────────────────────────────────────────────────────
   SUB-CARD: Calendar Header (Navigation)
   ─────────────────────────────────────────────────────────────────────────── */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-title {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-background);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--hover-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* Dual shadow base (v2.1.0) */
    box-shadow: var(--hover-shadow-base);
}

/* Streak effect for calendar nav buttons */
.calendar-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.calendar-nav-btn:hover::before {
    left: 100%;
}

.calendar-nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: var(--hover-shadow);
}

/* ───────────────────────────────────────────────────────────────────────────
   SUB-CARD: Calendar Legend (Mood Scale)
   ─────────────────────────────────────────────────────────────────────────── */
.calendar-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border-radius: var(--sub-card-radius);
    border: 1px solid var(--glass-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
}

.legend-color {
    width: 150px;
    height: 20px;
    border-radius: var(--sub-card-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.legend-update {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.legend-update i {
    animation: rotate 2s linear infinite paused;
}

.legend-update.updating i {
    animation-play-state: running;
}

/* ───────────────────────────────────────────────────────────────────────────
   Calendar Grid (Interactive Days)
   ─────────────────────────────────────────────────────────────────────────── */
.calendar-grid-container {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--card-padding-standard);
    margin-bottom: 10px;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: var(--card-padding-standard);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--card-padding-standard);
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: var(--sub-card-radius);
    border: 1px solid var(--glass-border);
    background: var(--glass-background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--hover-transition);
    position: relative;
    overflow: hidden;
    /* Dual shadow base: elevation + colored glow */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(88, 101, 242, 0.2);
}

/* Streak effect for calendar days */
.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
    z-index: 0;
}

.calendar-day:hover::before {
    left: 100%;
}

/* All day content above streak */
.calendar-day > * {
    position: relative;
    z-index: 1;
}

.calendar-day:hover {
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px rgba(88, 101, 242, 0.5);
    z-index: 10;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-alpha-40);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-bottom: 5px;
}

.mood-value {
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
    padding: 2px 8px;
    border-radius: var(--sub-card-radius);
    background: rgba(0, 0, 0, 0.3);
}

.calendar-day.has-mood {
    background: var(--mood-color);
}

/* ───────────────────────────────────────────────────────────────────────────
   Mood Statistics Grid (Static Display Cards)
   ─────────────────────────────────────────────────────────────────────────── */
.mood-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: var(--card-padding-standard);
}

/* Stat Card - Static display element (v2.1.0)
   NOTE: No hover effects - display only */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    box-shadow: var(--shadow);
}

/* NOTE: Stat cards do NOT have hover effects - they are static display elements.
   Only interactive elements (buttons, links, clickable cards) get hover effects.
   See MAIN-PAGES-STANDARD.md for interactive element standards. */

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* PIN Protection Modal */
.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.pin-modal {
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    padding: var(--card-padding-standard);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInUp 0.5s ease-out;
}

.pin-modal h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pin-modal p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.pin-input-container {
    display: flex;
    gap: var(--card-padding-standard);
    justify-content: center;
    margin-bottom: 20px;
}

.pin-digit {
    width: 60px;
    height: 70px;
    font-size: 2rem;
    text-align: center;
    background: var(--glass-background);
    border: 2px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
    -moz-appearance: textfield; /* Firefox */
}

/* Remove spinner buttons */
.pin-digit::-webkit-outer-spin-button,
.pin-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-digit:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-alpha-30);
    transform: scale(1.05);
}

.pin-digit.error {
    border-color: var(--danger-color);
    animation: shake 0.5s ease;
}

.pin-error {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 10px;
    min-height: 20px;
}

/* PIN Countdown Timer */
.pin-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--card-padding-standard);
    margin: 30px 0;
    padding: var(--card-padding-standard);
    background: var(--danger-alpha-10);
    border: 2px solid var(--danger-color);
    border-radius: var(--sub-card-radius);
}

.pin-countdown i {
    font-size: 2rem;
    color: var(--danger-color);
    animation: pulse 2s ease-in-out infinite;
}

.pin-countdown span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--danger-color);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pin-ok-btn {
    margin-top: 20px;
    padding: var(--card-padding-standard);
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--sub-card-radius);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.pin-ok-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-alpha-40);
}

.pin-cancel-btn {
    margin-top: 20px;
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.pin-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pin-buttons {
    display: flex;
    gap: var(--card-padding-standard);
    justify-content: center;
    margin-top: 20px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Hide mood calendar content until verified */
.mood-calendar-container.locked {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
/* Navigation icon-only mode at 950px to prevent clipping with 5 buttons */
@media (max-width: 950px) {
    .tab-button span {
        display: none;
    }

    .tab-button i {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 80px 8px 40px; /* Reduced side padding for more screen width */
    }

    .profile-card {
        padding: var(--card-padding-standard);
    }

    .username {
        font-size: 2rem;
    }

    .social-grid {
        grid-template-columns: 1fr;
    }

    /* Reset nth-child positioning on mobile */
    .social-grid .social-link:nth-child(1),
    .social-grid .social-link:nth-child(2),
    .social-grid .social-link:nth-child(3),
    .social-grid .social-link:nth-child(4),
    .social-grid .social-link:nth-child(5) {
        grid-column: auto;
    }

    .activity-card,
    .spotify-card {
        flex-direction: column;
        text-align: center;
    }

    .activity-details,
    .spotify-details {
        text-align: center;
    }

    .tab-navigation {
        top: 10px;
    }

    .tab-nav-container {
        padding: 6px;
        margin: 0 5px;
    }

    .tab-button {
        padding: var(--card-padding-standard);
        font-size: 0.9rem;
    }

    .mood-calendar-container {
        padding: var(--card-padding-standard);
    }

    .calendar-title {
        font-size: 1.3rem;
    }

    .calendar-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .calendar-legend {
        flex-direction: column;
        gap: var(--card-padding-standard);
        text-align: center;
    }

    .legend-item {
        flex-direction: column;
    }

    /* Mood Calendar Mobile Optimization */
    .mood-calendar-container {
        padding: var(--card-padding-standard);
        max-width: 100%;
        width: 100%; /* Reset width for mobile */
        margin: 0 auto; /* Center for mobile */
    }

    .calendar-header {
        margin-bottom: 15px;
    }

    .calendar-title {
        font-size: 1.3rem;
    }

    .calendar-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .calendar-weekdays {
        gap: 3px;
        margin-bottom: 5px;
    }

    .weekday {
        font-size: 0.7rem;
        padding: 5px 0;
        /* Show only first letter on mobile */
        width: 1.2em;
        overflow: hidden;
        white-space: nowrap;
        text-indent: 0;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        border-radius: 8px;
        border-width: 1px;
    }

    .calendar-day:hover {
        transform: translateY(-2px) scale(1.02);
    }

    .day-number {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .mood-value {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .mood-stats {
        grid-template-columns: 1fr;
        gap: var(--card-padding-standard);
    }

    .stat-card {
        padding: var(--card-padding-standard);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Custom status bubble on mobile - place below avatar (no animation) */
    .custom-status-container {
        position: static;
        margin: 20px 10px 0;
        max-width: calc(100% - 20px);
        width: 100%;
        animation: none;
        transform: none;
        left: auto;
        right: auto;
        text-align: center;
        box-sizing: border-box;
    }

    .custom-status {
        display: inline-flex;
        max-width: 100%;
        width: auto;
        box-sizing: border-box;
        word-wrap: break-word;
    }

    .custom-status::before,
    .custom-status::after {
        display: none;
    }

    /* Social bases on mobile */
    .social-title-base {
        padding: var(--card-padding-standard);
        font-size: 0.9rem;
    }

    .social-title {
        font-size: 1.5rem;
    }

    .social-grid-base {
        padding: var(--card-padding-standard);
    }
}

/* Loading Animation */
.loading {
    opacity: 0.5;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Spotify Song Change Animations */
@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Album artwork slide animations - slide horizontally */
@keyframes albumSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-20px) scale(0.9);
    }
}

@keyframes albumSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Apply animations to Spotify details */
.spotify-details.changing {
    animation: fadeSlideOut 0.3s ease forwards;
}

.spotify-details.new-song {
    animation: fadeSlideIn 0.3s ease forwards;
}

/* Apply animations to Spotify album */
.spotify-album.changing {
    animation: albumSlideOut 0.3s ease forwards;
}

.spotify-album.new-song {
    animation: albumSlideIn 0.3s ease forwards;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTHENTICATION GATE (Google Sign-In)
   ═══════════════════════════════════════════════════════════════════════════
   Uses .main-card class in HTML, these styles add auth-specific layout
*/

/* Additional styling for auth card content (inherits .main-card from HTML) */
.auth-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--card-padding-standard);
}

.auth-icon {
    font-size: 4rem;
    color: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
}

.auth-card h2 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
}

#g_id_onload {
    margin-bottom: 15px;
}

.g_id_signin {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CARD: Mood User Header (Avatar + Sign Out)
   ═══════════════════════════════════════════════════════════════════════════ */
.mood-user-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--main-card-radius);
    padding: var(--card-padding-standard);
    box-shadow: var(--shadow);
}

.mood-user-info {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
}

.mood-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.mood-user-info span {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mood-sign-out-btn {
    background: var(--danger-alpha-20);
    border: 1px solid var(--danger-alpha-30);
    color: #f04747;
    padding: var(--card-padding-standard);
    border-radius: var(--sub-card-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--hover-transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    /* Dual shadow with red glow */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(240, 71, 71, 0.2);
}

/* Streak effect for sign out button */
.mood-sign-out-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.mood-sign-out-btn:hover::before {
    left: 100%;
}

.mood-sign-out-btn:hover {
    background: var(--danger-alpha-30);
    /* v2.1.0: Standard -10px lift */
    transform: translateY(-10px);
    /* Dual shadow with brighter red glow */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px rgba(240, 71, 71, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INTERACTIVE LINK: Mood Form Link (External Google Form)
   ═══════════════════════════════════════════════════════════════════════════
   Link IS a .main-card itself, this adds interactive styling
*/

.mood-form-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--hover-transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Interactive card base shadow (v2.1.0) */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(88, 101, 242, 0.2);
}

/* Streak effect for mood form link */
.mood-form-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.mood-form-link:hover::before {
    left: 100%;
}

/* All link content above streak */
.mood-form-link > * {
    position: relative;
    z-index: 1;
}

.mood-form-link:hover {
    /* v2.1.0: Standard -10px lift */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px rgba(88, 101, 242, 0.5);
}

.mood-form-link i:first-child {
    font-size: 1.3rem;
}

.mood-form-link i:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===================================
   Bookmarks Page Specific Styles
   =================================== */

.bookmarks-container {
    width: 100%;
    max-width: 1920px;
    display: flex;
    flex-direction: column;
    /* Single-column layout - each topic gets its own row */
    gap: var(--card-padding-standard);
    align-items: stretch;
}

.bookmark-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out backwards;
    /* Main card styling */
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    /* Flexible grid layout - bookmarks adjust to fill width, wrap if too small */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--card-padding-standard);
}

.bookmark-section:nth-child(1) { animation-delay: 0.1s; }
.bookmark-section:nth-child(2) { animation-delay: 0.2s; }
.bookmark-section:nth-child(3) { animation-delay: 0.3s; }
.bookmark-section:nth-child(4) { animation-delay: 0.4s; }
.bookmark-section:nth-child(5) { animation-delay: 0.5s; }

.bookmark-section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0; /* Remove margin, gap handles spacing */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: filter 0.05s ease;
    /* Span all columns in the grid */
    grid-column: 1 / -1;
}

.bookmark-grid {
    display: grid;
    /* Fixed: Use min() to prevent overflow on small screens */
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.bookmark-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--hover-transition);
    position: relative;
    overflow: hidden;
    /* Dual shadow: elevation + colored glow */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(88, 101, 242, 0.2);
}

.bookmark-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.bookmark-link:hover::before {
    left: 100%;
}

.bookmark-link:hover {
    /* Standard v2.1.0 lift: -10px, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified: stronger elevation + brighter glow */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2),
                0 0 40px rgba(88, 101, 242, 0.5);
    border-color: var(--primary-color);
}

.bookmark-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--sub-card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
    padding: 4px;
}

.bookmark-link:hover .bookmark-icon {
    transform: rotate(5deg) scale(1.1);
}

.bookmark-icon img {
    width: 100%;
    height: 100%;
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.bookmark-icon i {
    font-size: 2.5rem;
}

.bookmark-name {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.2;
    transition: filter 0.05s ease;
}

.bookmark-url {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ===================================
   Mobile-First Adaptive Breakpoints
   =================================== */

/* Tablets and mobile - Auth responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: var(--card-padding-standard);
    }

    .mood-user-header {
        flex-direction: column;
        gap: var(--card-padding-standard);
        text-align: center;
    }

    .mood-user-info {
        flex-direction: column;
    }
}

/* Extra small phones - maximize width */
@media (max-width: 480px) {
    .container {
        padding: 80px 5px 40px !important;
    }

    .mood-form-container {
        padding: 2px !important;
        border-radius: var(--sub-card-radius);
    }

    .profile-card {
        padding: 25px 10px !important;
    }

    .mood-calendar-container {
        padding: 15px 5px !important;
    }
}

/* Medium phones - balanced padding */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 80px 10px 40px !important;
    }

    .profile-card {
        padding: 30px 12px !important;
    }

    .mood-calendar-container {
        padding: 20px 12px !important;
    }
}

/* Bookmarks Page Responsive */
/* NOTE: With auto-fit and min(), most responsive behavior is automatic.
   These media queries only adjust specific details for mobile. */

@media (max-width: 768px) {
    /* Bookmarks container already single-column by default */

    .bookmark-section {
        margin: 0;
        /* Maintain flexible grid on tablet, just with smaller items */
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .bookmark-grid {
        /* Smaller min-width for mobile */
        grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
        gap: var(--card-padding-standard);
        padding: var(--card-padding-standard);
    }

    .bookmark-section-title {
        font-size: 1.5rem;
    }

    .bookmark-link {
        padding: var(--card-padding-standard);
    }

    .bookmark-icon {
        width: 56px;
        height: 56px;
    }

    .bookmark-icon img {
        width: 100%;
        height: 100%;
        max-width: 48px;
        max-height: 48px;
    }
}

/* Touch Grass Button - Circular Icon Button (LEFT side, hidden on mobile) */
.touch-grass-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, #43b581, #3a9b6f);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 6px 20px rgba(67, 181, 129, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.touch-grass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(67, 181, 129, 0.6);
    background: linear-gradient(135deg, #4ec991, #43b581);
}

.touch-grass-button:active {
    transform: translateY(-1px);
}

/* Hide on mobile devices */
@media (max-width: 768px) {
    .touch-grass-button {
        display: none;
    }

    /* Make AI watermark text smaller on mobile to prevent 2-row display */
    .ai-watermark {
        font-size: 0.7rem !important;
        padding: 6px 12px !important;
        gap: 6px !important;
    }
}

/* ===================================
   Weather Widget
   =================================== */

.weather-widget {
    width: 100%;
    max-width: 1200px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: var(--main-card-radius);
    padding: var(--card-padding-standard);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
    position: relative;
    overflow: hidden;
    z-index: 5; /* Layer 1 - Base Container */
}

.weather-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--card-padding-standard);
    color: var(--text-secondary);
}

.weather-loading i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.weather-loading p {
    font-size: 1rem;
    margin: 0;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.weather-title {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.weather-reload-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-background);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--hover-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 20; /* Layer 2 - Primary Content */
    /* Dual shadow base (v2.1.0) */
    box-shadow: var(--hover-shadow-base);
}

/* Streak effect for weather reload button */
.weather-reload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.weather-reload-btn:hover::before {
    left: 100%;
}

.weather-reload-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: var(--hover-shadow);
}

.weather-reload-btn.spinning i {
    animation: rotate 1s linear infinite;
}

/* Weather Controls */
.weather-controls {
    display: flex;
    gap: var(--card-padding-standard);
}

.weather-location-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-background);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--hover-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 20; /* Layer 2 - Primary Content */
    /* Dual shadow base (v2.1.0) */
    box-shadow: var(--hover-shadow-base);
}

/* Streak effect for weather location button */
.weather-location-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--hover-streak-gradient);
    transition: left 0.5s ease;
}

.weather-location-btn:hover::before {
    left: 100%;
}

.weather-location-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    /* v2.1.0: Only lift, no scale */
    transform: translateY(-10px);
    /* Dual shadow intensified */
    box-shadow: var(--hover-shadow);
}

/* Location Selector */
.weather-location-selector {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    padding: var(--card-padding-standard);
    margin-bottom: 20px;
}

.location-option {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    margin-bottom: 10px;
}

.location-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.location-option label {
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
}

.custom-city-input {
    margin-top: 10px;
    display: flex;
    gap: var(--card-padding-standard);
    align-items: center;
    width: 100%;
}

.custom-city-input input[type="text"] {
    flex: 1;
    padding: var(--card-padding-standard);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-background);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.custom-city-input input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.custom-city-input button {
    padding: var(--card-padding-standard);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-city-input button:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.custom-city-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.weather-sky {
    position: relative;
    height: 200px;
    margin-bottom: 20px;
    border-radius: var(--sub-card-radius);
    overflow: hidden;
    transition: background 1s ease;
}

/* Day backgrounds */
.weather-sky.day-clear {
    background: linear-gradient(180deg,
        rgba(135, 206, 250, 0.9) 0%,
        rgba(176, 224, 230, 0.8) 50%,
        rgba(255, 250, 205, 0.6) 100%);
}

.weather-sky.day-partly-cloudy {
    background: linear-gradient(180deg,
        rgba(135, 206, 235, 0.7) 0%,
        rgba(176, 196, 222, 0.6) 50%,
        rgba(220, 220, 220, 0.5) 100%);
}

.weather-sky.day-overcast {
    background: linear-gradient(180deg,
        rgba(169, 169, 169, 0.6) 0%,
        rgba(192, 192, 192, 0.5) 50%,
        rgba(211, 211, 211, 0.4) 100%);
}

.weather-sky.day-stormy {
    background: linear-gradient(180deg,
        rgba(75, 75, 90, 0.7) 0%,
        rgba(100, 100, 115, 0.6) 50%,
        rgba(120, 120, 135, 0.5) 100%);
}

/* Night backgrounds */
.weather-sky.night-clear {
    background: linear-gradient(180deg,
        rgba(25, 25, 112, 0.8) 0%,
        rgba(0, 0, 50, 0.9) 50%,
        rgba(0, 0, 30, 1) 100%);
}

.weather-sky.night-overcast {
    background: linear-gradient(180deg,
        rgba(40, 40, 50, 0.8) 0%,
        rgba(30, 30, 40, 0.9) 50%,
        rgba(20, 20, 30, 1) 100%);
}

.weather-sky.night-stormy {
    background: linear-gradient(180deg,
        rgba(30, 30, 50, 0.9) 0%,
        rgba(20, 20, 40, 0.95) 50%,
        rgba(10, 10, 30, 1) 100%);
}

/* Twilight backgrounds (dawn/dusk) */
.weather-sky.twilight-dawn,
.weather-sky.twilight-dusk {
    background: linear-gradient(180deg,
        rgba(255, 140, 105, 0.7) 0%,      /* Warm coral */
        rgba(255, 165, 130, 0.8) 30%,     /* Peachy orange */
        rgba(255, 190, 150, 0.7) 60%,     /* Light peach */
        rgba(255, 220, 180, 0.6) 100%);   /* Pale yellow-orange */
}

.weather-sky.twilight-dawn-overcast,
.weather-sky.twilight-dusk-overcast {
    background: linear-gradient(180deg,
        rgba(180, 120, 110, 0.7) 0%,      /* Muted coral */
        rgba(190, 135, 130, 0.7) 40%,
        rgba(200, 170, 150, 0.6) 100%);
}

.weather-sky.twilight-dawn-stormy,
.weather-sky.twilight-dusk-stormy {
    background: linear-gradient(180deg,
        rgba(100, 80, 90, 0.8) 0%,        /* Dark purple-gray */
        rgba(120, 95, 105, 0.7) 50%,
        rgba(140, 120, 130, 0.6) 100%);
}

/* Ground Plane - Opaque horizon that hides sun/moon when they set */
.weather-sky::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg,
        rgba(34, 139, 34, 0.7) 0%,
        rgba(34, 139, 34, 0.9) 50%,
        rgba(34, 139, 34, 1) 100%);
    border-radius: 0 0 var(--sub-card-radius) var(--sub-card-radius);
    z-index: 10; /* Higher than sun/moon (z-index: 2) */
}

.weather-sky.night-clear::after,
.weather-sky.night-overcast::after,
.weather-sky.night-stormy::after {
    background: linear-gradient(180deg,
        rgba(10, 30, 10, 0.8) 0%,
        rgba(10, 30, 10, 0.95) 50%,
        rgba(10, 30, 10, 1) 100%);
}

.weather-sky.twilight-dawn::after,
.weather-sky.twilight-dusk::after,
.weather-sky.twilight-dawn-overcast::after,
.weather-sky.twilight-dusk-overcast::after,
.weather-sky.twilight-dawn-stormy::after,
.weather-sky.twilight-dusk-stormy::after {
    background: linear-gradient(180deg,
        rgba(60, 80, 50, 0.8) 0%,       /* Warm greenish-brown */
        rgba(50, 70, 40, 0.95) 50%,
        rgba(40, 60, 30, 1) 100%);
}

/* Sun/Moon Arc */
.sun-moon-arc {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sun-moon-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.celestial-body {
    position: absolute;
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    transition: all 1s ease;
    animation: celestialGlow 3s ease-in-out infinite;
}

@keyframes celestialGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
}

/* Fog/Mist Overlay */
.fog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    z-index: 4.5;
    transition: background 1s ease;
}

.fog-overlay.light-fog {
    background: rgba(255, 255, 255, 0.15);
}

.fog-overlay.medium-fog {
    background: rgba(255, 255, 255, 0.3);
}

.fog-overlay.heavy-fog {
    background: rgba(255, 255, 255, 0.4);
}

/* Lightning Flash */
.lightning-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    z-index: 4.8;
}

.lightning-flash.active {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0%, 100% {
        background: rgba(255, 255, 255, 0);
    }
    50% {
        background: rgba(255, 255, 255, 0.9);
    }
}

/* Stars Container */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1.5;
    opacity: 0;
    transition: opacity 1s ease;
}

.stars-container.visible {
    opacity: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Rain Droplets */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2.5;
}

/* Clouds */
.clouds-container {
    position: absolute;
    top: -25px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.cloud {
    position: absolute;
    font-size: 3rem;
    opacity: 0.6;
    animation: slideCloud linear infinite;
    will-change: transform;
}

@keyframes slideCloud {
    0% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(750px);
        opacity: 0;
    }
}

.raindrop {
    position: absolute;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0);
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) scale(0);
        opacity: 0;
    }
    10% {
        transform: translateY(-10px) scale(1);
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(170px) scale(1);
        opacity: 0;
    }
}

/* Weather Info */
.weather-info {
    text-align: center;
    margin-bottom: 20px;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.temp-value {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.temp-unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.weather-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    margin-bottom: 15px;
}

.weather-details {
    display: flex;
    justify-content: space-around;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border-radius: var(--sub-card-radius);
    border: 1px solid var(--glass-border);
}

.weather-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.weather-detail i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Sun Times */
.weather-sun-times {
    display: flex;
    justify-content: space-around;
    gap: var(--card-padding-standard);
    padding: var(--card-padding-standard);
    background: var(--glass-background);
    border-radius: var(--sub-card-radius);
    border: 1px solid var(--glass-border);
}

.sun-time {
    display: flex;
    align-items: center;
    gap: var(--card-padding-standard);
    font-size: 1rem;
    font-weight: 600;
}

.sun-time i {
    font-size: 1.3rem;
    color: var(--warning-color);
}

/* Weather Debug Panel */
.weather-debug-panel {
    position: fixed;
    bottom: 80px;
    right: 30px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--sub-card-radius);
    padding: var(--card-padding-standard);
    box-shadow: var(--shadow);
    z-index: 1000;
    min-width: 250px;
}

.weather-debug-panel h3 {
    font-size: 1.1rem;
    margin: 0 0 15px 0;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.debug-control {
    margin-bottom: 15px;
}

.debug-control:last-child {
    margin-bottom: 0;
}

.debug-control label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.debug-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.debug-control input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.debug-control .range-value {
    display: inline-block;
    margin-left: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.debug-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 90px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-background);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.debug-toggle-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.debug-toggle-btn.active {
    background: var(--primary-color);
}

/* Weather Widget Responsive */
@media (max-width: 768px) {
    .weather-widget {
        padding: var(--card-padding-standard);
    }

    .weather-title {
        font-size: 1.2rem;
    }

    .weather-sky {
        height: 150px;
    }

    .weather-sky::after {
        height: 30px;
    }

    .celestial-body {
        font-size: 2rem;
    }

    .cloud {
        font-size: 2rem;
    }

    @keyframes slideCloud {
        0% {
            opacity: 0.6;
        }
        95% {
            opacity: 0.6;
        }
        100% {
            transform: translateX(500px);
            opacity: 0;
        }
    }

    .raindrop {
        font-size: 0.75rem;
    }

    @keyframes fall {
        0% {
            transform: translateY(-20px) scale(0);
            opacity: 0;
        }
        10% {
            transform: translateY(-10px) scale(1);
            opacity: 0.7;
        }
        90% {
            opacity: 0.7;
        }
        100% {
            transform: translateY(130px) scale(1);
            opacity: 0;
        }
    }

    .weather-temp {
        font-size: 2.5rem;
    }

    .weather-details {
        flex-direction: column;
        gap: var(--card-padding-standard);
    }

    .weather-detail {
        flex-direction: row;
        justify-content: center;
    }
}

/* Swup Transitions */
html.is-changing .transition-fade {
  transition: opacity 0.25s;
  opacity: 0;
}
