@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

/* PixOkno - Modern Photo Gallery Styles */

/* === CSS Variables / Theme === */
:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #141416;
    --bg-card: #1a1a1e;
    --bg-hover: #222228;
    --bg-input: #1e1e24;
    --text-primary: #f0f0f2;
    --text-secondary: #a0a0a8;
    --text-muted: #8a8a94;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.12);
    --border: #2a2a30;
    --border-light: #333340;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --nav-height: 60px;
    --max-width: 1280px;
    --transition: 0.2s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f5f5f5;
    --bg-input: #f0f0f2;
    --text-primary: #111118;
    --text-secondary: #555560;
    --text-muted: #999;
    --border: #e0e0e5;
    --border-light: #eaeaef;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Top Navigation === */
.nav-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    margin-right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo:hover {
    opacity: 0.85;
}

.logo-okno {
    background: linear-gradient(135deg, #c8a2ff, #ffb88c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition);
}

.nav-avatar:hover {
    transform: scale(1.05);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* === Admin/User Mode Toggle === */
.nav-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    margin-left: 0.25rem;
}
.nav-mode-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* === Language Switcher === */
.lang-switcher {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.lang-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    line-height: 1;
    display: flex;
    align-items: center;
    opacity: 0.5;
}
.lang-btn:hover {
    opacity: 0.8;
    background: var(--bg-hover);
}
.lang-btn.active {
    opacity: 1;
    border-color: var(--color-primary);
    background: rgba(99,102,241,0.08);
}
.lang-btn .fi {
    font-size: 1.1em;
    line-height: 1;
}

/* === User Dropdown === */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem;
    display: none;
    z-index: 1001;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 0.625rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:first-child {
    background: var(--accent-subtle);
}

.user-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.375rem 0;
}

/* === Page Layout === */
.page-content {
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 3rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    overflow-x: hidden;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 1.25rem;
}

/* === Gallery Grid === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    cursor: pointer;
}

.gallery-card-image {
    aspect-ratio: 4/3;
    background: var(--bg-hover);
    overflow: hidden;
    position: relative;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.03);
}

/* Blur-up fade-in for images that opt in via onload handler */
.gallery-card-image .photo-blur-placeholder ~ img {
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.4s ease;
    position: relative;
    z-index: 1;
}

.gallery-card-image .photo-blur-placeholder ~ img.loaded {
    opacity: 1;
}

.gallery-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.gallery-card-info {
    padding: 1rem 1.25rem;
}

.gallery-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.gallery-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 0.25rem;
}
.tag-sm {
    font-size: 0.6875rem;
    padding: 0.1rem 0.4rem;
}
.gallery-card-meta {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gallery-visibility-icon {
    display: none;
    align-items: center;
    line-height: 1;
}

.gallery-card-action {
    padding: 0.25rem 0.35rem;
    line-height: 1;
}

.gallery-card-action:first-of-type {
    margin-left: auto;
}

/* === Photo Grid (Masonry-like) === */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
    gap: 0.5rem;
}
.photo-grid.cols-2 { --grid-cols: 2; }
.photo-grid.cols-4 { --grid-cols: 4; }
.photo-grid.cols-6 { --grid-cols: 6; }

.photo-grid-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 1;
}

.photo-grid-item img.loaded {
    opacity: 1;
}

.photo-grid-item:hover img.loaded {
    opacity: 0.85;
}

/* Blur-up placeholder */
.photo-blur-placeholder {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: top;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: 0;
}

.photo-grid-item .photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 0.75rem 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.8125rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.photo-grid-item:hover .photo-caption {
    opacity: 1;
}

/* Grid density picker */
.grid-density-picker {
    display: inline-flex;
    gap: 0.125rem;
    align-items: center;
}
.grid-density-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.grid-density-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.grid-density-btn.active {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(99,102,241,0.08);
}

@media (min-width: 769px) {
    .grid-density-mobile-only {
        display: none;
    }
}

