/**
 * Side Menu Styles
 * Hamburger menu and slide-out side menu for authenticated users
 */

/* Hamburger Menu Button */
.hamburger-menu-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: #ffffff;
    font-size: 1.2rem;
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hamburger-menu-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.05);
}

.hamburger-menu-btn:focus {
    outline: none;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.4),
        0 0 25px rgba(255, 255, 255, 0.15),
        0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Hamburger Icon */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 18px;
    justify-content: center;
    align-items: center;
    gap: 3px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
    border-radius: 1px;
    flex-shrink: 0;
    /* Safari-specific fixes */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hamburger-menu-btn.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu-btn.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navbar Greeting */
.navbar-greeting {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
}

/* Crown icon alignment */
.fas.fa-crown {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
}

/* Ensure auth buttons container uses flexbox for proper alignment */
.auth-buttons {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    height: 100% !important;
}

/* Side Menu Overlay */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Side Menu Container */
.side-menu {
    position: fixed;
    top: 0;
    right: -350px; /* Hidden by default */
    width: 350px;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #0f1425 50%, #080f1a 100%);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: right 0.25s ease-out;
    border-left: 1px solid rgba(0, 87, 246, 0.2);
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    right: 0;
}

/* Side Menu Header */
.side-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
    position: sticky;
    top: 0;
    background: #000000;
    z-index: 1;
    position: relative;
}

