/*
 * Theme CSS Custom Properties
 * Comprehensive theming for dark mode UI
 */

/* ============================================
   THEME DEFINITIONS - DARK MODE
   ============================================ */

/* Vibrant Violet Dark */
body.theme-vibrant-violet-dark {
    --bs-primary: #8b5cf6;
    --bs-primary-rgb: 139, 92, 246;
    --bs-body-bg: #1e1e2f;
    --theme-primary: #8b5cf6;
    --theme-primary-hover: #7c3aed;
    --theme-primary-light: #a78bfa;
    --theme-primary-dark: #6d28d9;
    --theme-surface: #1e1e2f;
    --theme-elevated: #2d2d44;
    --theme-border: #3d3d5c;
    --theme-text: #f1f5f9;
    --theme-text-muted: #94a3b8;
    --theme-success: #22c55e;
    --theme-success-rgb: 34, 197, 94;
    --theme-danger: #ef4444;
    --theme-danger-rgb: 239, 68, 68;
    --theme-warning: #f59e0b;
    --theme-warning-rgb: 245, 158, 11;
    --theme-info: #06b6d4;
    --theme-info-rgb: 6, 182, 212;
    --theme-mode: dark;
}

/* Royal Purple Dark */
body.theme-royal-purple-dark {
    --bs-primary: #7c5cff;
    --bs-primary-rgb: 124, 92, 255;
    --bs-body-bg: #181825;
    --theme-primary: #7c5cff;
    --theme-primary-hover: #6b4ce6;
    --theme-primary-light: #9d8cff;
    --theme-primary-dark: #5b3fd9;
    --theme-surface: #181825;
    --theme-elevated: #24243a;
    --theme-border: #363654;
    --theme-text: #f1f5f9;
    --theme-text-muted: #94a3b8;
    --theme-success: #22c55e;
    --theme-success-rgb: 34, 197, 94;
    --theme-danger: #ef4444;
    --theme-danger-rgb: 239, 68, 68;
    --theme-warning: #f59e0b;
    --theme-warning-rgb: 245, 158, 11;
    --theme-info: #06b6d4;
    --theme-info-rgb: 6, 182, 212;
    --theme-mode: dark;
}

/* Plum Twilight Dark */
body.theme-plum-twilight-dark {
    --bs-primary: #9333ea;
    --bs-primary-rgb: 147, 51, 234;
    --bs-body-bg: #1a1a2e;
    --theme-primary: #9333ea;
    --theme-primary-hover: #7e22ce;
    --theme-primary-light: #a855f7;
    --theme-primary-dark: #6b21a8;
    --theme-surface: #1a1a2e;
    --theme-elevated: #2a2a42;
    --theme-border: #3a3a58;
    --theme-text: #f1f5f9;
    --theme-text-muted: #94a3b8;
    --theme-success: #22c55e;
    --theme-success-rgb: 34, 197, 94;
    --theme-danger: #ef4444;
    --theme-danger-rgb: 239, 68, 68;
    --theme-warning: #f59e0b;
    --theme-warning-rgb: 245, 158, 11;
    --theme-info: #06b6d4;
    --theme-info-rgb: 6, 182, 212;
    --theme-mode: dark;
}

/* ============================================
   THEME DEFINITIONS - LIGHT MODE
   ============================================ */

/* Vibrant Violet Light */
body.theme-vibrant-violet-light {
    --bs-primary: #8b5cf6;
    --bs-primary-rgb: 139, 92, 246;
    --bs-body-bg: #f8fafc;
    --theme-primary: #8b5cf6;
    --theme-primary-hover: #7c3aed;
    --theme-primary-light: #a78bfa;
    --theme-primary-dark: #6d28d9;
    --theme-surface: #f8fafc;
    --theme-elevated: #ffffff;
    --theme-border: #e2e8f0;
    --theme-text: #1e293b;
    --theme-text-muted: #64748b;
    --theme-success: #16a34a;
    --theme-success-rgb: 22, 163, 74;
    --theme-danger: #dc2626;
    --theme-danger-rgb: 220, 38, 38;
    --theme-warning: #d97706;
    --theme-warning-rgb: 217, 119, 6;
    --theme-info: #0891b2;
    --theme-info-rgb: 8, 145, 178;
    --theme-mode: light;
}

/* Royal Purple Light */
body.theme-royal-purple-light {
    --bs-primary: #7c5cff;
    --bs-primary-rgb: 124, 92, 255;
    --bs-body-bg: #f5f3ff;
    --theme-primary: #7c5cff;
    --theme-primary-hover: #6b4ce6;
    --theme-primary-light: #9d8cff;
    --theme-primary-dark: #5b3fd9;
    --theme-surface: #f5f3ff;
    --theme-elevated: #ffffff;
    --theme-border: #ddd6fe;
    --theme-text: #1e293b;
    --theme-text-muted: #64748b;
    --theme-success: #16a34a;
    --theme-success-rgb: 22, 163, 74;
    --theme-danger: #dc2626;
    --theme-danger-rgb: 220, 38, 38;
    --theme-warning: #d97706;
    --theme-warning-rgb: 217, 119, 6;
    --theme-info: #0891b2;
    --theme-info-rgb: 8, 145, 178;
    --theme-mode: light;
}

/* Plum Twilight Light */
body.theme-plum-twilight-light {
    --bs-primary: #9333ea;
    --bs-primary-rgb: 147, 51, 234;
    --bs-body-bg: #faf5ff;
    --theme-primary: #9333ea;
    --theme-primary-hover: #7e22ce;
    --theme-primary-light: #a855f7;
    --theme-primary-dark: #6b21a8;
    --theme-surface: #faf5ff;
    --theme-elevated: #ffffff;
    --theme-border: #e9d5ff;
    --theme-text: #1e293b;
    --theme-text-muted: #64748b;
    --theme-success: #16a34a;
    --theme-success-rgb: 22, 163, 74;
    --theme-danger: #dc2626;
    --theme-danger-rgb: 220, 38, 38;
    --theme-warning: #d97706;
    --theme-warning-rgb: 217, 119, 6;
    --theme-info: #0891b2;
    --theme-info-rgb: 8, 145, 178;
    --theme-mode: light;
}

/* ============================================
   LIGHT MODE SPECIFIC OVERRIDES
   ============================================ */

body[class*="-light"] {
    --theme-navbar-text: #ffffff;
    --theme-alert-success: #166534;
    --theme-alert-danger: #991b1b;
    --theme-alert-warning: #92400e;
    --theme-alert-info: #0e7490;
    --theme-alert-primary: #6d28d9;
}

