/* ================================
   CSS Variables & Theme
   ================================ */
:root {
    /* Purple Palette */
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --purple-700: #7c3aed;
    --purple-800: #6b21a8;
    --purple-900: #581c87;

    /* Accent Colors */
    --pink-500: #ec4899;
    --blue-500: #3b82f6;
    --teal-500: #14b8a6;
    --red-500: #ef4444;
    --green-500: #22c55e;

    /* Dark Theme */
    --bg-primary: #0f0a1a;
    --bg-secondary: #1a1025;
    --bg-tertiary: #251535;
    --surface: rgba(139, 92, 246, 0.08);
    --surface-hover: rgba(139, 92, 246, 0.15);
    --glass-bg: rgba(26, 16, 37, 0.6);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary: #f8f5ff;
    --text-secondary: #c4b5fd;
    --text-muted: #8b7aa8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --gradient-pink: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --gradient-glow: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(99, 102, 241, 0.4) 100%);

    /* Sizes */
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ================================
   Reset & Base
   ================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: thin;
    scrollbar-color: var(--purple-600) var(--bg-secondary);
}

/* Custom Scrollbar - Global */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--purple-500), var(--purple-700));
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--purple-400), var(--purple-600));
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* ================================
   Background Animation
   ================================ */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 70%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--purple-700);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--pink-500);
    top: 50%;
    right: -150px;
    animation-delay: -5s;
    opacity: 0.3;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--blue-500);
    bottom: -100px;
    left: 30%;
    animation-delay: -10s;
    opacity: 0.3;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: var(--purple-500);
    top: 40%;
    left: 10%;
    animation-delay: -15s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ================================
   Glassmorphism Cards
   ================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-header {
    background: rgba(15, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

/* ================================
   Page Transitions
   ================================ */
.page {
    display: none;
    opacity: 0;
    min-height: 100vh;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

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

/* ================================
   Login Page
   ================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
}

.animate-float {
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.6)); }
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.input-group select {
    padding-left: 16px;
    padding-right: 40px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c4b5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Style select dropdown - dark theme */
select,
.input-group select {
    background-color: #1a1025 !important;
}

select option,
.input-group select option {
    background-color: #1a1025;
    color: #f8f5ff;
    padding: 12px 16px;
}

select option:hover,
select option:focus,
select option:checked,
.input-group select option:hover,
.input-group select option:focus,
.input-group select option:checked {
    background-color: #7c3aed !important;
    background: linear-gradient(#7c3aed, #7c3aed);
    color: white;
}

/* Chrome/Edge/Safari - force dark dropdown */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select,
    .input-group select {
        color-scheme: dark;
    }
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--purple-500);
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 17px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: var(--transition-normal);
    pointer-events: none;
}

.input-group input:focus + .input-glow ~ .input-icon,
.input-group input:focus ~ .input-icon {
    color: var(--purple-400);
}

.input-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
    transform: translateX(-50%);
    border-radius: 2px;
}

.input-group input:focus + .input-glow {
    width: 100%;
}

/* ================================
   Buttons
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

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

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--purple-500);
}

.btn-danger {
    background: var(--red-500);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--red-500);
    border-color: var(--red-500);
}

.error-text {
    color: var(--red-500);
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
}

/* ================================
   Header
   ================================ */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: relative;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.nav-pill svg {
    width: 18px;
    height: 18px;
}

.nav-pill:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.nav-pill.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.admin-only {
    display: none;
}

body.is-admin .admin-only {
    display: flex;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    overflow: hidden;
    flex-shrink: 0;
}

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

.user-avatar.has-image {
    background: transparent;
    border: 2px solid var(--glass-border);
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--purple-400);
    text-transform: capitalize;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.user-menu-trigger:hover {
    background: var(--surface-hover);
    border-color: var(--purple-500);
}

.user-menu-trigger .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.user-menu-trigger .user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-trigger .user-role {
    font-size: 0.65rem;
    padding: 3px 8px;
    background: var(--gradient-primary);
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-menu-trigger .dropdown-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-menu.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-500);
}

/* ================================
   Stats Bar
   ================================ */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    min-width: 180px;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-400);
}

.stat-icon.pink {
    background: rgba(236, 72, 153, 0.2);
    color: var(--pink-500);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: var(--blue-500);
}