.side-menu-header h5 {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.side-menu-header h5 .brand-blue {
    color: #0057F6;
    text-shadow: 0 0 12px rgba(0, 87, 246, 0.6);
}

.side-menu-back {
    position: absolute;
    left: 1.5rem;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.side-menu-back:hover {
    color: #ffffff;
    background: rgba(0, 87, 246, 0.1);
    transform: translateX(-2px);
}

/* Side Menu Content */
.side-menu-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar while keeping scroll functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
.side-menu-content::-webkit-scrollbar {
    display: none;
}

/* User Profile Section */
.user-profile-section {
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

/* Add glow effect from top for user profile area */
.user-profile-section::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -20px;
    right: -20px;
    height: 180px; /* Extended down further */
    background: 
        radial-gradient(ellipse 100% 70% at center 0%, 
            rgba(0, 87, 246, 0.8) 0%, /* Much stronger glow */
            rgba(0, 87, 246, 0.6) 20%, /* Much stronger glow */
            rgba(0, 87, 246, 0.4) 40%, /* Much stronger glow */
            rgba(0, 87, 246, 0.25) 60%, /* Much stronger glow */
            rgba(0, 87, 246, 0.1) 80%, 
            transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0057F6, #00D4FF);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    z-index: 2; /* Above the glow effect */
}

.user-avatar .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Avatar Loading Animation */
.user-avatar.avatar-loading {
    background: linear-gradient(135deg, #2a2a4a, #1e2235);
}

.avatar-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0057F6;
    font-size: 1.2rem;
    z-index: 2;
}

.avatar-loading-spinner i {
    animation: avatarSpinLoad 1s linear infinite;
}

@keyframes avatarSpinLoad {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth fade-in for loaded images */
.user-avatar .avatar-image {
    transition: opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.avatar-edit-btn {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%) translateX(15px);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0057F6;
    border: 2px solid #1a1a2e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
    z-index: 2;
}

.avatar-edit-btn:hover {
    background: #0288D1;
    transform: translateX(-50%) translateX(15px) scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 87, 246, 0.4);
}

.user-name {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2; /* Above the glow effect */
}

.user-email {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.25rem; /* Closer to username */
    position: relative;
    z-index: 2; /* Above the glow effect */
}

/* Premium Status Section */
.premium-status-section {
    margin-top: 1rem; /* Space between email and premium section */
    text-align: center;
}

.crown-icon-container {
    margin-bottom: 0.5rem; /* Space between crown and text */
}

.premium-crown-icon {
    color: #FFD700;
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.premium-text {
    color: #0057F6;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 87, 246, 0.5);
}

/* Subscription details */
.subscription-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Compact subscription dropdown */
.subscription-dropdown {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
}

.subscription-compact {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 16px 8px 16px;
    border-left: 3px solid #4FC3F7;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    animation: slideDown 0.2s ease;
}

.subscription-date-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    gap: 8px;
    font-weight: 600; /* Make all text in date items bold */
}

.subscription-date-item i {
    color: #4FC3F7;
    font-size: 12px;
    width: 16px;
    flex-shrink: 0;
}

.subscription-date-item span {
    color: white;
    font-weight: 600; /* Increased from 500 to 600 for more boldness */
}

/* Ensure consistent label width for proper colon alignment */
.subscription-label {
    display: inline-block;
    min-width: 85px; /* Adjust this value to ensure proper alignment */
    text-align: left;
}

/* Dropdown manage subscription button */
.dropdown-manage-btn {
    width: 100%;
    background: linear-gradient(135deg, #4FC3F7, #0288D1);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px; /* Ensure consistent height during loading */
}

.dropdown-manage-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0288D1, #0277BD);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.dropdown-manage-btn:disabled {
    opacity: 0.8;
    transform: none;
    cursor: not-allowed;
}

.dropdown-manage-btn.loading {
    background: linear-gradient(135deg, #90A4AE, #78909C);
    cursor: wait;
}

.dropdown-manage-btn.loading:hover {
    transform: none;
    box-shadow: none;
}

.dropdown-manage-btn i {
    font-size: 11px;
}

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

/* Mobile responsiveness for compact dropdown */
@media (max-width: 350px) {
    .subscription-compact {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .subscription-date-item {
        justify-content: center;
    }
}

.subscription-details h5 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
}

.subscription-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.subscription-info:last-of-type {
    margin-bottom: 0;
}

.subscription-info span:first-child {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.subscription-info span:last-child {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

/* Menu Items */
.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-item-link, .menu-item-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #ffffff;
    text-decoration: none;
    border: none;
    background: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
}

.menu-item-link:hover, .menu-item-btn:hover {
    background-color: rgba(0, 87, 246, 0.1);
    color: #0057F6;
    text-decoration: none;
}

.menu-item-icon {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

/* Specific icon colors */
.menu-item-icon.info-icon {
    /* Hide the FontAwesome icon */
    font-size: 0 !important;
    position: relative;
    margin-right: 0.75rem !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-block;
}

.menu-item-icon.info-icon::before {
    /* Create custom black circle with white "i" */
    content: 'i';
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    background-color: #000000;
    border-radius: 50%;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: serif; /* Use serif for a more traditional "i" look */
}

.menu-item-icon.streamers-icon {
    color: #0057F6 !important; /* Blue */
    margin-right: 0.75rem !important;
    width: 16px !important;
}

.menu-item-icon.earning-icon {
    color: #28a745 !important; /* Green */
    margin-right: 0.75rem !important;
    width: 16px !important;
}

.menu-item-icon.trophy-icon {
    color: #ffc107 !important; /* Yellow/Gold like a trophy */
    margin-right: 0.75rem !important;
    width: 16px !important;
}

/* Login Section */
.login-section {
    text-align: center;
    margin-bottom: 2rem;
}

/* Login Button in Menu */
.menu-login-btn {
    background: linear-gradient(135deg, #4FC3F7, #0288D1);
    color: white;
    font-weight: 600;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    cursor: pointer;
}

.menu-login-btn:hover {
    background: linear-gradient(135deg, #0288D1, #0277BD);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
    color: white;
}

.menu-login-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.25);
}

/* Subscribe Button in Menu */
.menu-subscribe-btn {
    background: linear-gradient(135deg, #4FC3F7, #0288D1);
    color: white;
    font-weight: 600;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px; /* Ensure consistent height during loading */
}

.menu-subscribe-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0288D1, #0277BD);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
    color: white;
}

.menu-subscribe-btn:disabled {
    opacity: 0.8;
    transform: none;
    cursor: not-allowed;
}

.menu-subscribe-btn.loading {
    background: linear-gradient(135deg, #90A4AE, #78909C);
    cursor: wait;
}

.menu-subscribe-btn.loading:hover {
    transform: none;
    box-shadow: none;
}

/* Custom spinner styling for the subscribe button */
.menu-subscribe-btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Crown Icon */
.crown-icon {
    margin-right: 0.5rem;
}

/* Divider */
.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

/* Page Dimming Effect - Menu overlays without affecting scroll */
body.side-menu-open {
    /* Prevent background page scrolling while menu is open */
    overflow: hidden;
    /* Allow natural positioning - menu overlays on top */
    position: relative;
}

/* PC only: Add padding to compensate for hidden scrollbar when menu is open */
@media (min-width: 769px) {
    body.side-menu-open {
        /* Add padding to compensate for scrollbar width (typically 12-17px) */
        padding-right: 15px;
    }
}

/* Normal scrollbar behavior maintained when menu is open */

body.side-menu-open .streams-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9997;
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .side-menu {
        width: 100%;
        right: -100%;
    }
    
    .side-menu.active {
        right: 0;
    }
    
    /* Mobile optimizations for profile photo modal */
    #profilePhotoModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    #profilePhotoModal .modal-content {
        border-radius: 1rem;
    }
    
    #profilePhotoModal .modal-header {
        padding: 1rem 1.5rem 0.5rem;
        border-bottom: none;
    }
    
    #profilePhotoModal .modal-body {
        padding: 1rem 1.5rem;
    }
    
    /* Mobile-optimized button layout */
    #profilePhotoModal .modal-footer {
        padding: 1rem 1.5rem 1.5rem;
        border-top: none;
        gap: 0.75rem;
        flex-direction: column;
    }
    
    #profilePhotoModal .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 0.5rem;
        min-height: 48px; /* Touch-friendly minimum */
    }
    
    /* Primary button (Upload) styling */
    #profilePhotoModal .btn-primary {
        order: 1;
        background: linear-gradient(135deg, #0057F6, #00D4FF);
        border: none;
        box-shadow: 0 4px 12px rgba(0, 87, 246, 0.3);
        transition: all 0.2s ease;
    }
    
    #profilePhotoModal .btn-primary:hover,
    #profilePhotoModal .btn-primary:active {
        background: linear-gradient(135deg, #0048D1, #00B8E6);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 87, 246, 0.4);
    }
    
    /* Danger button (Remove) styling */
    #profilePhotoModal .btn-outline-danger {
        order: 2;
        background: rgba(220, 53, 69, 0.1);
        border: 2px solid rgba(220, 53, 69, 0.3);
        color: #dc3545;
        transition: all 0.2s ease;
    }
    
    #profilePhotoModal .btn-outline-danger:hover,
    #profilePhotoModal .btn-outline-danger:active {
        background: rgba(220, 53, 69, 0.2);
        border-color: #dc3545;
        color: #dc3545;
        transform: translateY(-1px);
    }
    
    /* Secondary button (Cancel) styling */
    #profilePhotoModal .btn-secondary {
        order: 3;
        background: rgba(108, 117, 125, 0.2);
        border: 2px solid rgba(108, 117, 125, 0.3);
        color: #6c757d;
        transition: all 0.2s ease;
    }
    
    #profilePhotoModal .btn-secondary:hover,
    #profilePhotoModal .btn-secondary:active {
        background: rgba(108, 117, 125, 0.3);
        border-color: #6c757d;
        color: #6c757d;
        transform: translateY(-1px);
    }
    
    /* File input styling for mobile */
    #profilePhotoModal .form-control {
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.2);
        color: white;
        min-height: 48px;
    }
    
    #profilePhotoModal .form-control:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: #0057F6;
        box-shadow: 0 0 0 0.2rem rgba(0, 87, 246, 0.25);
    }
    
    /* Custom file input styling */
    .custom-file-input-wrapper {
        position: relative;
        display: block;
    }
    
    .custom-file-input {
        position: absolute;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        z-index: 2;
    }
    
    .custom-file-label {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, #0057F6, #00D4FF);
        border: none;
        border-radius: 0.5rem;
        color: white;
        font-weight: 600;
        font-size: 1rem;
        min-height: 48px;
        cursor: pointer;
        transition: all 0.2s ease;
        margin: 0;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 87, 246, 0.3);
    }
    
    .custom-file-label:hover {
        background: linear-gradient(135deg, #0048D1, #00B8E6);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 87, 246, 0.4);
        color: white;
    }
    
    .custom-file-input:focus + .custom-file-label {
        outline: 2px solid #0057F6;
        outline-offset: 2px;
    }
    
    /* Modal action buttons animation */
    .modal-action-buttons {
        animation: slideInUp 0.3s ease-out;
        pointer-events: auto !important;
        z-index: 10;
        position: relative;
    }
    
    .modal-action-buttons .btn {
        pointer-events: auto !important;
        cursor: pointer !important;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Ensure buttons are clickable */
    #uploadBtn, #deletePhotoBtn {
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 11;
        position: relative;
        transition: all 0.3s ease;
    }
    
    #uploadBtn:hover, #deletePhotoBtn:hover {
        pointer-events: auto !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    /* Upload button state transitions */
    #uploadBtn {
        transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    }

    /* Image Editor Styles - Ultra Compact for Mobile */
    .main-preview-container {
        position: relative;
        padding: 2px 10px 0px; /* Even tighter - almost no top/bottom padding */
        text-align: center;
    }

    .main-preview-circle {
        border: 2px solid #007bff; /* Thinner border */
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* Minimal shadow */
        cursor: grab;
        display: block;
        margin: 0 auto;
        width: 120px !important; /* Much smaller - 120px instead of 150px */
        height: 120px !important;
    }

    .main-preview-circle:active {
        cursor: grabbing;
    }

    /* Very compact instructions text */
    .main-preview-container p {
        font-size: 11px !important; /* Even smaller text */
        margin-top: 2px !important; /* Minimal gap after preview */
        margin-bottom: 0 !important;
        color: #6c757d;
        line-height: 1.2;
    }

    .editor-controls {
        padding: 0; /* Remove all padding */
        margin-top: 2px; /* Bring zoom controls much closer to instructions */
    }

    .zoom-control {
        margin-bottom: 4px !important; /* Minimal gap below zoom control */
    }

    .zoom-control label {
        color: #6c757d;
        font-weight: 500;
        font-size: 12px; /* Smaller label */
        margin-bottom: 2px; /* Minimal gap between label and slider */
        display: block;
    }

    .form-range {
        height: 4px; /* Thinner slider */
        margin: 2px 0; /* Minimal margin around slider */
    }

    .form-range::-webkit-slider-thumb {
        width: 14px; /* Smaller thumb */
        height: 14px;
        background: #007bff;
        border-radius: 50%;
        border: none;
        box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }

    .editor-actions {
        margin-top: 4px; /* Bring buttons much closer to zoom control */
        gap: 8px;
    }

    .editor-actions .btn {
        padding: 6px 12px; /* More compact buttons */
        font-size: 13px;
        min-height: 36px; /* Smaller height */
        border-radius: 6px;
    }

    /* Make the entire modal more compact on mobile */
    #profilePhotoModal .modal-body {
        padding: 0.4rem 0.8rem !important; /* Further reduced modal padding */
    }

    #profilePhotoModal .modal-header {
        padding: 0.5rem 1rem 0.2rem !important; /* Even smaller header */
    }

    /* Compact the "Adjust Your Photo" section */
    #imageEditor h6 {
        font-size: 13px !important; /* Smaller title */
        margin-bottom: 2px !important; /* Bring title even closer to preview */
        color: #ffffff;
    }

    /* Reduce spacing around file input */
    .custom-file-input-wrapper {
        margin-bottom: 4px !important; /* Much smaller gap */
    }

    /* Compact the current avatar preview */
    .current-avatar-preview {
        margin-bottom: 4px !important; /* Smaller gap */
    }

    .user-avatar-large {
        width: 70px !important; /* Even smaller current avatar preview */
        height: 70px !important;
        font-size: 1.6rem !important;
    }

    /* More compact action buttons */
    .modal-action-buttons {
        margin-top: 4px !important; /* Bring buttons closer */
    }

    .modal-action-buttons .d-flex {
        gap: 6px !important; /* Smaller gap between buttons */
    }

    .modal-cancel-section {
        margin-top: 4px !important; /* Minimal spacing */
        padding-top: 4px !important;
    }

    /* Make form sections more compact */
    #profilePhotoModal .mb-3 {
        margin-bottom: 0.5rem !important; /* Reduce form section spacing */
    }

    /* Compact file input styling */
    .custom-file-label {
        padding: 6px 12px !important; /* Smaller button padding */
        font-size: 13px !important; /* Smaller text */
        min-height: 34px !important; /* Smaller button height */
    }

    /* Make the form text smaller and closer */
    .form-text {
        font-size: 10px !important; /* Very small help text */
        margin-top: 2px !important; /* Closer to input */
    }

