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

:root {
    /* Modern Color Palette */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --accent-color: #10b981;
    --accent-hover: #059669;

    /* Backgrounds */
    --background: #ffffff;
    --surface: #f9fafb;
    --surface-hover: #f3f4f6;
    --surface-dark: #e5e7eb;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
    overflow: hidden;
}

/* Material Icons */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    gap: 24px;
    flex-wrap: wrap;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 4px 0;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 40px;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.header-center {
    flex: 1;
    max-width: 680px;
    margin: 0 auto;
    min-width: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 12px 24px;
    gap: 14px;
    transition: var(--transition);
    width: 100%;
}

.search-box:hover {
    background: var(--background);
    border-color: var(--border);
}

.search-box:focus-within {
    background: var(--background);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 400;
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 22px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.mobile-only {
    display: none;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.icon-button:hover {
    background: var(--surface);
}

.upload-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-button:active {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    margin-top: 72px;
    padding: 48px 56px;
    margin-left: 280px;
    margin-right: 0;
    width: calc(100% - 280px);
    max-width: none;
    box-sizing: border-box;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: 24px;
    padding: 64px 40px;
    text-align: center;
    margin-bottom: 48px;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(129, 140, 248, 0.02) 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

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

.upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.upload-area.has-files {
    cursor: default;
    background: var(--background);
    border-color: var(--primary-color);
}

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

.upload-icon {
    font-size: 88px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
    display: block;
}

.upload-area h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
}

.upload-info {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.info-badge:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.info-badge .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary-color);
}

/* Upload Options */
.upload-options {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.upload-option-group {
    margin-bottom: 20px;
}

.upload-option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-option-group label .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary-color);
}

.upload-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--background);
    color: var(--text-primary);
}

.upload-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.upload-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
    min-height: 50px;
    max-height: 150px;
    overflow-y: auto;
}

.upload-tag-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.upload-tag-checkbox:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
}

.upload-tag-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.upload-tag-checkbox.checked {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
}

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

