/* Admin Header Buttons */
.admin-header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Refresh Button Styles */
.refresh-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn i {
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

/* Debug Button Styles */
.debug-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.debug-btn:hover {
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Thumbnail Generation Button */
.debug-btn:nth-of-type(2) {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.debug-btn:nth-of-type(2):hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}
:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --text-primary: #333;
    --text-secondary: #666;
    --text-inverse: white;
    --border-color: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.1);
    --modal-bg: white;
    --card-bg: rgba(255, 255, 255, 0.95);
    --input-bg: #f8f9fa;
    --button-primary: linear-gradient(45deg, #667eea, #764ba2);
    --button-secondary: linear-gradient(45deg, #ff6b6b, #ee5a24);
    --accent-color: #667eea;
    --accent-glow: rgba(102, 126, 234, 0.2);
    --progress-bg: #e9ecef;
    --progress-fill: linear-gradient(45deg, #667eea, #764ba2);
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --bg-secondary: rgba(20, 20, 35, 0.95);
    --text-primary: #f0f0f0;
    --text-secondary: #c0c0c0;
    --text-inverse: #0f0f23;
    --border-color: #3a3a4e;
    --shadow: rgba(0, 0, 0, 0.5);
    --modal-bg: #1e1e2e;
    --card-bg: rgba(25, 25, 40, 0.95);
    --input-bg: #2a2a3e;
    --button-primary: linear-gradient(45deg, #667eea, #764ba2);
    --button-secondary: linear-gradient(45deg, #ff6b6b, #ee5a24);
    --accent-color: #667eea;
    --accent-glow: rgba(102, 126, 234, 0.3);
    --progress-bg: #3a3a4e;
    --progress-fill: linear-gradient(45deg, #667eea, #764ba2);
}

/* Floating Grid Settings */
.floating-grid-settings {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.grid-settings-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--button-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--shadow);
}

.grid-settings-popup {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 300px;
    background: var(--modal-bg);
    border-radius: 15px;
    box-shadow: 0 10px 40px var(--shadow);
    border: 1px solid var(--border-color);
    animation: slideInUp 0.3s ease;
}

.grid-settings-popup.hidden {
    display: none;
}

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

.popup-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.popup-content {
    padding: 1.5rem;
}

.grid-option {
    margin-bottom: 1.5rem;
}

.grid-option label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.grid-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.grid-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.grid-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.grid-preview {
    margin-top: 1rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: var(--input-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.preview-item {
    height: 30px;
    background: var(--accent-color);
    border-radius: 5px;
    opacity: 0.7;
}

/* Responsive floating grid settings */
@media (max-width: 768px) {
    .floating-grid-settings {
        bottom: 15px;
        right: 15px;
    }
    
    .grid-settings-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .grid-settings-popup {
        width: 280px;
        bottom: 65px;
    }
    
    .popup-content {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .floating-grid-settings {
        bottom: 10px;
        right: 10px;
    }
    
    .grid-settings-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .grid-settings-popup {
        width: 260px;
        bottom: 60px;
        right: -10px;
    }
    
    .popup-content {
        padding: 1rem;
    }
    
    .grid-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}
/* Reset and Base Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
    min-height: 100vh;
    /* Prevent white flash on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Prevent scroll bouncing on iOS */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: all 0.3s ease;
    /* Prevent white edges on mobile */
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Prevent white flash on refresh */
    background-attachment: fixed;
    /* PWA scroll behavior */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    /* Prevent scroll bouncing */
    position: relative;
}

/* Navigation - Always Visible */
.navbar {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    padding: 1.2rem 0;
    box-shadow: 0 4px 30px var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    /* PWA Safe Area Support */
    padding-top: calc(1.2rem + env(safe-area-inset-top));
    padding-left: calc(0px + env(safe-area-inset-left));
    padding-right: calc(0px + env(safe-area-inset-right));
}

/* Section Header Styles - Always Visible */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    /* PWA Safe Area Support */
    padding-top: calc(6rem + env(safe-area-inset-top));
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
}

/* Section header hide/show styles removed - always visible */

/* Navbar hide/show styles removed - navbar is always visible */

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

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

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

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

.nav-icon svg {
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
}

.nav-title {
    font-size: 2rem;
    font-weight: 800;
    background: var(--button-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: -0.5px;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 30px;
    background: var(--button-primary);
    color: var(--text-inverse);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.nav-btn.active {
    background: var(--button-secondary);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

.nav-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;
}

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

.admin-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white !important;
    border: 2px solid #ff4757 !important;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #ff5252, #d63031) !important;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.theme-toggle {
    padding: 0.7rem;
    border: none;
    border-radius: 50%;
    background: var(--button-primary);
    color: var(--text-inverse);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.theme-toggle:hover {
    transform: translateY(-3px) scale(1.15) rotate(15deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover::before {
    opacity: 1;
}

.language-toggle {
    padding: 0.7rem;
    border: none;
    border-radius: 50%;
    background: var(--button-primary);
    color: var(--text-inverse);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.language-toggle:hover {
    transform: translateY(-3px) scale(1.15) rotate(-15deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.language-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-toggle:hover::before {
    opacity: 1;
}

/* Settings Dropdown */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-toggle {
    padding: 0.7rem;
    border: none;
    border-radius: 50%;
    background: var(--button-primary);
    color: var(--text-inverse);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.settings-toggle:hover {
    transform: translateY(-3px) scale(1.15) rotate(15deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.settings-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-toggle:hover::before {
    opacity: 1;
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow);
    min-width: 160px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.settings-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-item {
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border-radius: 0;
    text-align: left;
}

.settings-item:first-child {
    border-radius: 12px 12px 0 0;
}

.settings-item:last-child {
    border-radius: 0 0 12px 12px;
}

.settings-item:hover {
    background: var(--input-bg);
    color: var(--accent-color);
}

.settings-item.admin-btn:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff6b6b !important;
}

/* Admin Panel - Hidden by default, shown only as full page */
.admin-panel {
    display: none;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    padding: 2rem;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    overflow-y: auto;
    /* PWA Safe Area Support */
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

/* Admin Panel as Full Page - Show when active */
.admin-panel.full-page {
    display: block !important;
}

/* Desktop Admin Panel Enhancements */
@media (min-width: 769px) {
    .admin-panel.full-page {
        background: var(--bg-primary) !important;
        border: none !important;
        box-shadow: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 2rem !important;
    }
    
    .admin-panel.full-page .admin-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    .admin-panel.full-page .admin-header {
        background: var(--bg-secondary);
        border-radius: 1rem;
        padding: 1.5rem;
        margin-bottom: 2rem;
        box-shadow: 0 4px 20px var(--shadow);
    }
    
    .admin-panel.full-page .admin-tabs {
        background: var(--bg-secondary);
        border-radius: 1rem;
        padding: 1rem;
        margin-bottom: 2rem;
        box-shadow: 0 2px 10px var(--shadow);
    }
    
    .admin-panel.full-page .admin-tab-content {
        background: var(--bg-secondary);
        border-radius: 1rem;
        padding: 2rem;
        box-shadow: 0 2px 10px var(--shadow);
    }
}

/* Mobile Admin Panel Enhancements */
@media (max-width: 768px) {
    .admin-panel.full-page {
        background: var(--bg-primary) !important;
        border: none !important;
        box-shadow: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 1rem !important;
        /* PWA Safe Area Support */
        padding-top: calc(1rem + env(safe-area-inset-top)) !important;
        padding-left: calc(1rem + env(safe-area-inset-left)) !important;
        padding-right: calc(1rem + env(safe-area-inset-right)) !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    }
}

.admin-panel.hidden {
    display: none !important;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

/* Admin Exit Button */
.admin-exit-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    position: relative;
}

.admin-exit-btn:hover {
    background: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.admin-exit-btn i {
    font-size: 1rem;
}

/* Desktop keyboard shortcut hint */
@media (min-width: 769px) {
    .admin-exit-btn::after {
        content: "ESC";
        position: absolute;
        top: -8px;
        right: -8px;
        background: var(--text-secondary);
        color: var(--bg-primary);
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 500;
    }
}

/* Admin Status Display */
.admin-status {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--success-color);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    transition: all 0.3s ease;
}

.admin-status.error {
    background: var(--danger-color);
    border-left-color: var(--danger-color);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.admin-status.warning {
    background: var(--warning-color);
    border-left-color: var(--warning-color);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.admin-status.info {
    background: var(--info-color);
    border-left-color: var(--info-color);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

.admin-status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.admin-status-content i {
    font-size: 1.1rem;
}

.admin-status.hidden {
    display: none;
}

.admin-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--button-secondary);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.cancel-btn {
    padding: 0.8rem 1.5rem;
    background: var(--button-secondary);
    color: var(--text-inverse);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.save-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Login Modal */
.login-modal {
    max-width: 400px;
    width: 90%;
}

.login-container {
    padding: 2rem;
    text-align: center;
}

.login-container h2 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-btn {
    padding: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.upload-form {
    background: var(--input-bg);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--modal-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.upload-btn {
    width: 100%;
    padding: 1rem;
    background: var(--button-primary);
    color: var(--text-inverse);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #764ba2, #667eea);
}

/* Gallery Sections - Fixed Spacing */
.gallery-section {
    display: none;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: calc(6rem + env(safe-area-inset-top)); /* Fixed space for navbar and safe area */
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
    padding-bottom: calc(4rem + env(safe-area-inset-bottom)); /* Extra space at bottom for different devices */
    min-height: calc(100vh - 6rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.gallery-section.active {
    display: block;
}

/* Gallery section navbar state styles removed - fixed spacing */

/* Section header styles are now defined above with hide/show functionality */

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

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

.gallery-item {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 25px 50px var(--shadow);
    border-color: var(--accent-color);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--input-bg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Dynamic sizing based on grid columns */
.gallery-grid[style*="repeat(2,"] .gallery-item img {
    height: 250px;
}

.gallery-grid[style*="repeat(3,"] .gallery-item img {
    height: 200px;
}

.gallery-grid[style*="repeat(4,"] .gallery-item img {
    height: 180px;
}

.gallery-grid[style*="repeat(5,"] .gallery-item img {
    height: 160px;
}

.gallery-grid[style*="repeat(6,"] .gallery-item img {
    height: 140px;
}

.gallery-grid[style*="repeat(7,"] .gallery-item img {
    height: 130px;
}

.gallery-grid[style*="repeat(8,"] .gallery-item img {
    height: 120px;
}

/* Phone wallpapers - different aspect ratio */
.gallery-item.phone-wallpaper img {
    height: 300px;
    object-fit: contain;
    background: var(--input-bg);
}

/* Dynamic sizing for phone wallpapers */
.gallery-grid[style*="repeat(2,"] .gallery-item.phone-wallpaper img {
    height: 300px;
}

.gallery-grid[style*="repeat(3,"] .gallery-item.phone-wallpaper img {
    height: 200px;
}

.gallery-grid[style*="repeat(4,"] .gallery-item.phone-wallpaper img {
    height: 150px;
}

.gallery-grid[style*="repeat(5,"] .gallery-item.phone-wallpaper img {
    height: 120px;
}

.gallery-grid[style*="repeat(6,"] .gallery-item.phone-wallpaper img {
    height: 100px;
}

.gallery-grid[style*="repeat(7,"] .gallery-item.phone-wallpaper img {
    height: 90px;
}

.gallery-grid[style*="repeat(8,"] .gallery-item.phone-wallpaper img {
    height: 80px;
}

/* Full size image overlay */
.full-size-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    /* PWA Safe Area Support */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

.full-size-overlay.active {
    opacity: 1;
    visibility: visible;
}

.full-size-image {
    max-width: calc(100% - 2rem);
    max-height: calc(100% - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    /* Ensure image is centered */
    display: block;
    margin: auto;
    flex-shrink: 0;
}

.full-size-overlay.active .full-size-image {
    transform: scale(1);
}

.full-size-close {
    position: absolute;
    top: calc(2rem + env(safe-area-inset-top));
    right: calc(2rem + env(safe-area-inset-right));
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1001;
}

.full-size-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.full-size-info {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001;
    margin-top: 1rem;
    width: calc(100% - 4rem);
    max-width: 500px;
    flex-shrink: 0;
}

.full-size-overlay.active .full-size-info {
    opacity: 1;
}

.full-size-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.full-size-info p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.full-size-info .download-btn {
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    background: var(--button-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.full-size-info .download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.full-size-info .download-btn i {
    margin-right: 0.5rem;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-info {
    padding: 1.5rem;
}

.gallery-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.gallery-item-category {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-item-filesize {
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.3rem;
}

/* Admin Gallery */
.admin-gallery {
    margin-top: 2rem;
}

.admin-gallery h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-gallery-item {
    background: var(--modal-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    position: relative;
}

.admin-gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* Dynamic sizing for admin gallery */
.admin-gallery-grid[style*="repeat(2,"] .admin-gallery-item img {
    height: 120px;
}

.admin-gallery-grid[style*="repeat(3,"] .admin-gallery-item img {
    height: 100px;
}

.admin-gallery-grid[style*="repeat(4,"] .admin-gallery-item img {
    height: 80px;
}

.admin-gallery-grid[style*="repeat(5,"] .admin-gallery-item img {
    height: 70px;
}

.admin-gallery-grid[style*="repeat(6,"] .admin-gallery-item img {
    height: 60px;
}

.admin-gallery-grid[style*="repeat(7,"] .admin-gallery-item img {
    height: 55px;
}

.admin-gallery-grid[style*="repeat(8,"] .admin-gallery-item img {
    height: 50px;
}

.admin-gallery-item-info {
    padding: 1rem;
}

.admin-gallery-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.admin-gallery-item-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: white;
    border: 2px solid #ff4757;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    z-index: 10;
}

.delete-btn:hover {
    background: linear-gradient(45deg, #ff3742, #ff4757);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

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

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

.modal.hidden {
    display: none;
}

.modal-content {
    max-width: 95%;
    max-height: 95%;
    background: var(--modal-bg);
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 1.5rem 2rem;
    background: var(--modal-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 2001;
    background: var(--input-bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.close:hover {
    background: var(--button-secondary);
    color: var(--text-inverse);
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--input-bg);
    overflow: hidden;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.modal-body img:hover {
    transform: scale(1.02);
}

.modal-footer {
    padding: 2rem;
    text-align: center;
    background: var(--modal-bg);
    border-top: 1px solid var(--border-color);
}

.download-btn {
    padding: 1.2rem 3rem;
    background: var(--button-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 35px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.download-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.download-btn:active {
    transform: translateY(-2px) scale(1.02);
}

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

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

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .full-size-image {
        max-width: 95%;
        max-height: 85%;
    }

    .full-size-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .full-size-info {
        bottom: 1rem;
        padding: 0.8rem 1.5rem;
    }

    .full-size-info h3 {
        font-size: 1rem;
    }

    .full-size-info p {
        font-size: 0.8rem;
    }

    .full-size-info .download-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .full-size-image {
        max-width: 98%;
        max-height: 80%;
    }

    .full-size-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .full-size-info {
        bottom: 0.5rem;
        padding: 0.6rem 1rem;
    }

    .full-size-info h3 {
        font-size: 0.9rem;
    }

    .full-size-info p {
        font-size: 0.7rem;
    }

    .full-size-info .download-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .category-filters {
        padding: 1.5rem 1rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* Mobile admin panel styles removed - admin panel is now always full-page */

    .upload-form {
        padding: 1rem;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        max-width: 98%;
        max-height: 98%;
        border-radius: 15px;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

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

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1.5rem;
    }

    .download-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

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

    .section-header h2 {
        font-size: 1.8rem;
    }
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 10px 10px 0 0;
    padding: 0.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.admin-tab {
    padding: 1rem 2rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
    margin-right: 0.5rem;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow);
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.admin-tab.active {
    color: var(--text-inverse);
    background: var(--button-primary);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.admin-tab-content {
    display: none;
    padding: 1rem 0;
    min-height: 200px;
}

.admin-tab-content.active {
    display: block;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    background: var(--input-bg);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    text-align: left;
}

.image-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow);
}

.preview-info {
    flex: 1;
}

.preview-info h4 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    word-break: break-all;
}

.preview-info p {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.change-image-btn {
    padding: 0.6rem 1.2rem;
    background: var(--button-secondary);
    color: var(--text-inverse);
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.change-image-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.change-image-btn i {
    margin-right: 0.5rem;
}

/* Public Upload Styles */
.public-upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.upload-info {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.upload-info h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.upload-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upload-info li {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.upload-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Approve Header */
.approve-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.approve-header h3 {
    margin: 0;
    color: var(--text-primary);
}

/* Refresh Pending Button */
.refresh-pending-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-pending-btn:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.refresh-pending-btn:active {
    transform: translateY(0);
}

.refresh-pending-btn i {
    transition: transform 0.3s ease;
}

.refresh-pending-btn:hover i {
    transform: rotate(180deg);
}

/* Approval Stats */
.approval-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Pending Gallery Container */
#pendingGallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Pending Gallery Items */
.pending-gallery-item {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pending-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-color);
}

.pending-gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: var(--input-bg);
    border-radius: 10px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Dynamic sizing for pending gallery */
#pendingGallery[style*="repeat(2,"] .pending-gallery-item img {
    height: 300px;
}

#pendingGallery[style*="repeat(3,"] .pending-gallery-item img {
    height: 200px;
}

#pendingGallery[style*="repeat(4,"] .pending-gallery-item img {
    height: 150px;
}

#pendingGallery[style*="repeat(5,"] .pending-gallery-item img {
    height: 120px;
}

#pendingGallery[style*="repeat(6,"] .pending-gallery-item img {
    height: 100px;
}

#pendingGallery[style*="repeat(7,"] .pending-gallery-item img {
    height: 90px;
}

#pendingGallery[style*="repeat(8,"] .pending-gallery-item img {
    height: 80px;
}

/* Desktop wallpapers - wider aspect ratio */
.pending-gallery-item.desktop-wallpaper img {
    height: 250px;
    object-fit: contain;
}

/* Dynamic sizing for desktop wallpapers in pending */
#pendingGallery[style*="repeat(2,"] .pending-gallery-item.desktop-wallpaper img {
    height: 250px;
}

#pendingGallery[style*="repeat(3,"] .pending-gallery-item.desktop-wallpaper img {
    height: 180px;
}

#pendingGallery[style*="repeat(4,"] .pending-gallery-item.desktop-wallpaper img {
    height: 140px;
}

#pendingGallery[style*="repeat(5,"] .pending-gallery-item.desktop-wallpaper img {
    height: 110px;
}

#pendingGallery[style*="repeat(6,"] .pending-gallery-item.desktop-wallpaper img {
    height: 95px;
}

#pendingGallery[style*="repeat(7,"] .pending-gallery-item.desktop-wallpaper img {
    height: 85px;
}

#pendingGallery[style*="repeat(8,"] .pending-gallery-item.desktop-wallpaper img {
    height: 75px;
}

/* Phone wallpapers - taller aspect ratio */  
.pending-gallery-item.phone-wallpaper img {
    height: 350px;
    object-fit: contain;
}

/* Dynamic sizing for phone wallpapers in pending */
#pendingGallery[style*="repeat(2,"] .pending-gallery-item.phone-wallpaper img {
    height: 350px;
}

#pendingGallery[style*="repeat(3,"] .pending-gallery-item.phone-wallpaper img {
    height: 250px;
}

#pendingGallery[style*="repeat(4,"] .pending-gallery-item.phone-wallpaper img {
    height: 180px;
}

#pendingGallery[style*="repeat(5,"] .pending-gallery-item.phone-wallpaper img {
    height: 140px;
}

#pendingGallery[style*="repeat(6,"] .pending-gallery-item.phone-wallpaper img {
    height: 120px;
}

#pendingGallery[style*="repeat(7,"] .pending-gallery-item.phone-wallpaper img {
    height: 100px;
}

#pendingGallery[style*="repeat(8,"] .pending-gallery-item.phone-wallpaper img {
    height: 90px;
}

.pending-gallery-item img:hover {
    transform: scale(1.02);
}

.pending-gallery-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pending-gallery-item-info h4 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.3;
}

.pending-gallery-item-info p {
    color: var(--text-secondary);
    margin: 0 0 0.8rem 0;
    font-size: 0.85rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pending-gallery-item-info small {
    color: var(--text-secondary);
    margin: 0 0 0.3rem 0;
    font-size: 0.75rem;
    display: block;
}

.file-size {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.thumbnail-info {
    color: var(--text-secondary) !important;
    font-size: 0.7rem;
    font-style: italic;
    display: block;
    margin-top: 0.2rem;
}

.pending-gallery-item-description {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-color);
}

.pending-gallery-item-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: auto;
    padding-top: 1rem;
    flex-wrap: wrap;
}

.approve-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.approve-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    background: linear-gradient(45deg, #45a049, #4CAF50);
}

.reject-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
    border: 2px solid #f44336;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.reject-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
    background: linear-gradient(45deg, #d32f2f, #f44336);
}

.edit-btn {
    padding: 0.6rem 1rem;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    background: linear-gradient(45deg, #ee5a24, #ff6b6b);
}

/* Pending Status Badge */
.pending-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background: var(--accent-glow);
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
}

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

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Download Count */
.download-count {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--button-primary);
    color: var(--text-inverse);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 2;
}

.download-count i {
    margin-right: 0.3rem;
}

/* Responsive downloads display - unified across all devices */
.download-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    text-align: center;
}

.download-count i {
    margin-right: 0.2rem;
}

.download-count .download-text {
    display: inline;
    font-weight: 600;
}

@media (max-width: 768px) {
    .download-count {
        padding: 0.25rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .download-count i {
        margin-right: 0.2rem;
    }
}

@media (max-width: 480px) {
    .download-count {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .download-count i {
        margin-right: 0.1rem;
    }
    
    .download-count .download-text {
        font-size: 0.65rem;
    }
}

/* Category Filters */
.category-filters {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border-color);
}

.category-filters h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: var(--input-bg);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background: var(--accent-glow);
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--button-primary);
    color: var(--text-inverse);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Admin Gallery Badges */
.device-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.device-badge.desktop {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.device-badge.phone {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.category-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--accent-glow);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.admin-gallery-item-category {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-gallery-item {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.admin-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.admin-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.admin-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.admin-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.admin-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.admin-gallery-item:nth-child(6) { animation-delay: 0.6s; }

/* Responsive grid for pending gallery */
@media (max-width: 1200px) {
    #pendingGallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.2rem;
    }
}

/* Responsive admin header buttons */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-header-buttons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .refresh-btn, .debug-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: auto;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-tab {
        margin-right: 0;
        margin-bottom: 0.5rem;
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #pendingGallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }

    .pending-gallery-item {
        padding: 0.8rem;
    }

    .pending-gallery-item img {
        height: 220px;
    }

    .pending-gallery-item.desktop-wallpaper img {
        height: 200px;
    }

    .pending-gallery-item.phone-wallpaper img {
        height: 280px;
    }

    .pending-gallery-item-actions {
        gap: 0.5rem;
    }

    .approve-btn, .reject-btn, .edit-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: -1px) {
    /* PWA Mobile Optimizations */
    body {
        background: var(--bg-primary) !important;
        min-height: 100vh;
        /* PWA Safe Area Support */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        /* Prevent white edges on mobile */
        margin: 0 !important;
        overflow-x: hidden;
        background-attachment: fixed;
        /* PWA Touch optimizations */
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        /* iOS PWA fixes */
        -webkit-appearance: none;
        appearance: none;
        /* Prevent white flash on iOS */
        background-color: var(--bg-primary) !important;
        /* Fix white corners on iOS */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
    
    html {
        background: var(--bg-primary) !important;
        min-height: 100vh;
        /* Prevent white flash on mobile */
        -webkit-tap-highlight-color: transparent;
        /* iOS PWA fixes */
        -webkit-appearance: none;
        appearance: none;
        background-color: var(--bg-primary) !important;
        /* Fix white corners on iOS */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    /* PWA Main container */
    .main-container {
        position: relative;
        z-index: 1;
        background: var(--bg-primary);
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* PWA Touch-friendly buttons */
    .nav-btn, .upload-btn, .login-btn, .save-btn, .cancel-btn, 
    .edit-btn, .approve-btn, .reject-btn, .delete-btn, .download-btn,
    .refresh-btn, .debug-btn, .refresh-pending-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
        /* Fix touch targets */
        touch-action: manipulation;
        /* Prevent double-tap zoom */
        -webkit-user-select: none;
        user-select: none;
        /* Better mobile interaction */
        -webkit-appearance: none;
        appearance: none;
        appearance: none;
    }
    
    /* PWA Input fields */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
        /* Fix touch targets */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        /* Better mobile interaction */
        -webkit-user-select: text;
        user-select: text;
        box-sizing: border-box;
        width: 100%;
    }
    
    /* PWA Gallery items */
    .gallery-item {
        min-height: 200px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .gallery-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* PWA Full screen image */
    .full-size-overlay {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    
    .full-size-close {
        top: calc(20px + env(safe-area-inset-top));
        right: calc(20px + env(safe-area-inset-right));
        min-width: 44px;
        min-height: 44px;
    }
    
    /* PWA Install button */
    .install-pwa-btn {
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: calc(20px + env(safe-area-inset-right));
        min-height: 44px;
        min-width: 44px;
    }
    
    /* PWA Notifications */
    .notification {
        top: calc(20px + env(safe-area-inset-top));
        right: calc(20px + env(safe-area-inset-right));
        left: calc(20px + env(safe-area-inset-left));
        max-width: none;
    }
    
    /* PWA Settings dropdown */
    .settings-menu {
        right: calc(10px + env(safe-area-inset-right));
        top: calc(60px + env(safe-area-inset-top));
    }
    
    /* PWA Grid settings */
    .floating-grid-settings {
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: calc(20px + env(safe-area-inset-left));
    }
    
    /* PWA Loading spinner */
    .loading-spinner {
        top: calc(50% + env(safe-area-inset-top));
    }
    
    /* Mobile admin panel styles removed - admin panel is now always full-page */
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        /* Fix for mobile layout */
        width: 100%;
        padding: 0;
        margin-bottom: 1.5rem;
    }
    
    .admin-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    .admin-header-buttons {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .refresh-btn, .debug-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.8rem 1rem;
        flex: 1;
        font-size: 0.9rem;
        /* Fix touch targets */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* PWA Pending gallery */
    .pending-gallery-item-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* PWA Modal actions */
    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-actions button {
        width: 100%;
        min-height: 44px;
        /* Fix touch targets */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* PWA Admin container */
    .admin-container {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }
    
    /* PWA Upload form */
    .upload-form {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }
    
    /* PWA Modal */
    .modal {
        padding: 0.5rem;
        padding-left: calc(0.5rem + env(safe-area-inset-left));
        padding-right: calc(0.5rem + env(safe-area-inset-right));
    }
    
    .modal-content {
        max-width: 98%;
        max-height: 98%;
        border-radius: 15px;
        margin: 0;
    }
    
    /* PWA Form groups */
    .form-group {
        margin-bottom: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        display: block;
        width: 100%;
    }
    
    .form-group input,
    .form-group select {
        width: 100%;
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
        box-sizing: border-box;
        /* Fix touch targets */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* PWA Image preview */
    .image-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-info {
        margin-top: 1rem;
    }
    
    .change-image-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.8rem 1rem;
    }
    
    /* PWA Upload progress */
    .upload-progress {
        margin: 1rem 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .progress-bar {
        width: 100%;
        height: 8px;
        background: var(--progress-bg);
        border-radius: 4px;
        overflow: hidden;
        margin-bottom: 0.5rem;
    }
    
    .progress-fill {
        height: 100%;
        background: var(--progress-fill);
        border-radius: 4px;
        width: 0%;
        transition: width 0.3s ease;
        position: relative;
    }
    
    .progress-text {
        text-align: center;
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 500;
        width: 100%;
    }
    
    /* PWA Gallery item info */
    .gallery-item-info {
        padding: 0.8rem;
    }
    
    .gallery-item-title {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .gallery-item-category {
        font-size: 0.8rem;
    }
    
    /* PWA Download count */
    .download-count {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* PWA Device badges */
    .device-badge, .category-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* PWA Admin gallery items */
    .admin-gallery-item {
        flex-direction: column;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .admin-gallery-item-info {
        margin: 1rem 0;
        padding: 0.5rem;
    }
    
    .delete-btn {
        position: static;
        margin-top: 1rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    /* PWA Admin gallery grid */
    .admin-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    /* PWA Admin gallery */
    .admin-gallery {
        margin-top: 1rem;
        padding: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .admin-gallery h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        text-align: center;
        width: 100%;
    }
    
    /* PWA Upload area */
    .upload-area {
        width: 100%;
        min-height: 200px;
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        box-sizing: border-box;
        /* Fix touch interaction */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .upload-prompt {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    .upload-prompt i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .upload-prompt p {
        font-size: 1rem;
        margin: 0;
        padding: 0 1rem;
    }
    
    /* PWA Pending gallery items */
    .pending-gallery-item {
        flex-direction: column;
        text-align: center;
    }
    
    .pending-gallery-item-info {
        margin: 1rem 0;
    }
    
    .pending-status {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* PWA Section headers */
    .section-header {
        padding: 1rem;
        text-align: center;
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: white;
    }
    
    .section-header p {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.8);
    }
    
    /* PWA Public upload container */
    .public-upload-container {
        padding: 1rem;
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
    }
    
    .upload-info {
        margin-bottom: 1.5rem;
    }
    
    .upload-info h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .upload-info ul {
        text-align: left;
        padding-left: 1.5rem;
    }
    
    .upload-info li {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* PWA Full size image info */
    .full-size-info {
        position: relative;
        padding: 1rem;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 10px;
        text-align: center;
        margin-top: 1rem;
        width: calc(100% - 2rem);
        max-width: 400px;
    }
    
    .full-size-info h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        color: white;
    }
    
    .full-size-info p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        color: rgba(255, 255, 255, 0.8);
    }
    
    .full-size-info .download-btn {
        width: 100%;
        min-height: 44px;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border: none;
        border-radius: 25px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .full-size-info .download-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    }
    
    .full-size-info .download-btn:active {
        transform: translateY(0);
    }
    
    /* PWA Empty state */
    .empty-state {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .empty-state i {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    /* PWA Progress bars */
    .progress-bar {
        height: 8px;
    }
    
    .progress-text {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    /* PWA Admin tabs */
    .admin-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
        margin-bottom: 1.5rem;
        /* Fix for mobile */
        width: 100%;
        box-sizing: border-box;
    }
    
    .admin-tab {
        min-height: 44px;
        min-width: 44px;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        /* Fix touch targets */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        /* Better mobile layout */
        flex: 1;
        text-align: center;
        margin: 0;
    }
    
    /* PWA Stats */
    .approval-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Mobile gallery grid - 2 columns */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0.5rem;
        padding-left: calc(0.5rem + env(safe-area-inset-left));
        padding-right: calc(0.5rem + env(safe-area-inset-right));
    }
    
    #pendingGallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0.3rem;
        padding-left: calc(0.3rem + env(safe-area-inset-left));
        padding-right: calc(0.3rem + env(safe-area-inset-right));
    }

    .pending-gallery-item {
        padding: 0.6rem;
    }

    .pending-gallery-item img {
        height: 200px;
    }

    .pending-gallery-item.desktop-wallpaper img {
        height: 180px;
    }

    .pending-gallery-item.phone-wallpaper img {
        height: 250px;
    }

    .pending-gallery-item-info h4 {
        font-size: 0.9rem;
    }

    .pending-gallery-item-info p {
        font-size: 0.8rem;
    }

    .pending-gallery-item-info small {
        font-size: 0.7rem;
    }
}

/* Navigation responsive styles */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-brand {
        gap: 0.8rem;
    }
    
    .nav-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .nav-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        gap: 0.6rem;
    }
    
    .nav-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .nav-title {
        font-size: 1.4rem;
    }
}

/* Upload Progress Styles */
.upload-progress {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Upload button states */
.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.upload-btn.uploading {
    background: var(--progress-bg);
    color: var(--text-secondary);
}

/* Notification styles for retry messages */
.notification-info {
    background: #2196F3 !important;
}

.notification-info .notification-content i {
    color: white !important;
}