.stat-icon.teal {
    background: rgba(20, 184, 166, 0.2);
    color: var(--teal-500);
}

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

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

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

/* ================================
   Main Content
   ================================ */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 32px;
}

.tab-content {
    display: none;
    opacity: 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ================================
   Gallery
   ================================ */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-pills {
    display: flex;
    gap: 8px;
}

.filter-pill {
    padding: 8px 18px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.filter-pill:hover {
    color: var(--text-primary);
    border-color: var(--purple-500);
}

.filter-pill.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

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

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    transition: var(--transition-normal);
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1;
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--purple-500);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

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

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.1);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
    transform: translateY(100%);
    transition: var(--transition-normal);
}

.gallery-item:hover .item-overlay {
    transform: translateY(0);
}

.item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition-normal);
}

.video-badge svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-left: 4px;
}

.gallery-item:hover .video-badge {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--purple-600);
}

.private-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.private-badge svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Empty & Loading States */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    max-width: 400px;
    margin: 40px auto;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px;
    color: var(--text-muted);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--purple-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ================================
   Upload Zone
   ================================ */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.drop-zone {
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.drop-zone:hover::before,
.drop-zone.dragover::before {
    border-color: var(--purple-500);
}

.drop-zone.dragover {
    background: rgba(139, 92, 246, 0.1);
}

.drop-content {
    position: relative;
    z-index: 1;
}

.drop-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    animation: bounceUp 2s ease-in-out infinite;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.drop-zone h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.supported-formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.format-badge {
    padding: 4px 12px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--purple-300);
}

.size-limit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#file-input {
    display: none;
}

/* Preview Area */
.preview-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: var(--red-500);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}

.preview-item:hover .preview-remove {
    opacity: 1;
}

.preview-remove svg {
    width: 14px;
    height: 14px;
}

.preview-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 0.7rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Upload Progress */
.upload-progress {
    margin-top: 24px;
    padding: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-title {
    font-weight: 500;
    color: var(--text-primary);
}

.progress-percent {
    color: var(--purple-400);
    font-weight: 600;
}

.progress-track {
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-bar::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: progressShine 1.5s ease-in-out infinite;
}

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

#upload-btn {
    margin-top: 24px;
    width: 100%;
}

/* Private Upload Toggle */
.private-upload-option {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-container input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
    transition: var(--transition-normal);
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: var(--transition-normal);
}

.toggle-container input:checked + .toggle-slider {
    background: var(--gradient-primary);
    border-color: var(--purple-500);
}

.toggle-container input:checked + .toggle-slider::after {
    background: white;
    left: 21px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-label svg {
    width: 18px;
    height: 18px;
    color: var(--purple-400);
}

.toggle-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 56px;
}

/* ================================
   Users Grid
   ================================ */
.users-container {
    max-width: 900px;
    margin: 0 auto;
}

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

.users-grid {
    display: grid;
    gap: 16px;
}

.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    transition: var(--transition-normal);
}

.user-card:hover {
    transform: translateX(4px);
    border-color: var(--purple-500);
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    text-transform: uppercase;
}

.user-card-details h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.user-card-details span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-card-role {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-card-role.admin {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-400);
}

.user-card-role.user {
    background: rgba(34, 197, 94, 0.2);
    color: var(--green-500);
}

.user-card-actions {
    display: flex;
    gap: 8px;
}

/* ================================
   Modals
   ================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* Prevent body scroll when modal is open */
body:has(.modal.active),
html:has(.modal.active) {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlide 0.4s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--purple-600) transparent;
}

.modal-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--purple-500), var(--purple-700));
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--purple-400), var(--purple-600));
}

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

.modal-small {
    width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px;
}

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

.modal-header h2 {
    font-size: 1.3rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    background: var(--red-500);
    border-color: var(--red-500);
    color: white;
}

.modal-form .input-group {
    margin-bottom: 16px;
}

.modal-form .input-group input,
.modal-form .input-group select {
    padding-left: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Media Viewer Modal - Redesigned */
.media-modal {
    padding: 0;
}

.media-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    background: rgba(15, 10, 26, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(15, 10, 26, 0.98), rgba(15, 10, 26, 0.98)),
                      linear-gradient(135deg, var(--purple-500), var(--pink-500), var(--purple-700));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.3),
                0 0 120px rgba(139, 92, 246, 0.1);
    animation: mediaModalIn 0.3s ease-out;
}