/* Editor grid respects density */
.editor-photo-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
    gap: 0.5rem;
}
.editor-photo-grid.cols-2 { --grid-cols: 2; }
.editor-photo-grid.cols-4 { --grid-cols: 4; }
.editor-photo-grid.cols-6 { --grid-cols: 6; }

/* Editor photo card */
.editor-photo-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    position: relative;
}
.editor-photo-card.selected {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}
.editor-photo-card.kb-selected {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
}
.editor-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
}
.editor-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 1;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.editor-photo-thumb img.loaded { opacity: 1; }
.editor-cover-badge {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    z-index: 3;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
}
.editor-private-badge {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    z-index: 3;
    padding: 0.25rem 0.45rem;
    font-size: 0;
}
.editor-badge-row {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    z-index: 3;
    display: flex;
    gap: 0.25rem;
}
.editor-edits-badge {
    background: rgba(99, 102, 241, 0.85);
    padding: 0.25rem 0.45rem;
    font-size: 0;
    border-radius: 0.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.private-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.18),
        rgba(0,0,0,0.18) 5px,
        rgba(0,0,0,0.06) 5px,
        rgba(0,0,0,0.06) 10px
    );
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
}
.private-photo img {
    opacity: 0.6;
}
.dl-status-badge {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    z-index: 3;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    color: #fff;
    pointer-events: none;
    line-height: 1.3;
    font-weight: 500;
}
.dl-pending { background: var(--warning); color: #000; }
.dl-ready { background: var(--success); }
.editor-photo-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.editor-photo-card:hover .editor-photo-overlay,
.editor-photo-card.selected .editor-photo-overlay { opacity: 1; }
@media (hover: none) {
    .editor-photo-overlay { opacity: 1; pointer-events: auto; background: none; }
    .editor-overlay-btn { opacity: 0.7; }
    .editor-photo-card.selected .editor-overlay-btn { opacity: 1; }
}
.editor-overlay-btn {
    position: absolute;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.editor-overlay-btn:hover { background: rgba(0,0,0,0.75); }
.editor-overlay-select { top: 0.25rem; left: 0.25rem; }
.editor-overlay-delete { top: 0.25rem; right: 0.25rem; }

/* Photo status bar below thumbnail */
.editor-photo-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.35rem 0.25rem;
}
.editor-select-circle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}
.editor-photo-grid.cols-4 .editor-cover-badge,
.editor-photo-grid.cols-6 .editor-cover-badge { font-size: 0.625rem; padding: 0.0625rem 0.375rem; }

/* === People Grid (Face Recognition) === */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}
.person-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.person-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.person-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.person-face-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}
.person-face-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.person-card-info {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.person-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.person-card-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.5rem 0.5rem;
}

/* Lightbox vote buttons */
.lightbox-votes {
    justify-content: center;
}
.lightbox-votes .vote-btn {
    width: 1.25rem;
    height: 1.25rem;
}

/* === Lightbox Comments === */
.lightbox-comments { margin-top: 0.5rem; max-height: 150px; overflow-y: auto; }
.lightbox-comment { display: flex; align-items: baseline; gap: 0.375rem; padding: 0.2rem 0; font-size: 0.8125rem; color: rgba(255,255,255,0.85); }
.lightbox-comment-author { font-weight: 600; flex-shrink: 0; }
.lightbox-comment-text { flex: 1; word-break: break-word; }
.lightbox-comment-delete { background: none; border: none; color: rgba(255,255,255,0.55); cursor: pointer; font-size: 1rem; padding: 0 0.25rem; }
.lightbox-comment-delete:hover { color: var(--danger); }
.lightbox-comment-form { display: flex; gap: 0.5rem; margin-top: 0.375rem; }
.lightbox-comment-input { flex: 1; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius); color: #fff; font-size: 0.8125rem; padding: 0.35rem 0.625rem; outline: none; }
.lightbox-comment-input:focus { border-color: rgba(255,255,255,0.4); }
.lightbox-comment-input::placeholder { color: rgba(255,255,255,0.5); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-input::placeholder {
    color: var(--text-muted);
}

input[type="date"].form-input {
    color-scheme: dark;
}

[data-theme="light"] input[type="date"].form-input {
    color-scheme: light;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-input.input-error {
    border-color: var(--danger);
}

.form-input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.form-hint.text-error {
    color: var(--danger);
}

.btn-eye {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition);
}

.btn-eye:hover {
    color: var(--text-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* === Tags === */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 0.375rem;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
[data-theme="light"] .tag {
    background: var(--accent-subtle);
    border-color: transparent;
}
button.tag {
    font-family: inherit;
}
.tag-active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.tag-remove:hover {
    opacity: 1;
}

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--color-border, var(--border));
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    transform: translateY(0.5rem);
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}
.badge-info {
    background: rgba(99, 102, 241, 0.3);
    color: var(--accent-hover);
}

/* === Tables === */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tr:hover td {
    background: var(--bg-hover);
}

/* === Loading === */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    gap: 0.75rem;
}

