/* Global text selection styling for better visibility */
::selection {
    background: var(--theme-primary);
    color: var(--theme-surface);
    text-shadow: none;
}

::-moz-selection {
    background: var(--theme-primary);
    color: var(--theme-surface);
    text-shadow: none;
}

/* Light theme text selection - ensure visibility */
body[data-theme*="-light"] ::selection {
    background: var(--theme-primary);
    color: #ffffff;
    text-shadow: none;
}

body[data-theme*="-light"] ::-moz-selection {
    background: var(--theme-primary);
    color: #ffffff;
    text-shadow: none;
}

/* CSS Custom Properties for Theming */
:root {
    /* Default Theme Colors (Dark) */
    --theme-background: #0f0f23;
    --theme-surface: #1e1e2e;
    --theme-primary: #ff6b35;
    --theme-secondary: #e55a2b;
    --theme-accent: #ff8c42;
    --theme-text: #ffffff;
    --theme-text-secondary: #cccccc;
    --theme-border: #404040;
    --theme-hover: #e55a2b;
    --theme-button-text: #ffffff;
}

/* Reset */
/* Reset margins and padding for full-width layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease !important;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--theme-background);
    color: var(--theme-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Enhanced Navigation with Active States */
.navbar {
    background: linear-gradient(135deg, var(--theme-surface) 0%, var(--theme-background) 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--theme-border);
    overflow: visible;
    backdrop-filter: blur(10px);
}

/* Navigation links container */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.avatar-default {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
    font-size: 18px !important;
}

/* Theme selector container with better spacing for buttons */
.theme-selector {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important; /* Increased gap for better visual separation */
    padding: 0 8px;
    flex-wrap: nowrap !important; /* Prevent wrapping to new line */
}

.theme-icon-btn {
    background: var(--theme-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    position: relative;
}

.theme-icon-btn:hover {
    background: var(--theme-primary);
    color: var(--theme-button-text);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Unified Dropdown Styles - Consolidated (removed duplicates at lines 247 and 369) */

.dropdown-header {
    font-weight: bold;
    padding: 0.5rem;
    text-align: center;
    color: var(--theme-text);
    border-bottom: 1px solid var(--theme-border);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.dropdown-option {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-option:hover {
    background: var(--theme-primary);
    color: var(--theme-button-text);
}

.dropdown-option.active {
    background: var(--theme-primary);
    color: var(--theme-button-text);
    font-weight: bold;
}

/* Scale and Text Size Dropdown Specific Styles */
.scale-dropdown, .text-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--theme-surface) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    z-index: 10000 !important;
    min-width: 160px !important;
    padding: 0.5rem !important;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.scale-dropdown.show, .text-dropdown.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
}

/* Text Size Classes */
body.text-small {
    font-size: 14px;
}

body.text-small h1 { font-size: 1.8rem; }
body.text-small h2 { font-size: 1.5rem; }
body.text-small h3 { font-size: 1.2rem; }

body.text-normal {
    font-size: 16px;
}

body.text-large {
    font-size: 18px;
}

body.text-large h1 { font-size: 2.2rem; }
body.text-large h2 { font-size: 1.8rem; }
body.text-large h3 { font-size: 1.4rem; }

body.text-xlarge {
    font-size: 20px;
}

body.text-xlarge h1 { font-size: 2.5rem; }
body.text-xlarge h2 { font-size: 2rem; }
body.text-xlarge h3 { font-size: 1.6rem; }

/* Removed - using unified .theme-icon-btn styles and consolidated dropdown styles */

.nav-item.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--theme-button-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
    left: 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    min-width: 250px;
    max-width: 300px;
}

.nav-brand .logo {
    width: 250px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.nav-brand .logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    color: var(--theme-text);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--theme-border);
    background: var(--theme-surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-item:hover {
    color: var(--theme-button-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--theme-primary);
}

.nav-item:hover::before {
    left: 0;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--theme-button-text);
    border-color: var(--theme-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
    left: 0;
    background: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-primary) 100%);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Removed duplicate theme-selector rule - using unified one above */

/* Removed conflicting brand-toggle-btn styles - using unified .theme-icon-btn */

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    padding: 1.5rem;
    min-width: 350px;
    max-width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 9999;
    margin-top: 0.5rem;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.theme-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.theme-dropdown-header {
    font-weight: bold;
    color: var(--theme-text);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.brand-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--theme-border);
}