body[class*="-dark"] {
    --theme-navbar-text: #ffffff;
    --theme-alert-success: #86efac;
    --theme-alert-danger: #fca5a5;
    --theme-alert-warning: #fcd34d;
    --theme-alert-info: #67e8f9;
    --theme-alert-primary: #c4b5fd;
}

/* ============================================
   BASE STYLES
   ============================================ */

body[class*="theme-"] {
    background-color: var(--bs-body-bg);
    color: var(--theme-text);
    transition: background-color 0.3s ease;
}

/* ============================================
   TYPOGRAPHY & LINKS
   ============================================ */

body[class*="-dark"] a {
    color: var(--theme-primary-light);
    transition: color 0.2s ease;
}

body[class*="-dark"] a:hover {
    color: var(--bs-primary);
}

body[class*="-light"] a {
    color: var(--theme-primary-dark, var(--bs-primary));
    transition: color 0.2s ease;
}

body[class*="-light"] a:hover {
    color: var(--theme-primary-hover);
}

body[class*="theme-"] .text-primary {
    color: var(--bs-primary) !important;
}

body[class*="theme-"] .text-muted {
    color: var(--theme-text-muted) !important;
}

body[class*="theme-"] h1,
body[class*="theme-"] h2,
body[class*="theme-"] h3,
body[class*="theme-"] h4,
body[class*="theme-"] h5,
body[class*="theme-"] h6 {
    color: var(--theme-text);
}

body[class*="theme-"] strong {
    color: var(--theme-text);
}

/* ============================================
   BUTTONS - with shadows and transitions
   ============================================ */

body[class*="theme-"] .btn {
    transition: all 0.2s ease;
}

body[class*="theme-"] .btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--theme-primary-hover);
    --bs-btn-hover-border-color: var(--theme-primary-hover);
    --bs-btn-active-bg: var(--theme-primary-dark);
    --bs-btn-active-border-color: var(--theme-primary-dark);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body[class*="theme-"] .btn-primary:hover {
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.4);
    transform: translateY(-1px);
}

body[class*="theme-"] .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body[class*="-dark"] .btn-outline-primary {
    --bs-btn-color: var(--theme-primary-light);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--theme-primary-hover);
    --bs-btn-active-border-color: var(--theme-primary-hover);
}

body[class*="-light"] .btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--theme-primary-hover);
    --bs-btn-active-border-color: var(--theme-primary-hover);
}

body[class*="theme-"] .btn-outline-primary:hover {
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.3);
}

body[class*="theme-"] .btn-secondary {
    --bs-btn-bg: var(--theme-elevated);
    --bs-btn-border-color: var(--theme-border);
    --bs-btn-color: var(--theme-text);
    --bs-btn-hover-bg: var(--theme-border);
    --bs-btn-hover-border-color: var(--theme-border);
    --bs-btn-hover-color: var(--theme-text);
}