.upload-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Upload Progress */
.upload-progress {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

.upload-progress p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Photo Section */
.photo-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.section-header h2 {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.photo-count {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    padding: 6px 14px;
    background: var(--surface);
    border-radius: 20px;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.photo-item:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    padding: 16px;
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-date {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 24px;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-state-content {
    max-width: 600px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 140px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
    display: block;
}

.empty-state h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.6;
}

.empty-state-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.feature-item .material-symbols-outlined {
    font-size: 32px;
    color: var(--primary-color);
}

.feature-item span:last-child {
    font-size: 13px;
    font-weight: 500;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

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

/* Homepage Hero + Sections */
.hero-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    background: white;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.hero-content h1 {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 520px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 16px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hero-primary,
.hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-secondary {
    border: 1px solid var(--border);
}

.hero-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.hero-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 12px;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.preview-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.preview-card.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(129, 140, 248, 0.12));
    border-color: rgba(99, 102, 241, 0.2);
}

.preview-card span.material-symbols-outlined {
    font-size: 28px;
    color: var(--primary-color);
}

.preview-card p {
    font-weight: 600;
    margin-bottom: 4px;
}

.preview-card small {
    color: var(--text-secondary);
    font-size: 13px;
}

.homepage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.homepage-stat-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.stat-icon.accent {
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.pink {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
}

.stat-icon.warning {
    color: #d97706;
    background: rgba(234, 179, 8, 0.12);
}

.stat-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.feature-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.feature-card {
    padding: 24px;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.feature-card span.material-symbols-outlined {
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: inline-flex;
    padding: 12px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.08);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.homepage-albums-section {
    background: white;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.homepage-albums-section .section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

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

.album-card {
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.album-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.album-card-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 90px);
    gap: 6px;
    border-radius: 14px;
    overflow: hidden;
}

.album-card-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--surface-dark);
}

.album-card-thumbs .thumb-placeholder {
    background: var(--surface-dark);
}

.album-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.album-card small {
    color: var(--text-secondary);
}

.album-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.album-placeholder {
    grid-column: 1 / -1;
    padding: 20px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px dashed var(--border);
    text-align: center;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .hero-section {
        padding: 32px;
    }

    .mobile-only {
        display: inline-flex;
    }

    .header {
        padding: 0 20px;
    }

    .header-center {
        order: 3;
        width: 100%;
        margin-top: 12px;
    }

    .header-right {
        flex: 1;
        justify-content: flex-end;
    }

    .main-content {
        margin-left: 0;
        padding: 32px 24px;
        width: 100%;
        margin-right: 0;
    }

    .hero-cta {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 24px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .homepage-stats,
    .feature-highlight,
    .recent-uploads-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: none;
    flex-direction: column;
    transition: background 0.3s ease;
}

.lightbox.active {
    display: flex;
    background: rgba(0, 0, 0, 0.95);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lightbox-close-btn {
    color: white !important;
}

.lightbox-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.lightbox-title .material-symbols-outlined {
    font-size: 24px;
    color: var(--primary-light);
}

.lightbox-title span:last-child {
    font-size: 16px;
    font-weight: 600;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lightbox-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lightbox-action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-color: transparent;
}

.lightbox-action-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.lightbox-action-btn .material-symbols-outlined {
    font-size: 20px;
}

.lightbox-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-header .icon-button {
    color: white;
    width: 44px;
    height: 44px;
}

.lightbox-header .icon-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-header .icon-button.danger {
    color: #ff6b6b;
}

.lightbox-header .icon-button.danger:hover {
    background: rgba(255, 107, 107, 0.2);
}

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#lightboxImage {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: imageZoomIn 0.4s ease;
    display: block;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-info {
    margin-top: 16px;
    color: white;
    text-align: center;
}

.image-info p {
    margin: 4px 0;
    font-size: 14px;
}

#imageName {
    font-weight: 500;
    font-size: 16px;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-button.prev {
    left: 24px;
}

.nav-button.next {
    right: 24px;
}

.nav-button .material-symbols-outlined {
    font-size: 32px;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner.show {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.album-group-header {
    grid-column: 1 / -1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.album-group-header:first-child {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 64px;
    }

    .header-center {
        display: none;
    }

    .logo-text-container {
        display: none;
    }

    .upload-button span:last-child {
        display: none;
    }

    .main-content {
        padding: 16px;
        margin-top: 64px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

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

    .nav-button {
        width: 40px;
        height: 40px;
    }

    .nav-button.prev {
        left: 8px;
    }

    .nav-button.next {
        right: 8px;
    }

    /* Lightbox responsive */
    .lightbox-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 10px;
        min-height: auto;
    }

    .lightbox-header-left {
        flex: 1;
        min-width: 0;
        gap: 10px;
    }

    .lightbox-title {
        gap: 8px;
        min-width: 0;
    }

    .lightbox-title .material-symbols-outlined {
        font-size: 20px;
    }

    .lightbox-title span:last-child {
        font-size: 13px;
        max-width: calc(100vw - 140px);
    }

    .lightbox-header-right {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
    }

    .lightbox-actions {
        gap: 6px;
        flex-wrap: wrap;
    }

    .lightbox-action-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 40px;
    }

    .lightbox-action-btn span:last-child {
        display: none;
    }

    .lightbox-header .icon-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .lightbox-divider {
        display: none;
    }

    .lightbox-content {
        padding: 12px;
        overflow: hidden;
    }

    .lightbox-image-container {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        justify-content: center;
    }

    #lightboxImage {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
    }

    .nav-button {
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(10px);
    }

    .nav-button.prev {
        left: 8px;
    }

    .nav-button.next {
        right: 8px;
    }

    .nav-button .material-symbols-outlined {
        font-size: 28px;
    }

    .image-info {
        display: none;
    }

    /* Better touch targets on mobile */
    .nav-button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .lightbox-action-btn,
    .lightbox-header .icon-button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Smooth scrolling for sidebar */
    .lightbox-sidebar {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .upload-area {
        padding: 32px 16px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .upload-area h2 {
        font-size: 18px;
    }

    /* Extra small mobile lightbox optimizations */
    .lightbox-header {
        padding: 6px 8px;
    }

    .lightbox-title .material-symbols-outlined {
        font-size: 16px;
    }

    .lightbox-title span:last-child {
        font-size: 11px;
        max-width: calc(100vw - 100px);
    }

    .lightbox-action-btn {
        padding: 5px 7px;
        min-width: 32px;
    }

    .lightbox-header .icon-button {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .lightbox-content {
        padding: 4px;
        height: 50%;
        max-height: 50vh;
    }

    .lightbox-sidebar {
        height: 50%;
        min-height: 50%;
        max-height: 50vh;
    }

    .nav-button {
        width: 36px;
        height: 36px;
    }

    .nav-button.prev {
        left: 2px;
    }

    .nav-button.next {
        right: 2px;
    }

    .nav-button .material-symbols-outlined {
        font-size: 20px;
    }

    .reactions-section,
    .rating-section,
    .comments-header,
    .comments-list,
    .comment-input-section {
        padding: 10px;
    }

    .reaction-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .reaction-emoji {
        font-size: 16px;
    }

    .rating-value {
        font-size: 20px;
    }

    .star {
        font-size: 20px;
    }

    .comment-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .comment-item {
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .comment-author {
        font-size: 12px;
    }

    .comment-text {
        font-size: 12px;
    }
}

/* ===== AUTHENTICATION STYLES ===== */

/* Login Button */
.login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.user-menu-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.user-menu-btn .material-symbols-outlined:first-child {
    font-size: 28px;
    color: var(--primary-color);
}

.user-menu-btn .material-symbols-outlined:last-child {
    font-size: 20px;
    transition: var(--transition-fast);
}

.user-menu.active .user-menu-btn .material-symbols-outlined:last-child {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    min-width: 240px;
    padding: 8px;
    display: none;
    animation: dropdownSlide 0.2s ease;
    z-index: 1000;
}

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

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

.user-menu.active .user-dropdown {
    display: block;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface);
}

.user-dropdown-header .material-symbols-outlined {
    font-size: 40px;
    color: var(--primary-color);
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-dropdown-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    text-decoration: none;
}

.user-dropdown-item:hover {
    background: var(--surface-hover);
}

.user-dropdown-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.auth-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideUp 0.4s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

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

.auth-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    z-index: 10;
}

.auth-close-btn:hover {
    background: var(--surface-dark);
    transform: rotate(90deg);
}

.auth-container {
    padding: 48px 40px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.auth-icon {
    font-size: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 16px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-form .form-group label .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary-color);
}

.auth-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.auth-switch {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.auth-switch p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Auth Modal Responsive */
@media (max-width: 768px) {
    .auth-modal-content {
        margin: 0 16px;
    }

    .auth-container {
        padding: 40px 24px;
    }

    .user-menu-btn span:not(.material-symbols-outlined) {
        display: none;
    }

    .login-button span:last-child {
        display: none;
    }
}

/* NEW FEATURES STYLES */

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 72px;
    width: 280px;
    height: calc(100vh - 72px);
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 32px 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 40;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-section {
    margin-bottom: 32px;
    padding: 0 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    margin: 0 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.sidebar-item:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-item .material-symbols-outlined {
    font-size: 20px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.icon-button-small {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.icon-button-small:hover {
    background: var(--surface);
    color: var(--primary-color);
}

.icon-button-small .material-symbols-outlined {
    font-size: 18px;
}

/* Selection Mode */
.photo-item.selection-mode {
    cursor: pointer;
}

.photo-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition);
}

.photo-item.selection-mode .photo-checkbox {
    display: flex;
}

.photo-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.photo-checkbox.checked .material-symbols-outlined {
    color: white;
    font-size: 18px;
}

.photo-item.selected {
    opacity: 0.7;
    transform: scale(0.95);
}

/* Selection Toolbar */
.selection-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 48px;
    padding: 12px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.selection-info {
    font-weight: 500;
    color: var(--text-primary);
}

.selection-info span {
    color: var(--primary-color);
}

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

.toolbar-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-button:hover {
    background: var(--border);
}

.toolbar-button.danger {
    color: #d93025;
}

.toolbar-button.danger:hover {
    background: rgba(217, 48, 37, 0.1);
}

@media (max-width: 540px) {
    .selection-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .toolbar-button {
        flex: 1 1 45%;
        justify-content: center;
    }
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.filter-group label {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Timeline View */
.timeline-view {
    animation: fadeIn 0.3s ease;
}

.timeline-group {
    margin-bottom: 32px;
}

.timeline-header {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    background: var(--background);
    padding: 12px 0;
    z-index: 10;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.color-picker input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.button-primary,
.button-secondary {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.button-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.button-secondary:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.selection-list {
    max-height: 300px;
    overflow-y: auto;
}

.selection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.selection-item:hover {
    background: var(--surface);
}

.selection-item .material-symbols-outlined {
    font-size: 20px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 4px;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

/* Slideshow */
.slideshow-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.slideshow-modal.active {
    display: flex;
}

.slideshow-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slideshow-controls .icon-button {
    color: white;
}

#slideshowImage {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 40px;
}

.slideshow-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.slideshow-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* View Modes */
.photo-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
}

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

.photo-grid.cozy {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
}

/* Responsive Updates */
@media (max-width: 1024px) {
    .header {
        padding: 0 32px;
        gap: 20px;
    }

    .header-center {
        max-width: 600px;
    }

    .main-content {
        padding: 40px 32px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

@media (max-width: 768px) {
    .header {
        padding: 0 20px;
        gap: 12px;
    }

    .header-center {
        max-width: 100%;
    }

    .main-content {
        padding: 32px 24px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .sidebar {
        top: 64px;
        height: calc(100vh - 64px);
        width: 280px;
        padding: 24px 0;
    }

    .sidebar-item {
        padding: 14px 20px;
        font-size: 14px;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .upload-area {
        padding: 48px 24px;
        margin-bottom: 32px;
    }

    .upload-icon {
        font-size: 64px;
        margin-bottom: 20px;
    }

    .upload-area h2 {
        font-size: 22px;
    }

    .section-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 0;
        margin-bottom: 20px;
    }

    .filter-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-group select {
        flex: 1;
        min-width: 120px;
    }

    .selection-toolbar {
        flex-direction: column;
        gap: 12px;
        width: 90%;
    }
}

/* IMAGE EDITOR STYLES */

.image-editor-content {
    max-width: 95vw;
    max-height: 95vh;
}

.image-editor-body {
    display: flex;
    gap: 20px;
    padding: 0;
    max-height: calc(95vh - 200px);
}

.editor-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

#editorCanvas {
    max-width: 100%;
    max-height: calc(95vh - 250px);
    border: 2px solid var(--border);
    background: white;
    box-shadow: var(--shadow-md);
}

.editor-tools {
    width: 280px;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
}

.tool-section {
    margin-bottom: 24px;
}

.tool-section h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tool-buttons,
.filter-buttons {
    display: grid;
    gap: 8px;
}

.tool-buttons {
    grid-template-columns: 1fr 1fr;
}

.tool-btn,
.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--background);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover,
.filter-btn:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
}

.tool-btn .material-symbols-outlined {
    font-size: 18px;
}

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

.adjustment-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.control-group span {
    font-weight: 500;
    color: var(--primary-color);
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* ALBUM EDITING STYLES */

.album-item-with-edit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 4px;
}

.album-edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    opacity: 0;
}

.sidebar-item:hover .album-edit-btn {
    opacity: 1;
}

.album-edit-btn:hover {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

.album-edit-btn .material-symbols-outlined {
    font-size: 16px;
}

.button-secondary.danger {
    color: #d93025;
    border-color: #d93025;
}

.button-secondary.danger:hover {
    background: rgba(217, 48, 37, 0.1);
}

/* Crop overlay */
.crop-overlay {
    position: absolute;
    border: 2px dashed var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
}

.crop-handle.tl {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.crop-handle.tr {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.crop-handle.bl {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.crop-handle.br {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

/* Responsive Image Editor */
@media (max-width: 1024px) {
    .image-editor-body {
        flex-direction: column;
    }

    .editor-tools {
        width: 100%;
    }

    .tool-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== COMMENTS, RATINGS & REACTIONS ===== */

.lightbox-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.lightbox-sidebar {
    width: 400px;
    background: white;
    border-left: 2px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100%;
}

/* Reactions Section */
.reactions-section {
    padding: 20px;
    border-bottom: 2px solid var(--border-light);
}

.reactions-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.reaction-btn {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

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

.reaction-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(129, 140, 248, 0.15) 100%);
    border-color: var(--primary-color);
    animation: reactionPop 0.3s ease;
}

.reaction-emoji {
    font-size: 20px;
}

.reaction-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: none;
}

.reaction-btn.active .reaction-count,
.reaction-count:not(:empty) {
    display: inline;
}

/* Rating Section */
.rating-section {
    padding: 20px;
    border-bottom: 2px solid var(--border-light);
}

.rating-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.rating-header .material-symbols-outlined {
    color: #fbbf24;
}

.rating-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.rating-stars {
    font-size: 20px;
    color: #fbbf24;
}

.total-ratings {
    font-size: 13px;
    color: var(--text-secondary);
}

.rating-input {
    margin-top: 12px;
    text-align: center;
}

.star-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.star {
    font-size: 32px;
    cursor: pointer;
    color: #d1d5db;
    transition: var(--transition-fast);
    user-select: none;
}

.star:hover {
    transform: scale(1.2);
}

.rating-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Comments Section */
.comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.comments-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-header .material-symbols-outlined {
    color: var(--primary-color);
}

.comments-title {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.comments-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-style: italic;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-text {
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.comment-delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: var(--transition-fast);
}

.comment-item:hover .comment-delete-btn {
    opacity: 1;
}

.comment-delete-btn:hover {
    color: #ef4444;
}

.comment-delete-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Comment Input */
.comment-input-section {
    padding: 20px;
    border-top: 2px solid var(--border-light);
    background: var(--surface);
}

.comment-input-wrapper {
    display: flex;
    gap: 12px;
}

.comment-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: var(--transition);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.comment-submit-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.comment-submit-btn .material-symbols-outlined {
    font-size: 24px;
}

.comment-login-prompt {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.comment-login-prompt .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.3;
}

.comment-login-prompt p {
    font-style: italic;
}

/* Animations */
@keyframes reactionPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .lightbox-sidebar {
        width: 350px;
    }
}

@media (max-width: 968px) {
    .lightbox {
        flex-direction: column;
    }

    .lightbox-header {
        flex-shrink: 0;
        z-index: 10;
        position: relative;
    }

    .lightbox-body {
        flex-direction: column;
        overflow: hidden;
        flex: 1;
        min-height: 0;
    }

    .lightbox-content {
        flex: 1;
        min-height: 0;
        height: 60%;
        max-height: 60vh;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lightbox-image-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #lightboxImage {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .lightbox-sidebar {
        width: 100%;
        height: 40%;
        min-height: 40%;
        max-height: 40vh;
        border-left: none;
        border-top: 2px solid var(--border-light);
        overflow-y: auto;
        flex-shrink: 0;
        background: white;
    }

    .reactions-section,
    .rating-section {
        padding: 16px;
    }

    .reactions-buttons {
        gap: 8px;
        justify-content: center;
    }

    .reaction-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .rating-display {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .average-rating {
        flex-direction: column;
        gap: 8px;
    }

    .comments-list {
        max-height: none;
        padding: 16px;
    }

    .comments-header {
        padding: 16px;
    }

    .comment-input-section {
        padding: 16px;
    }
}

@media (max-width: 640px) {

    /* Lightbox mobile optimizations */
    .lightbox-header {
        padding: 8px 10px;
    }

    .lightbox-header-left {
        gap: 8px;
    }

    .lightbox-close-btn {
        min-width: 36px;
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .lightbox-title {
        gap: 6px;
    }

    .lightbox-title .material-symbols-outlined {
        font-size: 18px;
    }

    .lightbox-title span:last-child {
        font-size: 12px;
        max-width: calc(100vw - 120px);
    }

    .lightbox-actions {
        gap: 4px;
    }

    .lightbox-action-btn {
        padding: 6px 8px;
        font-size: 10px;
        min-width: 36px;
    }

    .lightbox-header .icon-button {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .lightbox-content {
        padding: 6px;
        height: 55%;
        max-height: 55vh;
    }

    .lightbox-sidebar {
        height: 45%;
        min-height: 45%;
        max-height: 45vh;
    }

    .nav-button {
        width: 40px;
        height: 40px;
    }

    .nav-button.prev {
        left: 4px;
    }

    .nav-button.next {
        right: 4px;
    }

    .nav-button .material-symbols-outlined {
        font-size: 24px;
    }

    /* Reactions, Ratings, Comments mobile */
    .reactions-section,
    .rating-section {
        padding: 12px;
    }

    .reactions-buttons {
        gap: 6px;
    }

    .reaction-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .reaction-emoji {
        font-size: 18px;
    }

    .reaction-count {
        font-size: 11px;
    }

    .rating-header {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .rating-value {
        font-size: 24px;
    }

    .star {
        font-size: 24px;
    }

    .total-ratings {
        font-size: 12px;
    }

    .comments-header {
        padding: 12px;
        font-size: 14px;
    }

    .comments-title {
        font-size: 14px;
    }

    .comments-count {
        font-size: 11px;
        padding: 3px 10px;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .comment-item {
        margin-bottom: 16px;
        padding-bottom: 16px;
        gap: 10px;
    }

    .comment-author {
        font-size: 13px;
    }

    .comment-time {
        font-size: 11px;
    }

    .comment-text {
        font-size: 13px;
    }

    .comments-list {
        padding: 12px;
    }

    .comment-input-section {
        padding: 12px;
    }

    .comment-input {
        font-size: 13px;
        padding: 10px;
    }

    .comment-submit-btn {
        width: 44px;
        height: 44px;
    }

    .comment-submit-btn .material-symbols-outlined {
        font-size: 20px;
    }

    .hero-section {
        padding: 24px 20px;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta button {
        width: 100%;
        justify-content: center;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .upload-info {
        flex-direction: column;
        align-items: stretch;
    }

    .upload-actions {
        flex-direction: column;
        width: 100%;
    }

    .upload-actions button {
        width: 100%;
        justify-content: center;
    }

    .filter-group select {
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .main-content {
        padding: 24px 16px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .upload-area {
        padding: 40px 20px;
        margin-bottom: 24px;
    }

    .upload-icon {
        font-size: 56px;
        margin-bottom: 16px;
    }

    .upload-area h2 {
        font-size: 20px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .section-header {
        margin-bottom: 16px;
        padding-bottom: 8px;
    }

    .photo-grid {
        gap: 10px;
    }
}


/* Cloud Sync Modal Styles */
.sync-provider-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sync-provider-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: var(--transition);
}

.sync-provider-item:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

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

.provider-info .material-symbols-outlined {
    font-size: 32px;
}

.provider-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.provider-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

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