/* ============================================================
   ÁLBUM DE FOTOS DA FAMÍLIA — Design System
   Premium dark theme with glassmorphism & micro-animations
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Colors – Dark Palette */
    --bg-primary: #050507;
    --bg-secondary: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --bg-surface-elevated: #1e1e22;
    --bg-glass: rgba(24, 24, 27, 0.75);

    --border-default: #27272a;
    --border-subtle: #1f1f23;
    --border-accent: rgba(139, 92, 246, 0.3);

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #09090b;

    /* Accent – Violet/Purple gradient */
    --accent-primary: #8b5cf6;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #6d28d9;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #6366f1, #3b82f6);

    /* Semantic */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.1);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.1);

    /* Warm family accent */
    --family-amber: #f59e0b;
    --family-amber-glow: rgba(245, 158, 11, 0.12);
    --family-rose: #f43f5e;
    --family-rose-glow: rgba(244, 63, 94, 0.12);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', monospace;

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 1px rgba(255, 255, 255, 0.05);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
    --content-max-width: 1200px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

::selection {
    background: var(--accent-primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-surface-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.sidebar-logo span {
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Search */
.sidebar-search {
    padding: 12px 20px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 10px center;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.sidebar-search input:focus {
    border-color: var(--accent-primary);
}

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

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 20px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
    width: 100%;
    text-align: left;
}

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

.nav-item.active {
    color: var(--accent-primary);
    background: var(--accent-glow);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-item .nav-count {
    margin-left: auto;
    font-size: 0.75rem;
    background: var(--bg-surface-hover);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
}

.storage-indicator {
    margin-bottom: 8px;
}

.storage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.storage-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width var(--transition-slow);
}

.sidebar-footer .btn-new-album {
    width: 100%;
    margin-top: 12px;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

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

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

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

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-card);
}

/* Photo Card */
.photo-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.photo-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.photo-card:hover img {
    transform: scale(1.05);
}

.photo-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

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

.photo-card-actions {
    display: flex;
    gap: 6px;
    width: 100%;
}

.photo-card-actions .btn-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.photo-card-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.photo-card-actions .btn-icon.danger:hover {
    background: var(--color-danger);
}

.photo-card-select {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: white;
    font-size: 0.7rem;
}

.photo-card:hover .photo-card-select,
.photo-card-select.selected {
    opacity: 1;
}

.photo-card-select.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Album Card */
.album-card {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.album-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.album-card-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--bg-surface-hover), var(--bg-secondary));
    position: relative;
    overflow: hidden;
}

.album-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.album-card:hover .album-card-cover img {
    transform: scale(1.05);
}

.album-card-cover .album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.3;
}

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

.album-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.album-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.album-card:hover .album-card-actions {
    opacity: 1;
}

/* ============================================================
   PHOTO GRID
   ============================================================ */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

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

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
    box-shadow: var(--shadow-glow);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-primary);
    transition: all var(--transition-normal);
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.upload-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* Upload Progress */
.upload-progress-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-progress-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    animation: slideIn var(--transition-normal) ease;
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.upload-progress-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.upload-progress-percent {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 200ms ease-out;
    position: relative;
}

.progress-bar-fill.complete {
    background: var(--color-success);
}

.progress-bar-fill.error {
    background: var(--color-danger);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.96);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

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

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

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

/* ============================================================
   LIGHTBOX / VIEWER
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    animation: lightboxZoom var(--transition-slow) ease;
}

.lightbox-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 2001;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 2001;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.85rem;
    z-index: 2001;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: toastIn var(--transition-slow) ease;
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-danger); }
.toast.warning { border-left: 3px solid var(--color-warning); }
.toast.info { border-left: 3px solid var(--color-info); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
}

.toast-close {
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-exit {
    animation: toastOut 300ms ease forwards;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   TAGS
   ============================================================ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-glow);
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    font-size: 0.85rem;
}

.tag-remove:hover {
    opacity: 1;
}

/* ============================================================
   SHARE PANEL
   ============================================================ */
.share-link-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-link-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
}

/* ============================================================
   VIEW HEADER (page title + actions bar)
   ============================================================ */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.view-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-default);
}

.view-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================================
   GUEST MODE (shared view)
   ============================================================ */