.brand-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.brand-name {
    font-weight: 600;
    color: var(--theme-text);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.theme-modes {
    display: flex;
    gap: 0.5rem;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    color: var(--theme-text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    flex: 1;
    font-weight: 500;
}

.theme-option:hover, .theme-option.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--theme-button-text);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--theme-border);
}

/* Authentication */
.auth-section, .user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Enhanced Button Styles with Gradients and Animations */
.auth-btn, .logout-btn, .admin-btn {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border: none;
    color: var(--theme-button-text);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-btn::before, .logout-btn::before, .admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-btn:hover, .logout-btn:hover, .admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.auth-btn:hover::before, .logout-btn:hover::before, .admin-btn:hover::before {
    left: 100%;
}

.auth-btn:active, .logout-btn:active, .admin-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User Avatar */
.user-avatar-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--theme-primary);
    object-fit: cover;
}

.default-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-button-text);
    font-size: 1.2rem;
    border: 2px solid var(--theme-primary);
}

/* Enhanced Hero Section - Full Width Layout */
.hero-section {
    background: url('motorcycle-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: visible;
    padding-top: 120px;
    left: 0;
    right: 0;
}

/* Add side decorative elements */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, 
        url('safety-background.jpg') 0%, 
        transparent 100%);
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(270deg, 
        url('tips-background.jpg') 0%, 
        transparent 100%);
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 1;
}

.hero-overlay {
    background: none;
    padding: 2rem;
    border-radius: 0;
    max-width: 1200px;
    width: 100%;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
    z-index: 2;
    margin: 0 auto;
    padding-top: 50px;
}

.hero-overlay::before {
    display: none;
}