body[class*="theme-"] .btn-success {
    --bs-btn-bg: var(--theme-success);
    --bs-btn-border-color: var(--theme-success);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body[class*="theme-"] .btn-success:hover {
    box-shadow: 0 4px 8px rgba(var(--theme-success-rgb), 0.4);
    transform: translateY(-1px);
}

body[class*="theme-"] .btn-danger {
    --bs-btn-bg: var(--theme-danger);
    --bs-btn-border-color: var(--theme-danger);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body[class*="theme-"] .btn-danger:hover {
    box-shadow: 0 4px 8px rgba(var(--theme-danger-rgb), 0.4);
    transform: translateY(-1px);
}

body[class*="theme-"] .btn-warning {
    --bs-btn-bg: var(--theme-warning);
    --bs-btn-border-color: var(--theme-warning);
    --bs-btn-color: #1a1a2e;
}

body[class*="theme-"] .btn-info {
    --bs-btn-bg: var(--theme-info);
    --bs-btn-border-color: var(--theme-info);
    --bs-btn-color: #1a1a2e;
}

/* Button sizes */
body[class*="theme-"] .btn-sm,
body[class*="theme-"] .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

body[class*="theme-"] .btn-lg,
body[class*="theme-"] .btn-large,
body[class*="theme-"] .btn-big {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* ============================================
   NAVBAR
   ============================================ */

body[class*="theme-"] .navbar.bg-primary {
    background-color: var(--bs-primary) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body[class*="theme-"] .navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease;
}

body[class*="theme-"] .navbar-dark .navbar-nav .nav-link:hover,
body[class*="theme-"] .navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
}

body[class*="theme-"] .navbar-dark .navbar-nav .show > .nav-link,
body[class*="theme-"] .navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

body[class*="theme-"] .navbar-brand {
    color: #fff !important;
}

/* ============================================
   CARDS - with shadows
   ============================================ */

body[class*="theme-"] .card {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body[class*="theme-"] .card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

body[class*="theme-"] .card-header {
    background-color: var(--theme-surface);
    border-bottom-color: var(--theme-border);
    color: var(--theme-text);
}

body[class*="theme-"] .card-body {
    color: var(--theme-text);
}

body[class*="theme-"] .card-footer {
    background-color: var(--theme-surface);
    border-top-color: var(--theme-border);
}

/* ============================================
   FORM CONTROLS
   ============================================ */

body[class*="theme-"] .form-control,
body[class*="theme-"] .form-select {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

body[class*="theme-"] .form-control::placeholder {
    color: var(--theme-text-muted);
}

body[class*="theme-"] .form-control:focus,
body[class*="theme-"] .form-select:focus {
    background-color: var(--theme-elevated);
    border-color: var(--theme-primary-light);
    color: var(--theme-text);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

body[class*="theme-"] .form-control:disabled,
body[class*="theme-"] .form-select:disabled {
    background-color: var(--theme-border);
    color: var(--theme-text-muted);
    opacity: 0.7;
}

body[class*="theme-"] .form-label,
body[class*="theme-"] label {
    color: var(--theme-text);
}

body[class*="theme-"] .form-text {
    color: var(--theme-text-muted);
}

/* Input groups */
body[class*="theme-"] .input-group-text {
    background-color: var(--theme-border);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

/* Form validation */
body[class*="theme-"] .is-invalid {
    border-color: var(--theme-danger) !important;
}

body[class*="-dark"] .invalid-feedback {
    color: #fca5a5;
}

body[class*="-light"] .invalid-feedback {
    color: #dc2626;
}

body[class*="theme-"] .is-valid {
    border-color: var(--theme-success) !important;
}

body[class*="-dark"] .valid-feedback {
    color: #86efac;
}

body[class*="-light"] .valid-feedback {
    color: #16a34a;
}

/* ============================================
   DROPDOWNS
   ============================================ */

body[class*="theme-"] .dropdown-menu {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

body[class*="theme-"] .dropdown-item {
    color: var(--theme-text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Override nav-link colors inside dropdown menus */
body[class*="theme-"] .dropdown-menu .nav-link {
    color: var(--theme-text) !important;
}

body[class*="theme-"] .dropdown-menu .nav-link:hover,
body[class*="theme-"] .dropdown-menu .nav-link:focus {
    color: var(--theme-text) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

body[class*="theme-"] .dropdown-item:hover,
body[class*="theme-"] .dropdown-item:focus {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--theme-text);
}

/* Light mode dropdown hover */
body[class*="-light"] .dropdown-item:hover,
body[class*="-light"] .dropdown-item:focus {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--theme-text);
}

body[class*="theme-"] .dropdown-item.active,
body[class*="theme-"] .dropdown-item:active {
    background-color: var(--bs-primary);
    color: #fff;
}

body[class*="theme-"] .dropdown-divider {
    border-top-color: var(--theme-border);
}

/* ============================================
   MODALS - with shadows
   ============================================ */

body[class*="theme-"] .modal-content {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body[class*="theme-"] .modal-header {
    border-bottom-color: var(--theme-border);
    color: var(--theme-text);
}

body[class*="theme-"] .modal-title {
    color: var(--theme-text);
}

body[class*="theme-"] .modal-body {
    color: var(--theme-text);
}

body[class*="theme-"] .modal-footer {
    border-top-color: var(--theme-border);
}

/* Dark mode: invert close button to white */
body[class*="-dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Light mode: use default dark close button */
body[class*="-light"] .btn-close {
    filter: none;
}

body[class*="theme-"] .modal-backdrop.show {
    opacity: 0.7;
}

/* Modal form controls override */
body[class*="theme-"] .modal .form-control,
body[class*="theme-"] .modal .form-select {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

/* ============================================
   TABLES
   ============================================ */

body[class*="theme-"] .table {
    --bs-table-bg: var(--theme-elevated);
    --bs-table-border-color: var(--theme-border);
    --bs-table-striped-bg: var(--theme-surface);
    --bs-table-hover-bg: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--theme-text);
}

body[class*="theme-"] .table > :not(caption) > * > * {
    border-bottom-color: var(--theme-border);
}

body[class*="theme-"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: var(--theme-surface);
}

body[class*="theme-"] .table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(var(--bs-primary-rgb), 0.1);
}

body[class*="theme-"] thead {
    color: var(--theme-text);
}

body[class*="theme-"] th {
    color: var(--theme-text);
    font-weight: 600;
}

/* ============================================
   CHIPS / TAGS
   ============================================ */

body[class*="theme-"] div.chip,
body[class*="theme-"] .chip {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    transition: all 0.2s ease;
}

body[class*="theme-"] div.chip:hover,
body[class*="theme-"] .chip:hover {
    background-color: var(--theme-elevated);
    border-color: var(--theme-primary-light);
    transform: translateY(-1px);
}

body[class*="theme-"] .chip a {
    color: var(--theme-text);
}

body[class*="-dark"] .chip a:hover {
    color: var(--theme-primary-light);
}

body[class*="-light"] .chip a:hover {
    color: var(--bs-primary);
}

body[class*="theme-"] .chip i {
    color: var(--theme-text-muted);
    transition: color 0.2s ease;
}

body[class*="-dark"] .chip:hover i {
    color: var(--theme-primary-light);
}

body[class*="-light"] .chip:hover i {
    color: var(--bs-primary);
}

/* Tag types with colored left border */
body[class*="theme-"] .chip.tag-general {
    border-left: 3px solid var(--bs-primary);
}

body[class*="theme-"] .chip.tag-date,
body[class*="theme-"] .btn.bg-info {
    border-left: 3px solid var(--theme-info);
}

/* ============================================
   BADGES
   ============================================ */

body[class*="theme-"] .badge {
    font-weight: 500;
}

body[class*="theme-"] .badge.bg-primary,
body[class*="theme-"] .bg-primary {
    background-color: var(--bs-primary) !important;
}

body[class*="theme-"] .badge.bg-success,
body[class*="theme-"] .bg-success {
    background-color: var(--theme-success) !important;
}

body[class*="theme-"] .badge.bg-danger,
body[class*="theme-"] .bg-danger {
    background-color: var(--theme-danger) !important;
}

body[class*="theme-"] .badge.bg-warning,
body[class*="theme-"] .bg-warning {
    background-color: var(--theme-warning) !important;
    color: #1a1a2e !important;
}

body[class*="theme-"] .badge.bg-info,
body[class*="theme-"] .bg-info {
    background-color: var(--theme-info) !important;
    color: #1a1a2e !important;
}

body[class*="theme-"] .badge.bg-secondary,
body[class*="theme-"] .bg-secondary {
    background-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

body[class*="theme-"] .badge.bg-light,
body[class*="theme-"] .bg-light {
    background-color: var(--theme-elevated) !important;
    color: var(--theme-text) !important;
}

body[class*="theme-"] .badge.bg-dark,
body[class*="theme-"] .bg-dark {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

/* ============================================
   ALERTS
   ============================================ */

body[class*="theme-"] .alert {
    border-width: 1px;
    border-left-width: 4px;
}

body[class*="theme-"] .alert-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    border-left-color: var(--bs-primary);
    color: var(--theme-alert-primary);
}

body[class*="theme-"] .alert-success {
    background-color: rgba(var(--theme-success-rgb), 0.15);
    border-color: rgba(var(--theme-success-rgb), 0.3);
    border-left-color: var(--theme-success);
    color: var(--theme-alert-success);
}

body[class*="theme-"] .alert-danger {
    background-color: rgba(var(--theme-danger-rgb), 0.15);
    border-color: rgba(var(--theme-danger-rgb), 0.3);
    border-left-color: var(--theme-danger);
    color: var(--theme-alert-danger);
}

body[class*="theme-"] .alert-warning {
    background-color: rgba(var(--theme-warning-rgb), 0.15);
    border-color: rgba(var(--theme-warning-rgb), 0.3);
    border-left-color: var(--theme-warning);
    color: var(--theme-alert-warning);
}

body[class*="theme-"] .alert-info {
    background-color: rgba(var(--theme-info-rgb), 0.15);
    border-color: rgba(var(--theme-info-rgb), 0.3);
    border-left-color: var(--theme-info);
    color: var(--theme-alert-info);
}

/* ============================================
   PAGINATION
   ============================================ */

body[class*="theme-"] .page-link {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    transition: all 0.2s ease;
}

body[class*="-dark"] .page-link {
    color: var(--theme-primary-light);
}

body[class*="-light"] .page-link {
    color: var(--bs-primary);
}

body[class*="theme-"] .page-link:hover {
    background-color: var(--theme-surface);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    transform: translateY(-1px);
}

body[class*="theme-"] .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.4);
}

body[class*="theme-"] .page-item.disabled .page-link {
    background-color: var(--theme-border);
    border-color: var(--theme-border);
    color: var(--theme-text-muted);
}

/* ============================================
   LIST GROUPS
   ============================================ */

body[class*="theme-"] .list-group-item {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    color: var(--theme-text);
    transition: background-color 0.2s ease;
}

body[class*="theme-"] .list-group-item:hover {
    background-color: var(--theme-surface);
}

body[class*="theme-"] .list-group-item.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* ============================================
   BREADCRUMBS
   ============================================ */

body[class*="theme-"] .breadcrumb {
    background-color: var(--theme-elevated);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

body[class*="theme-"] .breadcrumb-item {
    color: var(--theme-text-muted);
}

body[class*="-dark"] .breadcrumb-item a {
    color: var(--theme-primary-light);
}

body[class*="-light"] .breadcrumb-item a {
    color: var(--bs-primary);
}

body[class*="theme-"] .breadcrumb-item.active {
    color: var(--theme-text);
}

body[class*="theme-"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--theme-text-muted);
}

/* ============================================
   BORDERS & MISC
   ============================================ */

body[class*="theme-"] .border {
    border-color: var(--theme-border) !important;
}

body[class*="theme-"] .border-primary {
    border-color: var(--bs-primary) !important;
}

body[class*="theme-"] hr {
    border-color: var(--theme-border);
    opacity: 1;
}

/* ============================================
   GALLERY IMAGE OVERLAYS
   ============================================ */

body[class*="theme-"] .img-select,
body[class*="theme-"] .img-tags,
body[class*="theme-"] .img-cover,
body[class*="theme-"] .img-delete {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 0.25s ease;
}

body[class*="theme-"] .card:hover .img-select,
body[class*="theme-"] .card:hover .img-tags,
body[class*="theme-"] .card:hover .img-cover,
body[class*="theme-"] .card:hover .img-delete,
body[class*="theme-"] .img-select:hover,
body[class*="theme-"] .img-tags:hover,
body[class*="theme-"] .img-cover:hover,
body[class*="theme-"] .img-delete:hover {
    opacity: 1;
}

body[class*="theme-"] .img-select:hover,
body[class*="theme-"] .img-tags:hover,
body[class*="theme-"] .img-cover:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.7);
}

body[class*="theme-"] .img-delete:hover {
    background-color: rgba(var(--theme-danger-rgb), 0.7);
}

/* Gallery image hover effect */
body[class*="theme-"] .iterable .card {
    overflow: hidden;
}

body[class*="theme-"] .iterable img {
    transition: transform 0.3s ease;
    background-color: #fff;
}

body[class*="theme-"] .iterable .card:hover img {
    transform: scale(1.05);
}

/* White background for transparent images */
body[class*="theme-"] .card-body img,
body[class*="theme-"] .gallery-image {
    background-color: #fff;
}

/* Album cards - consistent height */
body[class*="theme-"] .starter-template .row {
    display: flex;
    flex-wrap: wrap;
}

body[class*="theme-"] .starter-template .row > [class*="col-"] {
    display: flex;
    margin-bottom: 1rem;
}

body[class*="theme-"] .starter-template .card {
    display: flex;
    flex-direction: column;
    width: 100%;
}

body[class*="theme-"] .starter-template .thumbnail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

body[class*="theme-"] .starter-template .thumbnail > a {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Album cover images - mounted photo effect */
body[class*="theme-"] .thumbnail img {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    margin-bottom: 1rem;
}

body[class*="theme-"] .thumbnail .caption {
    flex: 1;
}

/* Album header cover image in gallery view */
body[class*="theme-"] .starter-template.card img.img-fluid {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   LIGHTBOX & SLIDESHOW
   ============================================ */

body[class*="theme-"] #slideshow-modal,
body[class*="theme-"] #img-modal,
body[class*="theme-"] .lightbox-overlay {
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

body[class*="theme-"] .lightbox-overlay.slideshow-overlay {
    background-color: rgb(0, 0, 0);
    backdrop-filter: none;
}

body[class*="theme-"] .lightbox-close,
body[class*="theme-"] .slideshow-close {
    color: var(--theme-text);
    background-color: rgba(var(--bs-primary-rgb), 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

body[class*="theme-"] .lightbox-close:hover,
body[class*="theme-"] .slideshow-close:hover {
    background-color: var(--bs-primary);
    transform: scale(1.1);
}

body[class*="theme-"] a.prev,
body[class*="theme-"] a.next {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--theme-text);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

body[class*="theme-"] a.prev:hover,
body[class*="theme-"] a.next:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.8);
    color: #fff !important;
    transform: scale(1.05);
}

/* ============================================
   STICKY / BULK ACTIONS BAR
   ============================================ */

body[class*="theme-"] .sticky-top.body-bg,
body[class*="theme-"] .bulk-actions-bar {
    background-color: var(--theme-surface);
    border-bottom: 1px solid var(--theme-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1010; /* Below dropdown menus (1020) but above normal content */
}

body[class*="theme-"] .selection-count {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    animation: fadeIn 0.2s ease;
}

/* ============================================
   GALLERY TOOLBAR
   ============================================ */

body[class*="theme-"] .gallery-toolbar {
    position: relative;
    z-index: 1025; /* Above sticky bar so dropdowns show properly */
}

/* ============================================
   CHROMECAST CONTROLS
   ============================================ */

body[class*="theme-"] .cast-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.8));
    backdrop-filter: blur(10px);
    padding: 1rem;
}

body[class*="theme-"] .cast-controls-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body[class*="theme-"] .cast-now-playing {
    color: #fff;
    font-size: 0.95rem;
}

body[class*="theme-"] .cast-now-playing i {
    color: var(--theme-primary);
}

body[class*="theme-"] .cast-controls-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

body[class*="theme-"] .cast-controls-buttons .btn {
    min-width: 40px;
}

body[class*="theme-"] .cast-status-section {
    background: var(--theme-surface);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
}

/* ============================================
   CUSTOM CHECKBOXES
   ============================================ */

body[class*="theme-"] input[type=checkbox] + label:before {
    color: var(--theme-text-muted);
    transition: color 0.2s ease;
}

body[class*="theme-"] input[type=checkbox]:checked + label:before {
    color: var(--bs-primary);
}

body[class*="theme-"] input[type=checkbox] + label:hover:before {
    color: var(--theme-primary-light);
}

/* ============================================
   SCROLLBARS
   ============================================ */

body[class*="theme-"] {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-border) var(--theme-surface);
}

body[class*="theme-"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body[class*="theme-"] ::-webkit-scrollbar-track {
    background: var(--theme-surface);
    border-radius: 4px;
}

body[class*="theme-"] ::-webkit-scrollbar-thumb {
    background: var(--theme-border);
    border-radius: 4px;
    transition: background 0.2s ease;
}

body[class*="-dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-light);
}

body[class*="-light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* ============================================
   AUTOCOMPLETE (jQuery UI)
   ============================================ */

body[class*="theme-"] .ui-autocomplete {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body[class*="theme-"] .ui-menu-item {
    color: var(--theme-text);
}

body[class*="theme-"] .ui-menu-item:hover,
body[class*="theme-"] .ui-state-active {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* ============================================
   TOOLTIPS
   ============================================ */

body[class*="theme-"] .tooltip-inner {
    background-color: var(--theme-elevated);
    color: var(--theme-text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

body[class*="theme-"] .tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--theme-elevated);
}

body[class*="theme-"] .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--theme-elevated);
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

body[class*="-dark"] *:focus-visible {
    outline: 2px solid var(--theme-primary-light);
    outline-offset: 2px;
}

body[class*="-light"] *:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

body[class*="theme-"] .btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.5);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

body[class*="theme-"] .body-bg {
    background-color: var(--theme-surface) !important;
}

body[class*="theme-"] .text-light {
    color: var(--theme-text) !important;
}

/* Card within tag-body (no border) */
body[class*="theme-"] .tag-body > .card {
    border: none;
    box-shadow: none;
}

/* ============================================
   CONFIRMATION MODAL
   ============================================ */

.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.confirm-modal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.confirm-modal {
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.confirm-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
}

.confirm-modal-icon.danger {
    background-color: rgba(var(--theme-danger-rgb), 0.15);
    color: var(--theme-danger);
}

.confirm-modal-icon.warning {
    background-color: rgba(var(--theme-warning-rgb), 0.15);
    color: var(--theme-warning);
}

.confirm-modal-content {
    margin-bottom: 1.5rem;
}

.confirm-modal-title {
    color: var(--theme-text);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.confirm-modal-message {
    color: var(--theme-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.confirm-modal-item {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--theme-surface);
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
}

.confirm-modal-item strong {
    display: block;
    color: var(--theme-text);
    font-size: 0.95rem;
    word-break: break-word;
}

.confirm-modal-count {
    display: block;
    color: var(--theme-text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    min-width: 100px;
    padding: 0.625rem 1.25rem;
}

/* Mobile: Bottom sheet style */
@media (max-width: 576px) {
    .confirm-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .confirm-modal-container {
        max-width: none;
        width: 100%;
    }

    .confirm-modal {
        border-radius: 1.5rem 1.5rem 0 0;
        padding: 1.5rem 1.5rem 2rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .confirm-modal-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .confirm-modal-title {
        font-size: 1.1rem;
    }

    .confirm-modal-message {
        font-size: 0.9rem;
    }

    .confirm-modal-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .confirm-modal-actions .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--theme-elevated);
    border: 2px dashed var(--theme-border);
    border-radius: 1rem;
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--theme-text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state-title {
    color: var(--theme-text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--theme-text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-actions .btn {
    padding: 0.75rem 1.5rem;
}

/* ============================================
   UPLOAD PROGRESS
   ============================================ */

.upload-progress-container {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.upload-progress-label {
    color: var(--theme-text);
    font-weight: 500;
}

.upload-progress-percent {
    color: var(--bs-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

body[class*="theme-"] .progress {
    background-color: var(--theme-border);
    border-radius: 0.5rem;
    overflow: hidden;
}

body[class*="theme-"] .progress-bar {
    background-color: var(--bs-primary);
    transition: width 0.3s ease;
}

.upload-preview {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

[x-cloak] {
    display: none !important;
}

/* ============================================
   TAGS MANAGEMENT TABLE
   ============================================ */

.tags-table {
    margin-bottom: 0;
}

.tags-table thead th {
    background-color: var(--theme-elevated);
    border-color: var(--theme-border);
    color: var(--theme-text);
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.tags-table tbody td {
    vertical-align: middle;
    border-color: var(--theme-border);
}

/* Primary tag rows - subtle highlight */
.tag-row-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Alias rows - indented appearance */
.tag-row-alias {
    background-color: var(--theme-surface);
}

.tag-row-alias td:first-child {
    border-left: 3px solid var(--theme-text-muted);
}

/* Tag name cell layout */
.tag-name-cell {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-hierarchy-indicator {
    display: inline-flex;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
}

/* Alias chip styling - smaller and muted */
.chip.tag-alias-chip {
    background-color: var(--theme-border);
    opacity: 0.85;
    font-size: 12px;
    height: 28px;
}

.chip.tag-alias-chip a {
    color: var(--theme-text-muted);
}

/* Photo count badge */
.photo-count-badge {
    min-width: 40px;
    font-size: 0.85rem;
}

/* Tag relationships section */
.tag-relationships {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tag-parent-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-aliases-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.aliases-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Alias badge styling */
.tag-alias-badge {
    background-color: rgba(var(--theme-warning-rgb), 0.2);
    color: var(--theme-warning);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(var(--theme-warning-rgb), 0.3);
}

/* Light mode adjustments for alias badge */
body[class*="-light"] .tag-alias-badge {
    background-color: rgba(var(--theme-warning-rgb), 0.15);
    border-color: rgba(var(--theme-warning-rgb), 0.4);
}

/* Responsive tags table */
@media (max-width: 768px) {
    .tags-table thead {
        display: none;
    }

    .tags-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--theme-border);
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .tags-table tbody td {
        display: block;
        padding: 0.75rem 1rem;
        border: none;
        border-bottom: 1px solid var(--theme-border);
    }

    .tags-table tbody td:last-child {
        border-bottom: none;
    }

    .tags-table tbody td:first-child {
        display: none;
    }

    .tag-row-alias td:first-child {
        border-left: none;
    }

    .tag-row-alias {
        border-left: 3px solid var(--theme-text-muted) !important;
    }

    .tag-name-cell {
        flex-wrap: wrap;
    }

    .tag-relationships {
        flex-direction: column;
        align-items: flex-start;
    }

    .tag-aliases-list {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   TAGS MODAL - RESPONSIVE
   ============================================ */

/* Modal body */
.tags-modal-body {
    padding: 1rem;
}

.tags-modal-image-container {
    text-align: center;
}

.tags-modal-image {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    background-color: #fff;
    padding: 0.5rem;
    border: 1px solid var(--theme-border);
}

.tags-modal-content-card {
    height: 100%;
    min-height: 180px;
}

.tags-modal-content-card .card-body {
    padding: 1rem;
}

/* Modal footer forms */
.tags-modal-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0;
}

.tags-modal-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
}

.tags-modal-date-form,
.tags-modal-tag-form {
    flex: 1;
    min-width: 250px;
}

.tags-modal-divider {
    width: 1px;
    background-color: var(--theme-border);
    align-self: stretch;
    margin: 0 0.5rem;
}

.tags-modal-select {
    width: 120px !important;
    flex-shrink: 0;
}

.tags-modal-day {
    width: 65px !important;
    flex-shrink: 0;
}

.tags-modal-year {
    width: 75px !important;
    flex-shrink: 0;
}

.tags-modal-autocomplete-wrapper {
    flex: 1;
    min-width: 150px;
}

/* Tablet adjustments */
@media (max-width: 991px) {
    .tags-modal-forms {
        flex-direction: column;
        gap: 1rem;
    }

    .tags-modal-date-form,
    .tags-modal-tag-form {
        width: 100%;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--theme-border);
    }

    .tags-modal-tag-form {
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .tags-modal-image {
        max-height: 150px;
        margin-bottom: 1rem;
    }

    .tags-modal-content-card {
        min-height: auto;
    }

    .tags-modal-select {
        width: 100px !important;
    }

    .tags-modal-day {
        width: 55px !important;
    }

    .tags-modal-year {
        width: 65px !important;
    }

    /* Stack chips more compactly */
    .tags-general .chip,
    .tags-when .chip {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Small mobile */
@media (max-width: 575px) {
    .tags-modal-body {
        padding: 0.75rem;
    }

    .tags-modal-footer {
        padding: 0.75rem;
    }

    .modal-dialog-scrollable .modal-body {
        max-height: 50vh;
    }

    .tags-modal-date-form .d-flex,
    .tags-modal-tag-form .d-flex {
        flex-wrap: wrap;
    }

    .tags-modal-select {
        flex: 1;
        width: auto !important;
        min-width: 90px;
    }

    .tags-modal-autocomplete-wrapper {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   DRAG & DROP UPLOAD ZONE
   ============================================ */

.dropzone {
    border: 2px dashed var(--theme-border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--theme-surface);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.dropzone-active {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-style: solid;
    transform: scale(1.02);
}

.dropzone-has-file {
    border-style: solid;
    border-color: var(--theme-success, #22c55e);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dropzone-icon {
    font-size: 3rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.dropzone:hover .dropzone-icon,
.dropzone-active .dropzone-icon {
    color: var(--bs-primary);
    transform: translateY(-5px);
}

.dropzone-text {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.dropzone-secondary {
    font-size: 0.9rem;
    color: var(--theme-text-muted);
}

.dropzone-uploading {
    width: 100%;
    padding: 1rem;
}

.dropzone-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone-preview img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .dropzone {
        padding: 1.5rem 1rem;
        min-height: 150px;
    }

    .dropzone-icon {
        font-size: 2.5rem;
    }

    .dropzone-primary {
        font-size: 1rem;
    }
}

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */

.gallery-breadcrumb {
    margin-top: 1rem;
}

.gallery-breadcrumb .breadcrumb {
    background-color: var(--theme-elevated);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
    margin-bottom: 1rem;
}

.gallery-breadcrumb .breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gallery-breadcrumb .breadcrumb-item a:hover {
    color: var(--theme-primary-light);
    text-decoration: underline;
}

.gallery-breadcrumb .breadcrumb-item.active {
    color: var(--theme-text);
    font-weight: 500;
}

.gallery-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--theme-text-muted);
    content: ">";
    padding: 0 0.5rem;
}

/* ============================================
   ALBUM CONTROLS (Search & Sort)
   ============================================ */

.album-controls {
    background-color: var(--theme-elevated);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
}

.album-controls .btn-group .btn {
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .album-controls .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .album-controls .btn-group .btn i.me-1 {
        margin-right: 0 !important;
    }

    .album-controls .btn-group .btn span {
        display: none;
    }
}

/* ============================================
   DATE FILTER BAR
   ============================================ */

.date-filter-bar {
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
}

.date-filter-bar .form-select {
    min-width: 120px;
}

.date-filter-bar select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .date-filter-bar .row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .date-filter-bar .col-auto {
        width: 100%;
    }

    .date-filter-bar .form-select {
        width: 100%;
    }
}

/* ============================================
   SKELETON LOADERS
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--theme-border) 25%,
        var(--theme-elevated) 50%,
        var(--theme-border) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
}

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

.skeleton-card {
    pointer-events: none;
}

.skeleton-image {
    width: 100%;
    height: 280px;
    border-radius: 0.5rem;
}

.skeleton-photo {
    width: 100%;
    height: 200px;
    border-radius: 0.375rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-text {
    height: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text-short {
    height: 1rem;
    width: 40%;
}

.skeleton-button {
    height: 38px;
    width: 50px;
    border-radius: 0.375rem;
}

.skeleton-chip {
    height: 28px;
    width: 60px;
    border-radius: 1rem;
}

.skeleton-avatar {
    height: 40px;
    width: 40px;
    border-radius: 50%;
}

.skeleton-badge {
    height: 20px;
    width: 80px;
    border-radius: 0.25rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    pointer-events: auto;
    position: relative;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    padding-right: 2.5rem;
}

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

.toast-message {
    color: var(--theme-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--theme-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Toast types */
.toast-success {
    border-left: 4px solid var(--theme-success, #22c55e);
}

.toast-success .toast-icon {
    color: var(--theme-success, #22c55e);
}

.toast-success .toast-progress {
    background-color: var(--theme-success, #22c55e);
}

.toast-error {
    border-left: 4px solid var(--theme-danger, #ef4444);
}

.toast-error .toast-icon {
    color: var(--theme-danger, #ef4444);
}

.toast-error .toast-progress {
    background-color: var(--theme-danger, #ef4444);
}

.toast-warning {
    border-left: 4px solid var(--theme-warning, #f59e0b);
}

.toast-warning .toast-icon {
    color: var(--theme-warning, #f59e0b);
}

.toast-warning .toast-progress {
    background-color: var(--theme-warning, #f59e0b);
}

.toast-info {
    border-left: 4px solid var(--theme-info, #3b82f6);
}

.toast-info .toast-icon {
    color: var(--theme-info, #3b82f6);
}

.toast-info .toast-progress {
    background-color: var(--theme-info, #3b82f6);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* ============================================
   ALBUM STATISTICS
   ============================================ */

.album-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.album-stat {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--theme-text-muted);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.album-stat i {
    font-size: 0.8rem;
}

/* ============================================
   ACTIVITY DASHBOARD
   ============================================ */

/* Activity Stats Cards */
.activity-stat-card {
    display: flex;
    align-items: center;
    background-color: var(--theme-elevated);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--theme-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.bg-primary {
    background-color: var(--theme-primary);
}

.stat-icon.bg-success {
    background-color: var(--theme-success);
}

.stat-icon.bg-info {
    background-color: var(--theme-info);
}

.stat-icon.bg-warning {
    background-color: var(--theme-warning);
}

.stat-content {
    margin-left: 1rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
    line-height: 1.2;
}

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

/* Activity Section */
.activity-section {
    background-color: var(--theme-elevated);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--theme-border);
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--theme-border);
}

/* Recent Photo Cards */
.recent-photo-card {
    background-color: var(--theme-surface);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recent-photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recent-photo-card .photo-link {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.recent-photo-card .photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.photo-info {
    padding: 0.75rem;
}

.photo-album {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-text);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
}

.photo-date,
.photo-owner {
    display: inline-flex;
    align-items: center;
}

.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.mini-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--theme-primary-light);
    border-radius: 0.25rem;
}

/* Album List */
.album-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.album-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--theme-surface);
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.album-list-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--theme-primary);
}

.album-thumb {
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
}

.album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-details {
    margin-left: 1rem;
    min-width: 0;
    flex: 1;
}

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

.album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

.album-owner {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    margin-top: 0.25rem;
}

/* Empty state small */
.empty-state-small {
    text-align: center;
    padding: 2rem;
    color: var(--theme-text-muted);
}

.empty-state-small i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-state-small p {
    margin: 0;
}

/* Mobile adjustments for activity dashboard */
@media (max-width: 768px) {
    .activity-stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

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

    .album-thumb {
        width: 3rem;
        height: 3rem;
    }
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */

.global-search {
    position: relative;
}

.global-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-color: rgba(255, 255, 255, 0.3);
}

.global-search-trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-kbd {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 0.25rem;
    font-family: monospace;
    margin-left: 0.25rem;
}

.global-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-width: 90vw;
    margin-top: 0.5rem;
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    overflow: hidden;
}

.search-input-wrapper {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid var(--theme-border);
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-text-muted);
}

.search-input {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
    border-radius: 0.5rem;
}

.search-input:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-primary);
    color: var(--theme-text);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

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

.search-clear {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--theme-text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.search-clear:hover {
    color: var(--theme-text);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-border);
}

.search-section:last-child {
    border-bottom: none;
}

.search-section-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--theme-text-muted);
    letter-spacing: 0.05em;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--theme-text);
    transition: background-color 0.15s ease;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--theme-text);
}

.search-result-item.selected {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.result-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.result-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-subtitle {
    font-size: 0.75rem;
    color: var(--theme-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 1rem 0.5rem;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--theme-primary-light);
    border-radius: 1rem;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.search-tag:hover,
.search-tag.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.3);
    color: var(--theme-primary-light);
}

.search-tag.selected {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.search-tag .tag-count {
    margin-left: 0.375rem;
    font-size: 0.7rem;
    opacity: 0.7;
}

.search-no-results,
.search-hint {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--theme-text-muted);
}

.search-no-results i,
.search-hint i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.search-no-results p,
.search-hint p {
    margin: 0;
}

.search-suggestions {
    margin-top: 1rem;
    text-align: left;
    padding: 0 1rem;
}

.search-suggestions .suggestions-title {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--theme-text);
}

.search-suggestions ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8rem;
}

.search-suggestions li {
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.search-shortcuts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
}

.search-shortcuts kbd {
    padding: 0.125rem 0.375rem;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.7rem;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .global-search-dropdown {
        position: fixed;
        top: 60px;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-width: none;
    }
}

/* ============================================
   GALLERY VIEW MODES
   ============================================ */

.gallery-toolbar {
    padding: 0.75rem 1rem;
}

.view-mode-selector .btn {
    padding: 0.375rem 0.625rem;
}

.grid-size-range {
    width: 80px;
    height: 0.5rem;
}

/* Grid View (default) */
.gallery-grid .card {
    margin-bottom: 1rem;
}

/* Compact View */
.gallery-compact .card {
    margin-bottom: 0.5rem;
}

.gallery-compact .card-body {
    padding: 0.5rem;
}

.gallery-compact .thumbnail {
    min-height: auto !important;
}

.gallery-compact .thumbnail img {
    aspect-ratio: 1;
    object-fit: cover;
}

.gallery-compact .caption {
    display: none;
}

.gallery-compact .img-select,
.gallery-compact .img-tags,
.gallery-compact .img-cover,
.gallery-compact .img-delete {
    transform: scale(0.85);
}

.gallery-compact .img-select {
    top: 2px;
    right: 2px;
}

.gallery-compact .img-tags {
    top: 2px;
    right: 32px;
}

.gallery-compact .img-cover {
    top: 2px;
    right: 60px;
}

.gallery-compact .img-delete {
    top: 30px;
    right: 2px;
}

/* List View */
.gallery-list .card {
    margin-bottom: 0.5rem;
}

.gallery-list .card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem;
    gap: 1rem;
}

.gallery-list .thumbnail {
    min-height: auto !important;
    width: 120px;
    flex-shrink: 0;
    position: relative;
}

.gallery-list .thumbnail img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
}

.gallery-list .caption {
    flex: 1;
    min-width: 0;
}

.gallery-list .caption h3 {
    display: none;
}

.gallery-list .caption p {
    display: none;
}

.gallery-list .img-select,
.gallery-list .img-tags,
.gallery-list .img-cover,
.gallery-list .img-delete {
    position: relative;
    top: auto;
    right: auto;
    opacity: 1;
    background: transparent;
    display: inline-flex;
}

.gallery-list .card-body > .img-select,
.gallery-list .card-body > .img-tags,
.gallery-list .card-body > .img-cover,
.gallery-list .card-body > .img-delete {
    order: 10;
}

.gallery-list .list-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.gallery-list .list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gallery-list .list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.gallery-list .list-date {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

/* Responsive adjustments for list view */
@media (max-width: 768px) {
    .gallery-list .thumbnail {
        width: 80px;
    }

    .gallery-list .thumbnail img {
        width: 80px;
        height: 60px;
    }

    .gallery-toolbar .grid-size-selector {
        display: none;
    }
}

/* ============================================
   KEYBOARD SHORTCUTS MODAL
   ============================================ */

.shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    padding: 1rem;
}

.shortcuts-modal {
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

.shortcuts-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.shortcuts-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--theme-border);
    text-align: center;
}

.shortcut-section {
    margin-bottom: 1rem;
}

.shortcut-section:last-child {
    margin-bottom: 0;
}

.shortcut-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--theme-primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--theme-border);
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.shortcut-keys kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    color: var(--theme-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.shortcut-desc {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.shortcuts-footer kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-family: monospace;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    color: var(--theme-text);
}

/* ============================================
   USER AVATAR
   ============================================ */

.avatar-section {
    padding: 1.5rem;
    background-color: var(--theme-elevated);
    border-radius: 0.5rem;
    border: 1px solid var(--theme-border);
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--theme-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder span {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Navbar Avatar */
.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-right: 0.5rem;
}

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

.navbar-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

/* Photo Picker Modal */
.photo-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    padding: 1rem;
}

.photo-picker-modal {
    background-color: var(--theme-elevated);
    border: 1px solid var(--theme-border);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.photo-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--theme-border);
    color: var(--theme-text);
}

.photo-picker-body {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

/* Album List in Picker */
.picker-album-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.picker-album-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-album-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--theme-primary);
}

.picker-album-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
}

.picker-album-info {
    flex: 1;
}

.picker-album-name {
    font-weight: 600;
    color: var(--theme-text);
}

.picker-album-count {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

/* Photo Grid in Picker */
.picker-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.picker-photo-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.picker-photo-item:hover {
    border-color: var(--theme-primary);
    transform: scale(1.02);
}

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

/* Photo Picker Tabs */
.photo-picker-tabs {
    display: flex;
    border-bottom: 1px solid var(--theme-border);
    padding: 0 1rem;
    background-color: var(--theme-elevated);
}

.picker-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--theme-text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-tab:hover {
    color: var(--theme-text);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.picker-tab.active {
    color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

/* Tag Search in Picker */
.picker-tag-search {
    position: sticky;
    top: 0;
    background-color: var(--theme-elevated);
    padding-bottom: 0.5rem;
    z-index: 1;
}

.picker-tag-search .input-group-text {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text-muted);
}

.picker-tag-search .form-control {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.picker-tag-search .form-control:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-primary);
    color: var(--theme-text);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.picker-tag-search .form-control::placeholder {
    color: var(--theme-text-muted);
}

.picker-tag-search .btn-outline-secondary {
    border-color: var(--theme-border);
    color: var(--theme-text-muted);
}

.picker-tag-search .btn-outline-secondary:hover {
    background-color: var(--theme-surface);
    color: var(--theme-text);
}

/* Tag List in Picker */
.picker-tag-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.picker-tag-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-tag-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--theme-primary);
}

.picker-tag-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--theme-primary);
    border-radius: 0.375rem;
    margin-right: 1rem;
    font-size: 1rem;
}

.picker-tag-info {
    flex: 1;
}

.picker-tag-name {
    font-weight: 600;
    color: var(--theme-text);
}

.picker-tag-count {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

@media (max-width: 576px) {
    .picker-photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .avatar-preview {
        width: 80px;
        height: 80px;
    }

    .avatar-placeholder span {
        font-size: 2rem;
    }
}

/* ============================================== */
/* Album Header - Hero Banner                     */
/* ============================================== */
.album-header-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 0.5rem;
    min-height: 200px;
    margin-bottom: 1rem;
    z-index: 1025;
}

.album-header-hero .hero-overlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 100%);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 0.5rem;
}

.album-header-hero .hero-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.album-header-hero .hero-cover {
    flex-shrink: 0;
}

.album-header-hero .hero-cover img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.2);
    transition: transform 0.2s ease;
}

.album-header-hero .hero-cover img:hover {
    transform: scale(1.02);
}

.album-header-hero .hero-cover-placeholder {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    border: 3px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

.album-header-hero .hero-info {
    flex: 1;
    min-width: 200px;
}

.album-header-hero .hero-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.album-header-hero .hero-description {
    color: rgba(255,255,255,0.85);
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.album-header-hero .hero-meta {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.album-header-hero .hero-meta span {
    display: inline-flex;
    align-items: center;
}

.album-header-hero .hero-actions {
    flex-shrink: 0;
    position: relative;
    z-index: 1030;
}

.album-header-hero .hero-actions .dropdown-menu {
    z-index: 1050;
}

.album-header-hero .hero-actions .btn-light {
    background-color: rgba(255,255,255,0.95);
    border: none;
    font-weight: 500;
}

.album-header-hero .hero-actions .btn-light:hover {
    background-color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .album-header-hero .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .album-header-hero .hero-cover img {
        width: 120px;
        height: 120px;
    }

    .album-header-hero .hero-title {
        font-size: 1.5rem;
    }

    .album-header-hero .hero-meta span {
        display: block;
        margin: 0.25rem 0;
    }

    .album-header-hero .hero-meta span.ms-3 {
        margin-left: 0 !important;
    }
}

/* ============================================== */
/* Slideshow Settings Modal                       */
/* ============================================== */
.slideshow-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.slideshow-settings-content {
    position: relative;
    background-color: var(--theme-elevated);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

.slideshow-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--theme-border);
}

.slideshow-settings-header h5 {
    margin: 0;
    color: var(--theme-text);
    font-weight: 600;
}

.slideshow-settings-body {
    padding: 1.25rem;
}

.slideshow-settings-body .form-label {
    color: var(--theme-text);
    font-weight: 500;
}

.slideshow-settings-body .form-control {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.slideshow-settings-body .form-control:focus {
    background-color: var(--theme-surface);
    border-color: var(--theme-primary);
    color: var(--theme-text);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.slideshow-settings-body .form-check-label {
    color: var(--theme-text);
}

.slideshow-settings-body .form-text {
    color: var(--theme-text-muted);
}

.slideshow-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--theme-border);
}

/* ============================================== */
/* Share Avatar Styles                            */
/* ============================================== */
.share-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}