/* === Alerts === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* === Modal/Dialog === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.modal-wide {
    max-width: 1100px;
}

/* Confirm dialog */
.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    width: 90%;
    max-width: 340px;
    text-align: center;
}
.confirm-dialog-message {
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}
.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.confirm-dialog-actions .btn {
    min-width: 5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* === Toast Notification === */
.toast-notification {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
    font-size: 0.875rem;
    font-weight: 500;
    max-width: calc(100vw - 2rem);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
}

/* === Auth Pages === */
.auth-container {
    min-height: calc(100vh - var(--nav-height) - 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* === Public Gallery Layout === */
.gallery-cover {
    width: 100%;
    max-height: 30vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.gallery-cover img {
    width: 100%;
    height: 100%;
    max-height: 30vh;
    object-fit: cover;
}

.public-header {
    text-align: center;
    padding: 2rem 1.5rem;
}

.public-header .gallery-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.public-header .gallery-description {
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.0625rem;
    opacity: 0.85;
}

.public-header .gallery-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* === Upload Area === */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.preview-thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}

.preview-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: top;
    display: block;
}

.preview-name {
    display: block;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Upload progress overlays on preview thumbnails */
.preview-thumb.compressing::after,
.preview-thumb.uploading::after,
.preview-thumb.done::after,
.preview-thumb.error::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.preview-thumb.compressing::after,
.preview-thumb.uploading::after {
    background: rgba(0, 0, 0, 0.5);
}

.preview-thumb.compressing::before,
.preview-thumb.uploading::before {
    content: '';
    position: absolute;
    top: calc(50% - 14px);
    left: calc(50% - 14px);
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    animation: spin 0.6s linear infinite;
}

.preview-thumb.done::after {
    background: rgba(34, 197, 94, 0.45);
    content: '\2713';
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.preview-thumb.error::after {
    background: rgba(239, 68, 68, 0.45);
    content: '\2717';
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* === Utility === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }
.w-full { width: 100%; }

/* === Lightbox Nav === */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(0,0,0,0.7);
}

.lightbox-nav-prev { left: 1rem; }
.lightbox-nav-next { right: 1rem; }

.lightbox-rotate-btn {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius);
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.lightbox-rotate-btn:hover { background: rgba(0,0,0,0.7); }

/* === Lightbox Close Button === */
.lightbox-close-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    z-index: 1;
    transition: opacity 0.25s ease;
}

/* === Mobile Lightbox === */
.lightbox-mobile-backdrop {
    background: #000 !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    padding-left: env(safe-area-inset-left) !important;
    padding-right: env(safe-area-inset-right) !important;
    cursor: default !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lightbox-mobile-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-mobile-image {
    width: 100%;
    height: 100%;
    will-change: transform;
    transform-origin: center center;
    z-index: 1;
}

.lightbox-mobile-container .lightbox-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 2;
}

.lightbox-ghost {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    will-change: transform;
    z-index: 0;
}

.lightbox-ghost img {
    max-width: 100vw;
    max-height: 100dvh;
    object-fit: contain;
}

.lightbox-ghost-prev {
    transform: translateX(-100vw);
}

.lightbox-ghost-next {
    transform: translateX(100vw);
}

.lightbox-content-hidden {
    opacity: 0;
}

.lightbox-controls {
    transition: opacity 0.25s ease;
    opacity: 1;
}

.lightbox-controls-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Slideshow bar */
.slideshow-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2010;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    transition: opacity 0.3s ease;
}
.slideshow-bar-hidden {
    opacity: 0;
    pointer-events: none;
}
.slideshow-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.slideshow-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}
.slideshow-speed {
    display: flex;
    gap: 0.25rem;
}
.slideshow-speed-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    transition: all 0.15s;
}
.slideshow-speed-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}
.slideshow-speed-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}
.slideshow-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    min-width: 3rem;
    text-align: center;
}
@keyframes slideshow-fade {
    from { opacity: 0; transform: scale(1.01); }
    to { opacity: 1; transform: scale(1); }
}
.slideshow-fade-in {
    animation: slideshow-fade 0.8s ease-out;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.slideshow-backdrop {
    background: #000 !important;
    backdrop-filter: none !important;
}
:fullscreen {
    overflow: hidden !important;
    scrollbar-width: none !important;
}
:fullscreen::-webkit-scrollbar {
    display: none !important;
}
:fullscreen .modal-backdrop {
    background: #000 !important;
    backdrop-filter: none !important;
    cursor: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    overflow: hidden !important;
}
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) .lightbox-close-btn,
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) .lightbox-nav,
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) .lightbox-controls,
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) .lightbox-focus-restore {
    display: none !important;
}
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) > div {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}
:fullscreen .modal-backdrop:not(.lightbox-mobile-backdrop) img {
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Focus mode: "Photo only" enter button — hidden on desktop */
.lightbox-focus-enter {
    display: none;
}

/* Focus mode: hide controls completely */
.lightbox-controls-focus {
    display: none;
}

/* Focus mode: floating restore button */
.lightbox-focus-restore {
    display: none;
}

@media (max-width: 768px) {
    .lightbox-focus-enter {
        display: block;
        text-align: center;
        margin-top: 0.5rem;
        position: relative;
        z-index: 1;
    }

    .lightbox-focus-enter button {
        background: none;
        border: none;
        color: rgba(255,255,255,0.6);
        font-size: 0.75rem;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.25rem 0;
        cursor: pointer;
    }

    .lightbox-controls-focus {
        display: none;
    }

    .lightbox-focus-restore {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        z-index: 10001;
        background: rgba(255,255,255,0.15);
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        color: rgba(255,255,255,0.7);
        cursor: pointer;
        transition: opacity 0.25s ease;
    }


    .lightbox-mobile-container .lightbox-nav {
        display: none;
    }

    .lightbox-mobile-backdrop .lightbox-close-btn {
        top: env(safe-area-inset-top, 0.75rem);
        right: env(safe-area-inset-right, 0.75rem);
        padding: 0.75rem 1rem;
        font-size: 1.75rem;
        background: rgba(0,0,0,0.6);
        z-index: 10;
    }

}

/* === Photo Rotation Utilities === */
.rotate-90  { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.rotate-270 { transform: rotate(270deg); }
.photo-blur-placeholder.rotate-90  { transform: scale(1.1) rotate(90deg); }
.photo-blur-placeholder.rotate-180 { transform: scale(1.1) rotate(180deg); }
.photo-blur-placeholder.rotate-270 { transform: scale(1.1) rotate(270deg); }

.lightbox-people-names {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lightbox-face-section {
    position: relative;
    text-align: center;
    margin-bottom: 0.25rem;
}

.lightbox-faces-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lightbox-face-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.lightbox-face-crop {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-color: var(--bg-hover);
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.lightbox-face-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.lightbox-face-placeholder svg {
    width: 24px;
    height: 24px;
}

.lightbox-face-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    max-width: 80px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.lightbox-face-link {
    cursor: pointer;
    transition: color var(--transition);
}

.lightbox-face-link:hover {
    color: white;
    text-decoration: underline;
}

.lightbox-name-input {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    color: white;
    font-size: 0.6875rem;
    padding: 0.2rem 0.375rem;
    outline: none;
    width: 80px;
    text-align: center;
}

.lightbox-name-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.lightbox-name-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.18);
}

.tag-person-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
    flex-shrink: 0;
}

.tag-person-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.tag-picker {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    min-width: 180px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
}

.tag-picker-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.tag-picker-item:hover {
    background: var(--bg-hover);
}

.tag-picker-empty {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.tag-picker-create {
    color: var(--accent) !important;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
}

.tag-picker-new-input {
    padding: 0.375rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
}

.lightbox-redetect-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.6875rem;
    padding: 0.125rem 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.lightbox-redetect-btn:hover { color: white; }

.lightbox-undo-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all var(--transition);
}

.lightbox-undo-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    color: white;
}