@keyframes mediaModalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.media-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition-fast);
}

.media-close-btn svg {
    width: 20px;
    height: 20px;
}

.media-close-btn:hover {
    background: var(--red-500);
    border-color: var(--red-500);
    transform: rotate(90deg);
}

.media-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    min-height: 0;
}

.media-viewer {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-viewer img,
.media-viewer video {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.media-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    gap: 20px;
}

.media-info-left {
    flex: 1;
    min-width: 0;
}

.media-info-left h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.media-info-left p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.media-info-right {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

/* Responsive media modal */
@media (max-width: 768px) {
    .media-modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .media-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .media-info-right {
        width: 100%;
    }

    .media-info-right .btn {
        flex: 1;
    }

    .media-viewer img,
    .media-viewer video {
        max-height: calc(100vh - 140px);
    }
}

/* ================================
   Delete Confirmation Modal
   ================================ */
#confirm-modal {
    overflow: hidden;
}

#confirm-modal .modal-backdrop {
    overflow: hidden;
}

.confirm-modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    max-width: 100vw;
    max-height: 100vh;
}

.confirm-modal {
    width: 400px;
    max-width: 90vw;
    padding: 32px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.15),
                0 8px 32px rgba(0, 0, 0, 0.4);
    animation: confirmAppear 0.25s ease-out;
    overflow: hidden;
    transform-origin: center center;
}

@keyframes confirmAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconGlow 2s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.2); }
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
    color: var(--red-500);
}

.confirm-modal h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirm-modal p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 120px;
}

.confirm-actions .btn-danger {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.confirm-actions .btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* ================================
   Toast Notifications
   ================================ */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(120%);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--green-500);
}

.toast.success .toast-icon::before {
    content: '✓';
    color: var(--green-500);
}

.toast.error {
    border-left: 4px solid var(--red-500);
}

.toast.error .toast-icon::before {
    content: '✕';
    color: var(--red-500);
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.toast-message {
    font-size: 0.95rem;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 1024px) {
    .stats-bar {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 calc(50% - 12px);
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .header-brand .brand-text {
        display: none;
    }

    .nav-pill span {
        display: none;
    }

    .nav-pill {
        padding: 10px;
    }

    .user-menu-trigger .user-name,
    .user-menu-trigger .user-role,
    .user-menu-trigger .dropdown-arrow {
        display: none;
    }

    .user-menu-trigger {
        padding: 4px;
        border-radius: 50%;
    }

    .storage-compact {
        display: none !important;
    }

    .header-nav {
        position: static;
        transform: none;
    }

    .stats-bar {
        padding: 16px;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

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

    .main-content {
        padding: 16px;
    }

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

    .login-card {
        padding: 32px 24px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .modal-small {
        width: 100%;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex: 1 1 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* ================================
   Share Modal Styles
   ================================ */
.share-modal-container {
    width: 450px;
}

.share-view {
    animation: fadeIn 0.3s ease;
}

.input-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.share-success {
    text-align: center;
    margin-bottom: 24px;
}

.share-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0.2); }
}

.share-success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--green-500);
}

.share-success h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.share-expiry-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.share-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-link-box input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: monospace;
}

.share-link-box input:focus {
    outline: none;
    border-color: var(--purple-500);
}

.btn-copy {
    flex-shrink: 0;
}

.share-password-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    color: var(--purple-300);
    font-size: 0.85rem;
}

.share-password-info svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.share-list-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

.share-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    gap: 12px;
}

.share-item-info {
    flex: 1;
    min-width: 0;
}

.share-item-url {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.share-badge {
    background: rgba(139, 92, 246, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--purple-300);
}

.share-item-actions {
    display: flex;
    gap: 6px;
}

.btn-danger-icon:hover {
    background: var(--red-500);
    border-color: var(--red-500);
    color: white;
}

/* ================================
   Public Share Page Styles
   ================================ */
.share-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.share-error-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-error-icon svg {
    width: 44px;
    height: 44px;
    color: var(--red-500);
}

.share-error-icon svg line {
    stroke-linecap: round;
}

.share-error-icon svg circle:last-child {
    stroke-width: 3;
}

#share-error h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

#share-error p {
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 400px;
}