.guest-banner {
    background: var(--family-amber-glow);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--family-amber);
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-photo {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes lightboxZoom {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease;
}

.animate-scale-in {
    animation: scaleIn var(--transition-normal) ease;
}

.animate-slide-in {
    animation: slideIn var(--transition-normal) ease;
}

/* Staggered grid animation */
.photo-grid .photo-card:nth-child(1) { animation-delay: 0ms; }
.photo-grid .photo-card:nth-child(2) { animation-delay: 40ms; }
.photo-grid .photo-card:nth-child(3) { animation-delay: 80ms; }
.photo-grid .photo-card:nth-child(4) { animation-delay: 120ms; }
.photo-grid .photo-card:nth-child(5) { animation-delay: 160ms; }
.photo-grid .photo-card:nth-child(6) { animation-delay: 200ms; }
.photo-grid .photo-card:nth-child(7) { animation-delay: 240ms; }
.photo-grid .photo-card:nth-child(8) { animation-delay: 280ms; }

.photo-grid .photo-card {
    animation: scaleIn var(--transition-slow) ease both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .content-area {
        padding: 24px;
    }
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

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

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .app-header {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

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

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

    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lightbox-nav { display: none; }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

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

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

    .modal {
        border-radius: var(--radius-lg);
        margin: 8px;
    }

    .album-card-cover {
        height: 140px;
    }
}

/* ============================================================
   NEW PREMIUM FEATURES: SPLIT LIGHTBOX, PILLS, & FOOTER
   ============================================================ */

/* Modern Split Lightbox Modal */
.lightbox-modal {
    display: flex;
    width: 90%;
    max-width: 1050px;
    height: 85vh;
    max-height: 650px;
    background: #09090b;
    border: 1px solid #1f1f23;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: lightboxZoom var(--transition-slow) ease;
}

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

.lightbox-image-area .lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    transition: background var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background var(--transition-fast), transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}
.lightbox-nav-btn.prev { left: 16px; }
.lightbox-nav-btn.next { right: 16px; }

.lightbox-details-panel {
    width: 420px;
    background: #09090b;
    border-left: 1px solid #1f1f23;
    padding: 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 22px;
}

.lightbox-photo-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f4f4f5;
    margin: 0;
    line-height: 1.3;
}

.lightbox-photo-meta {
    font-size: 0.85rem;
    color: #71717a;
}

.lightbox-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 12px;
}

.lightbox-share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    cursor: pointer;
}

.share-btn.whatsapp {
    background: rgba(16, 185, 129, 0.04);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
}
.share-btn.whatsapp:hover {
    background: rgba(16, 185, 129, 0.12);
}

.share-btn.copy-link {
    background: rgba(139, 92, 246, 0.04);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.15);
}
.share-btn.copy-link:hover {
    background: rgba(139, 92, 246, 0.12);
}

.share-btn.email {
    background: rgba(59, 130, 246, 0.04);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.15);
}
.share-btn.email:hover {
    background: rgba(59, 130, 246, 0.12);
}

.share-btn.download {
    background: rgba(16, 185, 129, 0.04);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.15);
}
.share-btn.download:hover {
    background: rgba(16, 185, 129, 0.12);
}

.lightbox-json-block {
    background: #050507;
    border: 1px solid #1f1f23;
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #38bdf8;
    overflow-x: auto;
    max-height: 200px;
    margin: 0;
    line-height: 1.4;
}

.lightbox-json-block::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.lightbox-json-block::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 3px;
}

.lightbox-docs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f59e0b;
    color: #09090b !important;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: background var(--transition-fast), transform 0.1s;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.lightbox-docs-btn:hover {
    background: #d97706;
}

/* Tag/Filter Pills */
.gallery-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 4px 0;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: #18181b;
    border: 1px solid #27272a;
    color: #a1a1aa;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-pill:hover {
    background: #27272a;
    color: #f4f4f5;
}

.filter-pill.active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

/* Gallery Footer */
.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-default);
    color: #71717a;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 16px;
}

.gallery-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.green-text {
    color: #10b981;
    font-weight: 600;
}

.gallery-footer-left .divider {
    color: #27272a;
    margin: 0 4px;
}

.gallery-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-pill {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.footer-pill.latency-pill {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.05);
}

.footer-pill.edge-pill {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.05);
}

/* Photo Captions & Descriptions styling */
.photo-caption-text {
    margin-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.photo-desc-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Responsiveness for Lightbox */
@media (max-width: 850px) {
    .lightbox-modal {
        flex-direction: column;
        height: 95vh;
        max-height: none;
        width: 95%;
        border-radius: 16px;
    }
    .lightbox-details-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #1f1f23;
        height: auto;
        flex: 1;
        padding: 20px;
    }
    .lightbox-image-area {
        height: 45%;
        flex: none;
        padding: 16px;
    }
    .lightbox-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ============================================================
   USER MENU
   ============================================================ */
.user-menu {
    position: relative;
}
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.user-menu-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-surface-hover);
}
.user-avatar {
    font-size: 1.1rem;
}
.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}
.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown-header {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}
.user-dropdown-item:hover {
    background: var(--bg-surface-hover);
}
.user-dropdown-item.danger {
    color: var(--color-danger);
}
.user-dropdown-item.danger:hover {
    background: var(--color-danger-bg);
}

/* ============================================================
   VISIBILITY BADGE
   ============================================================ */
.visibility-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    backdrop-filter: blur(8px);
}
.visibility-badge.public {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.btn-icon.active-toggle {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    padding: 4px 0;
}
.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition-normal);
}
.settings-card:hover {
    border-color: var(--border-accent);
}
.settings-card-wide {
    grid-column: 1 / -1;
}
.settings-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.btn-danger {
    background: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--color-danger);
}

/* Family Members */
.family-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: border-color var(--transition-fast);
}
.family-member-row:hover {
    border-color: var(--border-accent);
}
.family-member-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.family-member-avatar {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.family-member-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.family-member-email {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.family-member-badge {
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    flex-shrink: 0;
    margin-left: 8px;
}
.family-member-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