.lightbox-face-crop-active {
    border-color: rgba(99, 102, 241, 0.9) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.face-highlight {
    position: absolute;
    border: 2px solid rgba(99, 102, 241, 0.8);
    border-radius: var(--radius);
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 5;
    animation: face-highlight-in 0.3s ease;
}

@keyframes face-highlight-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-info {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: center;
}

/* === Desktop/Mobile visibility === */
.nav-right-mobile { display: none; }

/* === Merged Mobile Menu === */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    z-index: 999;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.mobile-menu-username {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}
.mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}
.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}
.mobile-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.mobile-menu-item.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.mobile-menu-logout {
    color: var(--color-danger);
}
.mobile-menu-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mobile-menu-langs {
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem 1rem 0.5rem;
}
.mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition);
}
.mobile-lang-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.mobile-lang-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.mobile-lang-btn .fi {
    font-size: 1em;
}

/* === Hamburger === */
.nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-hamburger:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* === Date Range Row === */
.date-range-row {
    display: flex;
    gap: 1rem;
}

/* === Smart Search === */
.search-person-picker {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    max-width: 480px;
}
.search-autocomplete-wrap {
    position: relative;
    flex: 1;
}
.search-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
}
.search-autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background var(--transition);
}
.search-autocomplete-item:hover,
.search-autocomplete-item.highlighted {
    background: rgba(99, 102, 241, 0.25);
}
.search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    user-select: none;
}
.search-chip.include {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
    color: var(--success);
}
.search-chip.exclude {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}
.search-chip-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.125rem;
    opacity: 0.7;
}
.search-chip-remove:hover {
    opacity: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-top {
        padding: 0 0.75rem;
    }

    .nav-logo {
        margin-right: 0.5rem;
    }

    .nav-right-desktop,
    .nav-links-desktop {
        display: none !important;
    }

    .nav-right-mobile {
        display: flex;
        align-items: center;
        margin-left: auto;
    }

    .page-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-header > .flex.items-center.gap-2 {
        width: 100%;
    }

    .page-header .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }

    .page-header .btn svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.375rem;
    }

    .modal {
        width: 95%;
        padding: 1rem;
    }

    .people-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .person-card-info {
        padding: 0.375rem 0.5rem;
    }

    .person-card-actions {
        padding: 0 0.375rem 0.375rem;
        flex-wrap: wrap;
    }

    .page-header.flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .lightbox-nav-prev { left: 0.5rem; }
    .lightbox-nav-next { right: 0.5rem; }

    .table th, .table td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .modal-wide {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    .modal-wide table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .modal-wide thead, .modal-wide tbody, .modal-wide tr {
        display: table;
        width: 100%;
        table-layout: auto;
    }

    .date-range-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .upload-zone {
        padding: 1.5rem 1rem;
    }

    .page-header .flex.items-center.gap-2 {
        flex-wrap: wrap;
    }

    .gallery-card-info {
        padding: 0.625rem 0.75rem;
    }

    .gallery-card-info {
        padding: 0.625rem 0.75rem;
    }

    .gallery-card-title {
        font-size: 0.9rem;
        margin-bottom: 0.125rem;
    }

    .gallery-card-date {
        font-size: 0.75rem;
    }

    .gallery-card-meta {
        font-size: 0.75rem;
        gap: 0.25rem 0.5rem;
        flex-wrap: wrap;
    }

    .gallery-card-meta > span:first-child {
        width: 100%;
    }

    .gallery-visibility-badge {
        display: none;
    }

    .gallery-visibility-icon {
        display: inline-flex;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* === Blazor-specific === */
#blazor-error-ui {
    display: none;
    background: var(--danger);
    color: white;
    padding: 0.75rem 1.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    text-align: center;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    outline: none;
    border-color: var(--danger) !important;
}

.validation-message {
    color: var(--danger);
    font-size: 0.8125rem;
}

/* Blazor reconnect modal — shown during reconnection attempts */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}
#components-reconnect-modal.components-reconnect-show {
    display: flex;
}
#components-reconnect-modal::after {
    content: 'Reconnecting…';
    color: #fff;
    font-size: 1rem;
    background: var(--card-bg, #1e1e2e);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* === Expiry Picker === */
.expiry-picker {
    display: flex;
    flex-direction: column;
}

.expiry-picker input[type="date"] {
    color-scheme: dark;
}

[data-theme="light"] .expiry-picker input[type="date"] {
    color-scheme: light;
}

.expiry-presets {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.expiry-chip {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.expiry-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.expiry-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* === Vote Indicator (legacy) === */
.vote-indicator {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.vote-indicator:hover {
    transform: scale(1.25);
}

/* === Vote Buttons === */
.vote-buttons {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.vote-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.vote-btn.vote-good { border-color: #22c55e; }
.vote-btn.vote-normal { border-color: #f59e0b; }
.vote-btn.vote-bad { border-color: #ef4444; }

.vote-btn:hover {
    transform: scale(1.2);
}

.vote-btn.vote-good.active { background: #22c55e; }
.vote-btn.vote-normal.active { background: #f59e0b; }
.vote-btn.vote-bad.active { background: #ef4444; }

/* === NSFW Flagged Photos === */
.nsfw-flagged {
    position: relative;
}

.nsfw-flagged img {
    filter: blur(20px);
    transition: filter 0.2s;
}

.nsfw-flagged.nsfw-peek img {
    filter: none;
}

.nsfw-pending-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 0.25rem;
}

.nsfw-pending-placeholder svg {
    opacity: 0.5;
}

.nsfw-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    pointer-events: none;
}

.nsfw-actions {
    position: absolute;
    bottom: 0.35rem;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
}

.nsfw-action-btn {
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.2rem 0.5rem;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: background var(--transition);
}

.nsfw-peek-btn {
    background: rgba(255, 255, 255, 0.25);
    user-select: none;
    -webkit-user-select: none;
}

.nsfw-peek-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nsfw-safe-btn {
    background: rgba(34, 139, 34, 0.7);
}

.nsfw-safe-btn:hover {
    background: rgba(34, 139, 34, 0.95);
}

.nsfw-delete-btn {
    background: rgba(200, 30, 30, 0.7);
}

.nsfw-delete-btn:hover {
    background: rgba(200, 30, 30, 0.95);
}

/* === Watermark Protection Overlay === */
.watermark-protected img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.watermark-overlay {
    position: absolute;
    inset: 0;
    pointer-events: all;
    user-select: none;
    z-index: 2;
}

/* === Landing Page === */
.landing {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #f0ece4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    overflow: hidden;
    position: fixed;
    inset: 0;
    z-index: 1001;
}

.landing::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(200, 162, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.landing-lang-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    overflow: hidden;
    z-index: 10;
}

.landing-lang-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 1px;
    background: transparent;
    color: #7a7680;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.landing-lang-btn.active {
    background: rgba(200, 162, 255, 0.15);
    color: #c8a2ff;
}

.landing-window-frame {
    position: relative;
    width: 260px;
    height: 260px;
    margin-bottom: 2.5rem;
}

.landing-window-outer {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    box-shadow: 0 0 60px rgba(200, 162, 255, 0.05);
}

.landing-window-images {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 18px;
}

.landing-window-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease, transform 10s ease;
    transform: scale(1.08);
}

.landing-window-image.active {
    opacity: 1;
    transform: scale(1);
}

.landing-cross-h,
.landing-cross-v {
    position: absolute;
    background: rgba(255,255,255,0.07);
    z-index: 2;
}

.landing-cross-h {
    top: 50%; left: 0; right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.landing-cross-v {
    left: 50%; top: 0; bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}

.landing-logo {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -3px;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.landing-pix { color: #f0ece4; }

.landing-okno {
    background: linear-gradient(135deg, #c8a2ff, #ffb88c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-tagline {
    font-size: 1.1rem;
    color: #7a7680;
    font-weight: 300;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.landing-tagline span { color: #c8a2ff; }

.landing-subtitle {
    font-size: 0.85rem;
    color: #4a4750;
    margin-bottom: 2.5rem;
}

a.landing-btn,
a.landing-btn:visited,
a.landing-btn:hover {
    display: inline-block;
    padding: 0.8rem 2.4rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #c8a2ff, #a07cdf);
    color: #0a0a0f;
    box-shadow: 0 4px 24px rgba(200, 162, 255, 0.2);
    transition: all 0.3s ease;
}

a.landing-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(200, 162, 255, 0.35);
}

.landing-footer {
    position: fixed;
    bottom: 1.5rem;
    font-size: 0.7rem;
    color: #3a3840;
}

@media (max-width: 480px) {
    .landing-logo { font-size: 3rem; }
    .landing-window-frame { width: 200px; height: 200px; }
}

/* === Environment Chip === */
.env-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    flex-shrink: 0;
}

.env-chip.env-dev {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.env-chip.env-pre {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.env-chip.env-sandbox {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

/* === Help System === */
.btn-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-help:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.btn-help svg {
    width: 1.125rem;
    height: 1.125rem;
}

.help-modal {
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.help-content {
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.help-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.help-content p {
    margin-bottom: 0.75rem;
}

.help-content ul {
    margin: 0 0 0.75rem 1.25rem;
    padding: 0;
}

.help-content ul li {
    margin-bottom: 0.35rem;
}

.help-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.help-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.help-shortcuts {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.help-shortcuts td {
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
}
.help-shortcuts td:first-child {
    white-space: nowrap;
    width: 1%;
    padding-right: 1rem;
}
.help-shortcuts kbd {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--bg-input, #2a2a3e);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border);
}

/* Auth pages: position help button top-right of auth-card */
.auth-card {
    position: relative;
}

.auth-help-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

@media (max-width: 768px) {
    .help-modal {
        max-width: 95%;
    }
}

/* === Storage Dashboard === */
.storage-quota-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.storage-quota-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.storage-quota-used {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.storage-quota-used span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.storage-quota-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.storage-quota-details strong {
    color: var(--text-primary);
}

.storage-quota-track {
    width: 100%;
    height: 10px;
    background: var(--bg-hover);
    border-radius: 5px;
    overflow: hidden;
}

.storage-quota-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
    background: var(--accent);
}

.storage-quota-fill.warn {
    background: var(--warning);
}

.storage-quota-fill.critical {
    background: var(--danger);
}

.storage-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.storage-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 3rem;
    text-align: right;
}

.storage-bar-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .storage-quota-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    .storage-quota-details {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* === Trash / Recycle Bin === */
.trash-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.trash-group-title:first-child {
    margin-top: 0;
}

.trash-days-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}
.trash-days-badge.urgent {
    background: var(--danger);
}

/* === Activity Feed === */
.activity-feed { max-width: 640px; }
.activity-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-badge { width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.875rem; }
.activity-upload { background: rgba(34,197,94,0.15); color: #22c55e; }
.activity-vote { background: rgba(245,158,11,0.15); color: #f59e0b; }
.activity-comment { background: rgba(59,130,246,0.15); color: #3b82f6; }
.activity-share { background: rgba(168,85,247,0.15); color: #a855f7; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 0.875rem; line-height: 1.4; }
.activity-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.activity-meta a { color: var(--text-secondary); text-decoration: none; }
.activity-meta a:hover { color: var(--accent); }
.vote-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 0.25rem; vertical-align: middle; }
.vote-dot-good { background: var(--success); }
.vote-dot-normal { background: var(--warning); }
.vote-dot-bad { background: var(--danger); }
.activity-day-header { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 0 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 0; cursor: pointer; user-select: none; }
.activity-day-header:hover { color: var(--text-secondary); }
.activity-day-header:first-child { padding-top: 0; }
.activity-day-chevron { display: flex; align-items: center; transition: transform 0.15s ease; }
.activity-day-chevron.expanded { transform: rotate(90deg); }
.activity-day-count { margin-left: auto; font-size: 0.675rem; font-weight: 500; color: var(--text-muted); background: var(--bg-hover); padding: 0 0.375rem; border-radius: 8px; line-height: 1.4; }

/* Favorites / Collections */
.lightbox-favorite { display: flex; justify-content: center; margin-top: 0.5rem; }
.fav-btn { background: none; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; transition: transform 0.15s ease; display: flex; align-items: center; }
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active svg { filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5)); }
.editor-photo-fav-btn { position: absolute; bottom: 0.4rem; right: 0.4rem; z-index: 3; background: none; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; display: flex; align-items: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); transition: transform 0.15s ease, opacity 0.15s ease; opacity: 0; pointer-events: auto; }
.editor-photo-fav-btn.active { opacity: 1; }
.editor-photo-card:hover .editor-photo-fav-btn { opacity: 1; }
.editor-photo-fav-btn:hover { transform: scale(1.2); }
@media (hover: none) { .editor-photo-fav-btn { opacity: 1; } }

/* === Notification Bell === */
.notification-bell-container { position: relative; display: flex; align-items: center; }
.notification-bell-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 0.375rem; border-radius: var(--radius); display: flex; align-items: center; position: relative; transition: color var(--transition), background var(--transition); }
.notification-bell-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.notification-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; background: var(--danger); color: #fff; font-size: 0.625rem; font-weight: 700; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; transform: translate(25%, -25%); }
.notification-dropdown { position: absolute; top: calc(100% + 0.5rem); right: 0; width: 340px; max-height: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 1002; display: flex; flex-direction: column; overflow: hidden; }
.notification-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.notification-dropdown-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.notification-mark-all-btn { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: var(--radius); transition: background var(--transition); }
.notification-mark-all-btn:hover { background: var(--accent-subtle); }
.notification-dropdown-body { overflow-y: auto; flex: 1; }
.notification-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.8125rem; }
.notification-item { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.625rem 1rem; width: 100%; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; transition: background var(--transition); color: var(--text-secondary); font-family: inherit; font-size: inherit; }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--accent-subtle); }
.notification-item.unread:hover { background: rgba(99, 102, 241, 0.18); }
.notification-item-icon { flex-shrink: 0; margin-top: 0.125rem; color: var(--text-muted); }
.notification-item.unread .notification-item-icon { color: var(--accent); }
.notification-item-content { flex: 1; min-width: 0; }
.notification-item-message { display: block; font-size: 0.8125rem; color: var(--text-primary); line-height: 1.4; word-break: break-word; }
.notification-item-time { display: block; font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.125rem; }
@media (max-width: 640px) {
    .notification-dropdown { width: calc(100vw - 2rem); right: -1rem; }
}