.share-password-card {
    width: 420px;
    max-width: 100%;
    padding: 40px;
}

.share-password-header {
    text-align: center;
    margin-bottom: 32px;
}

.share-lock-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lockPulse 3s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px 10px rgba(139, 92, 246, 0.1); }
}

.share-lock-icon svg {
    width: 36px;
    height: 36px;
    color: var(--purple-400);
}

.share-password-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.share-password-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.share-content-wrapper {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.share-media-container {
    background: rgba(15, 10, 26, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 70vh;
}

.share-media-viewer {
    max-width: 100%;
    max-height: 100%;
}

.share-media-viewer img,
.share-media-viewer video {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.share-media-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 20px;
}

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

.share-media-details h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.share-media-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-media-actions {
    flex-shrink: 0;
}

.share-branding {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(26, 16, 37, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.share-brand-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--purple-400);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.share-brand-link:hover {
    color: var(--purple-300);
}

@media (max-width: 768px) {
    .share-password-card {
        padding: 32px 24px;
    }

    .share-media-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .share-media-details {
        width: 100%;
        text-align: left;
    }

    .share-media-actions {
        width: 100%;
    }

    .share-media-actions .btn {
        width: 100%;
    }

    .share-branding {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 20px;
    }
}

/* ================================
   Selection Mode Styles
   ================================ */
.gallery-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-mode-btn {
    gap: 6px;
}

.select-mode-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* Selection checkbox on gallery items */
.select-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition-fast);
    cursor: pointer;
}

.select-checkbox svg {
    width: 16px;
    height: 16px;
    color: white;
    opacity: 0;
    transition: var(--transition-fast);
}

.select-checkbox.disabled {
    cursor: not-allowed;
    opacity: 0.3 !important;
}

/* Show checkbox only in selection mode */
.gallery-grid.selection-mode .select-checkbox {
    opacity: 1;
    transform: scale(1);
}

/* Selected state */
.gallery-item.selected .select-checkbox {
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.gallery-item.selected .select-checkbox svg {
    opacity: 1;
}

.gallery-item.selected {
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* Selection mode gallery adjustments */
.gallery-grid.selection-mode .gallery-item {
    cursor: pointer;
}

.gallery-grid.selection-mode .gallery-item:hover {
    transform: scale(1.02);
}

/* Selection Action Bar */
.selection-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 16px 24px;
    border-radius: var(--radius-xl);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(139, 92, 246, 0.2);
    transition: bottom 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.selection-bar.visible {
    bottom: 32px;
    opacity: 1;
}

.selection-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.selection-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.selection-info span {
    font-weight: 700;
    color: var(--purple-400);
    font-size: 1.1rem;
}

.selection-actions {
    display: flex;
    gap: 10px;
}

.selection-bar .btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
}

.selection-bar .btn-icon:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

/* Disabled delete button */
.selection-bar .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.selection-bar .btn-danger:disabled:hover {
    transform: none;
}

/* Responsive selection bar */
@media (max-width: 768px) {
    .gallery-header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .selection-bar {
        left: 16px;
        right: 16px;
        transform: none;
        padding: 12px 16px;
    }

    .selection-bar.visible {
        bottom: 16px;
    }

    .selection-bar-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .selection-info {
        width: 100%;
        text-align: center;
    }

    .selection-actions {
        flex: 1;
        justify-content: center;
        flex-wrap: wrap;
    }

    .selection-actions .btn span {
        display: none;
    }

    .selection-actions .btn {
        padding: 10px;
    }

    .selection-bar .btn-icon {
        position: absolute;
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .select-checkbox {
        width: 24px;
        height: 24px;
    }

    .select-checkbox svg {
        width: 14px;
        height: 14px;
    }
}

/* ================================
   18+ Content / NSFW Styles
   ================================ */

/* 18+ Badge on gallery items */
.adult-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    background: var(--red-500);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.adult-badge svg {
    width: 12px;
    height: 12px;
}

/* Blur effect for 18+ content */
.gallery-item.is-adult img,
.gallery-item.is-adult video {
    filter: blur(20px);
    transition: filter 0.3s ease;
}

.gallery-item.is-adult:hover img,
.gallery-item.is-adult:hover video {
    filter: blur(15px);
}

.gallery-item.is-adult .adult-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
    color: white;
    text-align: center;
    padding: 20px;
}

.gallery-item.is-adult .adult-overlay svg {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.gallery-item.is-adult .adult-overlay span {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

/* 18+ content always stays blurred in gallery - must confirm each time to view */

/* Age Verification Modal */
.age-modal {
    width: 400px;
    max-width: 90vw;
    padding: 32px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.age-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-500);
}

.age-icon svg {
    width: 44px;
    height: 44px;
}

.age-modal h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.age-modal p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.age-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.age-actions .btn {
    min-width: 120px;
}

/* ================================
   Moderation Panel Styles
   ================================ */
.moderation-container {
    max-width: 1400px;
    margin: 0 auto;
}

.moderation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.moderation-filters {
    display: flex;
    gap: 8px;
}

.moderation-stats {
    display: flex;
    gap: 32px;
    padding: 16px 24px;
    margin-bottom: 24px;
}

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

.mod-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--red-500);
}

.mod-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.moderation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.mod-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
}