.hero-slogan {
    font-size: 3rem;
    font-weight: bold;
    color: var(--theme-primary);
    margin-bottom: 2rem;
    margin-top: 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 3;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-signature {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    position: relative;
    z-index: 3;
}

.brand-signature {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-style: italic;
    /* Add dark transparent background for consistency */
    display: inline-block;
    padding: 8px 20px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.1em;
    opacity: 0.9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
    margin-right: 20px;
}

/* Content Sections with Enhanced Backgrounds - Fixed Layout */
.content-section {
    padding: 4rem 2rem;
    width: 100%;
    margin: 0;
    position: relative;
    max-width: none;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Remove padding from home section to allow full-width hero */
#home.content-section {
    padding: 0;
    width: 100%;
    margin: 0;
    min-height: auto;
}

/* Section-Specific Backgrounds - Fixed Layout Coverage */
#safety {
    background: url('safety-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#rules {
    background: url('rules-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#tips {
    background: url('tips-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#chat {
    background: url('chat-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Light theme background overlays - Enhanced Visibility */
body[data-theme*="-light"] #safety {
    background: 
        linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), 
        url('safety-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body[data-theme*="-light"] #rules {
    background: 
        linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), 
        url('rules-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body[data-theme*="-light"] #tips {
    background: 
        linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), 
        url('tips-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body[data-theme*="-light"] #chat {
    background: 
        linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), 
        url('chat-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#rules {
    background: url('rules-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #rules {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('rules-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#tips {
    background: url('tips-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #tips {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('tips-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#chat {
    background: url('chat-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #chat {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('chat-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* New section backgrounds */
#events {
    background: url('events-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #events {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('events-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#news {
    background: url('news-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #news {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('news-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#map {
    background: url('map-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #map {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('map-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#forum {
    background: url('forum-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 4rem 2rem;
}

body[data-theme*="-light"] #forum {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('forum-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

#app {
    background: url('app-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body[data-theme*="-light"] #app {
    background: linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25)), url('app-background.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.section-title {
    font-size: 3rem;
    color: var(--theme-primary);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 800;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
    position: relative;
    animation: fadeInUp 0.8s ease-out;
    
    /* Glassmorphism background for titles */
    background: rgba(var(--theme-surface-rgb, 30, 30, 46), 0.25);
    border-radius: 20px;
    padding: 1.5rem 3rem;
    border: 1px solid var(--theme-border);
    backdrop-filter: blur(15px);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.section-title:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 2px;
}

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

.section-content {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 3rem;
    margin: 0 auto 2.5rem auto;
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

/* Light theme card adjustments */
body[data-theme*="-light"] .section-content {
    background: rgba(248, 249, 250, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Light theme hero slogan - clean shadows, no harsh outlines */
body[data-theme*="-light"] .hero-section h1.hero-slogan,
body[data-theme*="-light"] h1.hero-slogan,
body[data-theme*="-light"] .content-section h1.hero-slogan {
    color: var(--theme-primary) !important;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(0, 0, 0, 0.2) !important;
    -webkit-text-fill-color: var(--theme-primary) !important;
}

body[data-theme*="-light"] .brand-signature {
    color: rgba(0, 0, 0, 0.7) !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.3);
}

body[data-theme*="-dark"] .brand-signature {
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.section-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 25px 25px 0 0;
}

.section-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.02) 50%, 
        transparent 70%
    );
    pointer-events: none;
}

.section-content:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body[data-theme*="-light"] .section-content:hover {
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Light theme section titles with glassmorphism background */
body[data-theme*="-light"] .section-title {
    color: var(--theme-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: rgba(248, 249, 250, 0.3);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-theme*="-light"] .section-title:hover {
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-theme*="-light"] .section-content h3 {
    color: var(--theme-primary);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

body[data-theme*="-light"] .section-content p,
body[data-theme*="-light"] .section-content li {
    color: var(--theme-text);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

body[data-theme*="-light"] .nav-item {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Light theme heading shadows - dark shadows for better visibility on light backgrounds */
body[data-theme*="-light"] h1,
body[data-theme*="-light"] h2,
body[data-theme*="-light"] h3,
body[data-theme*="-light"] h4,
body[data-theme*="-light"] h5,
body[data-theme*="-light"] h6 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

body[data-theme*="-light"] p,
body[data-theme*="-light"] li,
body[data-theme*="-light"] span,
body[data-theme*="-light"] label,
body[data-theme*="-light"] a {
    text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.2);
}

/* Content section headings with proper dark shadows for light themes */
body[data-theme*="-light"] .content-section h1,
body[data-theme*="-light"] .content-section h2,
body[data-theme*="-light"] .content-section h3,
body[data-theme*="-light"] .content-section h4,
body[data-theme*="-light"] .content-section h5,
body[data-theme*="-light"] .content-section h6 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

body[data-theme*="-light"] .content-section p,
body[data-theme*="-light"] .content-section li,
body[data-theme*="-light"] .content-section span,
body[data-theme*="-light"] .content-section label,
body[data-theme*="-light"] .content-section a {
    text-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.2);
}

body[data-theme*="-light"] .content-section strong {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.section-content h3 {
    color: var(--theme-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 700;
}

.section-content p {
    color: var(--theme-text);
    margin-bottom: 1rem;
    line-height: 1.8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.section-content ul {
    color: var(--theme-text);
    padding-left: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.section-content li {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.section-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    text-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.9),
        -1px -1px 2px rgba(255, 255, 255, 0.4),
        0 0 8px rgba(0, 0, 0, 0.7);
    font-weight: 500;
}

.section-content strong, .section-content b {
    color: var(--theme-primary);
    font-weight: 700;
    text-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.9),
        -1px -1px 2px rgba(255, 255, 255, 0.4),
        0 0 8px rgba(0, 0, 0, 0.7);
}

.section-content em, .section-content i {
    font-style: italic;
    text-shadow: 
        1px 1px 4px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(255, 255, 255, 0.3),
        0 0 6px rgba(0, 0, 0, 0.6);
}
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: calc(100vh - 200px); /* Expand to fill most of viewport height */
    height: auto;
}

.chat-layout {
    display: flex;
    flex-direction: row; /* Side-by-side layout - MIRC style */
    gap: 0;
    height: 70vh; /* Fill 70% of viewport height */
    max-height: 800px; /* Maximum height */
    min-height: 500px; /* Minimum height for usability */
    border: 1px solid var(--theme-border);
    border-radius: 15px;
    overflow: hidden;
    background: var(--theme-surface);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Left Panel - Chat Messages (MIRC-style layout) */
.chat-main {
    flex: 4; /* 80% of width for messages */
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--theme-border); /* Stronger border for MIRC feel */
    background: var(--theme-background);
    min-height: 0; /* Important for flexbox scrolling */
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--theme-background);
    border-bottom: 1px solid var(--theme-border);
}

.chat-header h3 {
    margin: 0;
    color: var(--theme-primary);
    font-size: 1.1rem;
}

.chat-search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-search {
    padding: 0.5rem;
    border: 1px solid var(--theme-border);
    border-radius: 15px;
    background: var(--theme-surface);
    color: var(--theme-text);
    font-size: 0.9rem;
    outline: none;
    width: 200px;
    transition: border-color 0.3s ease;
}

.chat-search:focus {
    border-color: var(--theme-primary);
}

.search-btn {
    background: var(--theme-primary);
    border: none;
    color: var(--theme-button-text);
    padding: 0.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: var(--theme-hover);
}

.chat-messages {
    flex: 1;
    background: var(--theme-background);
    border: none;
    border-radius: 0;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Courier New', monospace; /* Monospace for MIRC feel */
    font-size: 0.85rem; /* Smaller font for more messages */
    line-height: 1.3;
    color: var(--theme-text);
    min-height: 0; /* Important for flexbox scrolling */
}

/* MIRC-style message formatting */
.chat-message {
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-default-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-header strong {
    color: var(--theme-primary);
    font-weight: bold;
    font-size: 0.9rem;
}

.message-time {
    color: var(--theme-text-secondary);
    font-size: 0.75rem;
    margin-left: auto;
}

.message-controls {
    display: inline-flex;
    gap: 0.5rem;
}

.message-controls button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.message-controls button:hover {
    opacity: 1;
}

.chat-message-timestamp {
    color: var(--theme-text-secondary);
    font-size: 0.75rem;
}

.chat-message-user {
    color: var(--theme-primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

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

.message-text {
    color: var(--theme-text);
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Chat link styling for external links */
.chat-link {
    color: var(--theme-primary) !important;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--theme-primary);
    padding-bottom: 1px;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
}

.chat-link:hover {
    color: var(--theme-secondary) !important;
    border-bottom-color: var(--theme-secondary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.chat-link:active {
    transform: translateY(0);
}

.chat-link:visited {
    color: var(--theme-primary) !important;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem;
    background: var(--theme-surface);
    border-top: 1px solid var(--theme-border);
    /* Ensure input container stays at bottom */
    flex-shrink: 0;
    margin-top: auto;
}

/* Enhanced Input Styling */
.chat-input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--theme-border);
    border-radius: 25px;
    background: var(--theme-background);
    color: var(--theme-text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(255, 107, 53, 0.1);
    transform: translateY(-1px);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-background);
    color: var(--theme-text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--theme-primary);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(255, 107, 53, 0.1);
    transform: translateY(-1px);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border: none;
    color: var(--theme-button-text);
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.chat-send-btn:hover::before {
    left: 100%;
}

/* Right Panel - Online Users (MIRC-style) */
.online-panel {
    flex: 1 !important; /* 20% of width for users list - force override */
    min-width: 0; /* Remove minimum width constraint */
    width: auto; /* Let flex handle the width */
    background: var(--theme-surface);
    border-left: 1px solid var(--theme-border);
}

.online-users {
    height: 100%; /* Ensure full height */
    display: flex;
    flex-direction: column;
}

.online-users-title {
    color: var(--theme-primary);
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.8rem;
    margin: 0;
    text-align: center;
    background: var(--theme-background);
    border-bottom: 1px solid var(--theme-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.online-users-list {
    flex: 1; /* Fill remaining space to match chat messages height */
    padding: 0.25rem; /* Reduced padding */
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace; 
    /* Ensure it fills the height properly */
    min-height: 0; 
    height: 100%; /* Force full height */
}

/* MIRC-style user list items - Compact list design */
.online-users-list .user-item {
    display: flex;
    align-items: center;
    padding: 0.15rem 0.4rem; /* Much more compact padding */
    margin: 0.05rem 0; /* Minimal margin between users */
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem; /* Smaller font for compact list */
    line-height: 1.2; /* Tight line spacing */
    min-height: 1.5rem; /* Small minimum height */
}

.online-users-list .user-item:hover {
    background-color: var(--theme-hover);
    color: var(--theme-button-text);
}

.online-users-list .user-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #00ff41; /* Online green */
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.online-users-list .user-name {
    font-weight: normal;
    color: var(--theme-text);
    font-size: 0.75rem; /* Compact font size */
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* Keep users on single lines */
}

.online-user-admin {
    color: var(--theme-accent);
    font-weight: bold;
}

.online-user-regular {
    color: var(--theme-text);
}

/* Compact Statistics Section - Bottom placement like MIRC */
.stats-container {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 15px;
    padding: 1rem; /* Reduced padding for compactness */
    margin-top: 1rem;
    position: relative; /* Ensure it stays at bottom */
}

.stats-title {
    color: var(--theme-primary);
    font-size: 1rem; /* Slightly smaller */
    font-weight: bold;
    margin-bottom: 0.8rem; /* Reduced margin */
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Smaller minimum width */
    gap: 0.8rem; /* Smaller gap */
}

.stat-item-compact {
    display: flex;
    align-items: center;
    background: var(--theme-background);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.stat-item-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    opacity: 0.05;
    transition: left 0.5s ease;
}

.stat-item-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--theme-primary);
}

.stat-item-compact:hover::before {
    left: 0;
}

.stat-icon {
    font-size: 1.3rem;
    margin-right: 0.8rem;
    opacity: 0.8;
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.stat-value {
    color: var(--theme-primary);
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-label {
    color: var(--theme-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-value {
    color: var(--theme-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Authentication Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--theme-surface);
    margin: 5% auto;
    padding: 2rem;
    position: relative;
    z-index: 10001;
    border: 1px solid var(--theme-border);
    border-radius: 15px;
    width: 95%;
    max-width: 800px; /* Increased from 400px for landscape layout */
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 85vh; /* Add max height to prevent overflow */
    overflow-y: auto; /* Add scroll if needed */
}

.close {
    color: var(--theme-text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--theme-primary);
}

.modal h2 {
    color: var(--theme-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--theme-text);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}



.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border: none;
    color: var(--theme-button-text);
    padding: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.auth-submit-btn:hover::before {
    left: 100%;
}

.auth-toggle {
    text-align: center;
    color: var(--theme-text-secondary);
    margin-top: 1rem;
}

.auth-toggle a {
    color: var(--theme-primary);
    text-decoration: none;
    cursor: pointer;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* Avatar Modal */
.avatar-modal .modal-content {
    max-width: 500px;
}

/* Registration Form - Horizontal Layout */
#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Two-column layout for registration form */
.registration-form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.registration-column-left,
.registration-column-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Basic login fields stay full width */
.login-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 2% auto;
        padding: 1.5rem;
    }
    
    .registration-form-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 1% auto;
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .avatar-preview-small {
        width: 60px;
        height: 60px;
    }
}

/* Avatar upload styling for horizontal layout */
.avatar-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-preview-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--theme-border);
    position: relative;
}

.avatar-placeholder-small {
    width: 100%;
    height: 100%;
    background: var(--theme-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--theme-text-secondary);
}

.avatar-placeholder-small span {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.avatar-placeholder-small p {
    font-size: 0.7rem;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

/* Motorbike dropdowns in horizontal layout */
.motorbike-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message Avatars */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
    border: 2px solid var(--theme-border);
}

.message-default-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--theme-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 0.5rem;
    border: 2px solid var(--theme-border);
}

.avatar-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.avatar-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    border: 2px dashed var(--theme-border);
    border-radius: 10px;
    position: relative;
    background: var(--theme-background);
}

.avatar-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
}

.avatar-placeholder {
    text-align: center;
    color: var(--theme-text-secondary);
    cursor: pointer;
    padding: 2rem;
}

.avatar-placeholder span {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.avatar-upload-section {
}

/* Mobile responsiveness for chat layout */
@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column; /* Stack vertically on mobile */
        height: auto;
        min-height: 500px;
    }
    
    .chat-main {
        flex: none;
        height: 400px;
        border-right: none;
        border-bottom: 2px solid var(--theme-border);
    }
    
    .online-panel {
        flex: none;
        min-width: auto;
        max-width: none;
        height: 200px;
        border-left: none;
        border-top: 1px solid var(--theme-border);
    }
    
    .stats-container {
        margin-top: 1rem;
    }
    
    .stats-grid-compact {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 0.5rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .chat-layout {
        min-height: 400px;
    }
    
    .chat-main {
        height: 300px;
    }
    
    .online-panel {
        height: 150px;
    }
    
    .stats-grid-compact {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
}
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-upload-btn, .avatar-delete-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.avatar-upload-btn {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--theme-button-text);
}

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

.avatar-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.avatar-upload-btn:hover::before {
    left: 100%;
}

.avatar-delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.avatar-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    filter: brightness(1.1);
}

.upload-info {
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
}

.upload-progress {
    background: var(--theme-border);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-top: 1rem;
}

.upload-progress-bar {
    background: var(--theme-primary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* Admin Section */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--theme-surface);
    border: 2px solid var(--theme-border);
    color: var(--theme-text);
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover, .tab-btn.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--theme-button-text);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.admin-controls input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-background);
    color: var(--theme-text);
}

.admin-controls button {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border: none;
    color: var(--theme-button-text);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Admin User Management - Improved Layout */
.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--theme-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.user-info h4 {
    margin: 0;
    color: var(--theme-primary);
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 200px;
}

.user-info p {
    margin: 0;
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
    min-width: 150px;
}

.user-info p:first-of-type {
    color: var(--theme-text);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.user-actions button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-admin {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.btn-reset-password {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-reset-password:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.btn-ban {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-ban:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

.btn-unban {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-unban:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.btn-delete {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: white !important;
    margin-left: 0.5rem !important;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #991b1b, #7f1d1d) !important;
    transform: translateY(-1px);
}

/* Responsive admin layout */
@media (max-width: 1200px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .user-info h4,
    .user-info p {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Auth Required Message - Glassmorphism style similar to section-content */
.auth-required {
    text-align: center;
    background: rgba(26, 26, 46, 0.7);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 25px;
    padding: 3rem;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme auth required adjustments */
body[data-theme*="-light"] .auth-required {
    background: rgba(248, 249, 250, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-required h3 {
    color: var(--theme-primary);
    margin-bottom: 1rem;
}

.auth-required p {
    color: var(--theme-text);
    margin-bottom: 2rem;
}

/* Desktop chat layout - ensure horizontal layout */
@media (min-width: 769px) {
    .chat-layout {
        flex-direction: row !important; /* Force horizontal layout on desktop */
        height: 80vh !important; /* Override with proper height for desktop */
        min-height: 600px !important; /* Ensure minimum height */
    }
    
    .chat-main {
        flex: 4 !important; /* 80% width for messages on desktop */
        border-right: 1px solid var(--theme-border);
        border-bottom: none;
    }
    
    .online-panel {
        flex: 1 !important; /* 20% width for users on desktop */
        min-width: 0; /* Remove width constraints for proper flex */
        width: auto;
    }
    
    .chat-container {
        min-height: calc(100vh - 200px); /* Fill viewport properly on desktop */
        height: auto;
    }
}

/* Responsive Design */
/* Mobile Navigation - Complete Fix */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-brand {
        min-width: auto;
        max-width: none;
        order: 1;
        flex: 1;
    }
    
    .nav-brand .logo {
        width: 150px;
        max-height: 40px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0.3rem;
        margin-top: 0.5rem;
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        border-radius: 15px;
        margin: 0.1rem;
        min-width: auto;
        flex: none;
    }
    
    .nav-item:hover {
        transform: none;
    }
    
    .nav-auth {
        order: 2;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
        margin-left: auto;
    }
    
    .theme-selector {
        position: static;
        margin-right: 0.5rem;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    
    /* Removed brand-toggle-btn specific styling - using unified .theme-icon-btn */
    
    .login-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.7rem !important;
        border-radius: 15px !important;
    }
    
    .theme-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        max-width: 90vw;
        max-height: 80vh;
        min-width: 280px;
        z-index: 10000;
    }
    
    /* Mobile chat adjustments */
    .chat-container {
        min-height: calc(100vh - 300px);
    }
    
    .chat-layout {
        height: 60vh;
        min-height: 400px;
        flex-direction: column;
    }
    
    .chat-main {
        border-right: none;
        border-bottom: 1px solid var(--theme-border);
    }
    
    .chat-sidebar {
        border-top: 1px solid var(--theme-border);
        max-height: 200px;
    }
    
    .hero-section {
        height: 100vh;
        padding-top: 120px;
        align-items: flex-start;
    }
    
    .hero-overlay {
        margin-top: 0;
        padding: 1rem 10px;
    }
    
    .hero-slogan {
        font-size: 2rem;
        line-height: 1.2;
        margin-top: 0;
        text-align: center;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .navbar {
        padding: 0.3rem 0.5rem;
    }
    
    .nav-brand .logo {
        width: 120px;
        max-height: 35px;
    }
    
    .nav-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
        border-radius: 12px;
    }
    
    /* Removed brand-toggle-btn specific styling - using unified .theme-icon-btn */
    
    .hero-slogan {
        font-size: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .hero-signature {
        font-size: 1.2rem;
    }
}
    
    .brand-signature {
        font-size: 1rem;
        margin-right: 10px;
    }
    
    .section-title {
        font-size: 2.2rem;
        padding: 1rem 2rem;
        margin-bottom: 2rem;
    }
    
    .content-section {
        padding: 2rem 1rem;
    }
    
    .section-content {
        padding: 1.5rem;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .chat-layout {
        height: 50vh; /* Smaller height for very small screens */
        flex-direction: column;
        min-height: 350px; /* Ensure minimum usability */
    }
    
    .chat-main {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--theme-border);
    }
    
    .online-panel {
        flex: none;
        min-width: auto;
        height: 200px;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .chat-search-container {
        justify-content: center;
    }
    
    .chat-search {
        width: 100%;
        max-width: 250px;
    }
    
    /* Compact stats mobile responsiveness */
    .stats-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .stat-item-compact {
        padding: 0.6rem 0.8rem;
        min-height: 50px;
    }
    
    .stat-icon {
        font-size: 1.1rem;
        margin-right: 0.6rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .chat-messages {
        max-height: 250px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Reduce animations on mobile for better performance */
    .section-content:hover {
        transform: none;
    }
    
    .auth-btn:hover, .logout-btn:hover, .admin-btn:hover,
    .brand-toggle-btn:hover, .chat-send-btn:hover,
    .auth-submit-btn:hover, .avatar-upload-btn:hover {
        transform: none;
    }
}



/* Enhanced Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--theme-border);
    border-radius: 50%;
    border-top-color: var(--theme-primary);
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced Pulse Animation for Important Buttons */
@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
    }
}

.auth-btn:not(:hover) {
    animation: gentlePulse 3s ease-in-out infinite;
}

.brand-toggle-btn:not(:hover) {
    animation: gentlePulse 4s ease-in-out infinite;
}

/* Enhanced Section Content Animation on Scroll */
.section-content {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.section-content:nth-child(odd) {
    animation-delay: 0.1s;
}

.section-content:nth-child(even) {
    animation-delay: 0.2s;
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Enhanced Scrollbar with Gradients */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--theme-background);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 5px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-primary) 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Enhanced Registration Form Styles */
.registration-only {
    border-left: 3px solid var(--theme-primary);
    padding-left: 15px;
    margin-left: 10px;
}

.form-group small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    display: block;
    margin-top: 5px;
    font-style: italic;
}

/* Avatar Upload Styles for Registration */
.avatar-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.avatar-preview-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.avatar-preview-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-small {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.avatar-placeholder-small span {
    font-size: 24px;
}

.avatar-placeholder-small p {
    font-size: 10px;
    margin: 2px 0 0 0;
    line-height: 1.2;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-select-btn, .avatar-clear-btn {
    background: var(--theme-primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.avatar-select-btn:hover, .avatar-clear-btn:hover {
    background: var(--theme-secondary);
    transform: translateY(-2px);
}

.avatar-clear-btn {
    background: #dc2626;
}

.avatar-clear-btn:hover {
    background: #ef4444;
}

/* Dependent Dropdown Styles */
select:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

select:disabled option {
    color: rgba(0, 0, 0, 0.5);
}

/* Enhanced Form Labels */
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: rgba(255, 255, 255, 0.9);
}

/* Registration Form Animation */
.registration-only {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s ease;
}

.registration-only.show {
    opacity: 1;
    transform: translateX(0);
}

/* Loading States */
.loading-dropdown {
    background-image: linear-gradient(45deg, transparent 25%, rgba(255,255,255,.1) 25%, rgba(255,255,255,.1) 75%, transparent 75%, transparent), 
                      linear-gradient(45deg, transparent 25%, rgba(255,255,255,.1) 25%, rgba(255,255,255,.1) 75%, transparent 75%, transparent);
    background-size: 15px 15px;
    background-position: 0 0, 8px 8px;
    animation: loadingStripes 0.8s linear infinite;
}

@keyframes loadingStripes {
    0% { background-position: 0 0, 8px 8px; }
    100% { background-position: 15px 15px, 23px 23px; }
}

/* Theme Icon Button Styling - Unified for all three buttons */
.theme-icon-btn {
    background: var(--theme-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    /* Ensure horizontal positioning */
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.theme-icon-btn:hover {
    background: var(--theme-secondary) !important;
    transform: scale(1.1) !important;
}

/* Remove any conflicting styles for brand-toggle-btn */
.brand-toggle-btn {
    /* All styling now comes from .theme-icon-btn */
}

/* Theme Selector - removed duplicate, using definition at line 97 */

/* Theme Control Buttons (Scale, Text Size, Theme) - overrides inline styles */
.theme-control-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.theme-control-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.05) !important;
}

/* Coming Soon Sections */
.coming-soon {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin: 20px 0;
}

.coming-soon h3 {
    color: var(--theme-primary);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.coming-soon p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.feature-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--theme-primary);
}

.feature-preview h4 {
    color: var(--theme-secondary);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.feature-preview ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.feature-preview li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-preview li:last-child {
    border-bottom: none;
}

.feature-preview li:hover {
    color: var(--theme-primary);
    padding-left: 10px;
    transition: all 0.3s ease;
}

/* Logo clickable cursor */
.logo {
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}