/* Fix grey text in photo upload modal to be white */
#profilePhotoModal .form-text,
#profilePhotoModal .text-muted,
#profilePhotoModal small,
#profilePhotoModal .small,
#profilePhotoModal p:not(.btn):not(.alert),
#profilePhotoModal .modal-body > div:not(.btn):not(.alert) {
    color: #ffffff !important;
}

/* Specifically target common descriptive text elements */
#profilePhotoModal .modal-body small,
#profilePhotoModal .modal-body .form-text,
#profilePhotoModal .modal-body p {
    color: #ffffff !important;
}
    
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Cancel section styling */
    .modal-cancel-section {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
        margin-top: 1.5rem;
    }
    
    /* Avatar preview adjustments for mobile */
    .user-avatar-large {
        width: 120px;
        height: 120px;
        font-size: 2.5rem;
    }
    
    .preview-avatar {
        width: 100px;
        height: 100px;
    }
    
    /* Mobile Navbar Optimizations */
    .navbar-greeting {
        font-size: 0.75rem !important;
        margin-right: 0.5rem !important;
        display: inline-flex !important;
        align-items: center !important;
        vertical-align: middle !important;
        line-height: 1 !important;
    }
    
    .navbar-brand .brand-text {
        font-size: 1.7rem !important;
        line-height: 1.1 !important;
    }
    
    .navbar-brand {
        display: flex !important;
        align-items: center !important;
        height: auto !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    
    .fas.fa-crown {
        font-size: 0.9rem !important;
        margin-right: 0.5rem !important;
        display: inline-flex !important;
        align-items: center !important;
        vertical-align: middle !important;
        line-height: 1 !important;
    }
    
    .hamburger-menu-btn {
        padding: 0.4rem !important;
        width: 36px !important;
        height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Ensure auth buttons container maintains proper alignment on mobile */
    .auth-buttons {
        display: flex !important;
        align-items: center !important;
        gap: 0.25rem !important;
        height: 100% !important;
    }
    
    .hamburger-icon {
        width: 16px !important;
        height: 12px !important;
    }
    
    .hamburger-icon span {
        height: 2px !important;
        margin-bottom: 1px !important;
        background-color: #ffffff !important;
        box-shadow: 
            0 0 3px rgba(255, 255, 255, 0.4),
            0 0 6px rgba(255, 255, 255, 0.2) !important;
    }
}

/* Extra Mobile Optimizations for smaller screens */
@media (max-width: 480px) {
    .navbar-greeting {
        font-size: 0.7rem !important;
        margin-right: 0.4rem !important;
    }
    
    .navbar-brand .brand-text {
        font-size: 1.5rem !important;
    }
    
    .fas.fa-crown {
        font-size: 0.8rem !important;
        margin-right: 0.4rem !important;
    }
    
    .hamburger-menu-btn {
        padding: 0.3rem !important;
        width: 32px !important;
        height: 32px !important;
    }
    
    .hamburger-icon {
        width: 14px !important;
        height: 10px !important;
    }
    
    /* Ensure navbar container uses all available space efficiently */
    .navbar .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .navbar .navbar-nav.ms-auto {
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
    }
}

/* Smooth animations for menu items */
.menu-items {
    animation: fadeInUp 0.25s ease 0.05s both;
}

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

/* Loading state for buttons */
.menu-item-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.menu-item-btn.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Profile Photo Modal Styles */
.current-avatar-preview {
    margin-bottom: 1rem;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0057F6, #00D4FF);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: white;
    font-weight: bold;
    overflow: hidden;
}

.user-avatar-large .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.upload-preview {
    text-align: center;
    margin: 1rem 0;
}

.preview-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #0057F6;
}

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