.mod-card:hover {
    border-color: var(--purple-500);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.mod-card-preview {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface);
}

.mod-card-preview img,
.mod-card-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mod-card-preview.blurred img,
.mod-card-preview.blurred video {
    filter: blur(15px);
}

.mod-card-score {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mod-card-score.high {
    background: var(--red-500);
    color: white;
}

.mod-card-score.medium {
    background: #f59e0b;
    color: white;
}

.mod-card-score.low {
    background: var(--green-500);
    color: white;
}

.mod-card-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.mod-card-status.flagged {
    background: var(--red-500);
    color: white;
}

.mod-card-status.pending {
    background: #f59e0b;
    color: white;
}

.mod-card-status.safe {
    background: var(--green-500);
    color: white;
}

.mod-card-info {
    padding: 16px;
}

.mod-card-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.mod-card-actions {
    display: flex;
    gap: 8px;
}

.mod-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.btn-safe {
    background: var(--green-500);
    color: white;
}

.btn-safe:hover {
    background: #16a34a;
}

.btn-flag {
    background: var(--red-500);
    color: white;
}

.btn-flag:hover {
    background: #dc2626;
}

@media (max-width: 768px) {
    .moderation-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .moderation-stats {
        width: 100%;
        justify-content: center;
    }

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

/* ================================
   Premium & Subscription Styles
   ================================ */

/* Premium Badge in Header */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-badge svg {
    width: 10px;
    height: 10px;
}

.user-role.premium {
    color: #a855f7;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Storage Usage Bar (Compact) */
.storage-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.storage-compact-bar {
    width: 60px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.storage-compact-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.storage-compact-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.storage-compact-fill.critical {
    background: #ef4444;
}

/* Email Verification Banner */
.verify-email-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.15), rgba(239, 68, 68, 0.15));
    border-bottom: 1px solid rgba(249, 115, 22, 0.3);
    font-size: 0.9rem;
    color: #fb923c;
}

.verify-email-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.verify-email-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.verify-email-banner a:hover {
    color: #fb923c;
}

/* Secondary Button */
.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--purple-500);
}

/* Success Text */
.success-text {
    color: #10b981;
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
}

/* Upgrade Prompt */
.upgrade-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.upgrade-prompt-icon {
    width: 40px;
    height: 40px;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upgrade-prompt-icon svg {
    width: 20px;
    height: 20px;
    color: #a855f7;
}

.upgrade-prompt-text {
    flex: 1;
}

.upgrade-prompt-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.upgrade-prompt-text strong {
    color: var(--text-primary);
}

.upgrade-prompt .btn {
    flex-shrink: 0;
}

/* Settings Page Link in Header */
.header-settings-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
}

.header-settings-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--purple-500);
}

.header-settings-link svg {
    width: 18px;
    height: 18px;
}

/* Link Button Style */
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.btn-link:hover {
    color: var(--purple-300);
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

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

.nav-link svg {
    width: 18px;
    height: 18px;
}