/* File input styling */
.form-control:focus {
    border-color: #0057F6;
    box-shadow: 0 0 0 0.2rem rgba(0, 87, 246, 0.25);
}

/* Custom file input styling */
.custom-file-input-wrapper {
    position: relative;
    display: block;
}

.custom-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.custom-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0057F6, #00D4FF);
    border: none;
    border-radius: 0.375rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    text-align: center;
    min-height: 40px;
}

.custom-file-label:hover {
    background: linear-gradient(135deg, #0048D1, #00B8E6);
    transform: translateY(-1px);
    color: white;
}

.custom-file-input:focus + .custom-file-label {
    outline: 2px solid #0057F6;
    outline-offset: 2px;
}

/* Modal action buttons */
.modal-action-buttons {
    transition: all 0.3s ease;
}

/* Cancel section styling */
.modal-cancel-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Modal styling overrides */
.modal-content.bg-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1b2b 100%) !important;
    border: 1px solid rgba(0, 87, 246, 0.2);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Upload status styling */
#uploadStatus .alert {
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Button styling in modal */
.modal .btn-primary {
    background: linear-gradient(135deg, #0057F6, #0288D1);
    border: none;
}

.modal .btn-primary:hover {
    background: linear-gradient(135deg, #0288D1, #0277BD);
    transform: translateY(-1px);
}

.modal .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.modal .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Profile Photo Modal - Ensure it appears above side menu */
#profilePhotoModal {
    z-index: 10000 !important;
}

#profilePhotoModal .modal-backdrop {
    z-index: 9999 !important;
}

/* Avatar edit button styling */
.avatar-edit-btn {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #0057F6;
    border: 2px solid #1a1a2e;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-edit-btn:hover {
    background: #0288D1;
    transform: scale(1.1);
}

/* User avatar container positioning for edit button */
.user-avatar {
    position: relative;
    cursor: pointer;
}

/* Menu Item Entrance Animations */
.side-menu.active .menu-item {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInFromLeft 0.4s ease forwards;
}

/* Staggered entrance animations for each menu item */
.side-menu.active .menu-item:nth-child(1) { animation-delay: 0.1s; }
.side-menu.active .menu-item:nth-child(2) { animation-delay: 0.2s; }
.side-menu.active .menu-item:nth-child(3) { animation-delay: 0.3s; }
.side-menu.active .menu-item:nth-child(4) { animation-delay: 0.4s; }
.side-menu.active .menu-item:nth-child(5) { animation-delay: 0.5s; }
.side-menu.active .menu-item:nth-child(6) { animation-delay: 0.6s; }

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