/**
 * Media Management System - Main Stylesheet
 * Modern, clean design with dark/light theme support
 */

/* ============================================
   CSS Variables & Theme Support
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);

    /* Accent Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Light Theme (default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;

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

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

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

a:hover {
    color: var(--primary-hover);
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + 24px) 24px 24px;
    transition: var(--transition);
}

@media (max-width: 991px) {
    .main-content {
        margin-left: 0;
    }
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

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

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

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

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

/* Mobile Sidebar */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: var(--transition);
}

@media (max-width: 991px) {
    .header {
        left: 0;
    }
}

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

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

@media (max-width: 991px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.theme-toggle i.fa-sun {
    display: none;
}

.theme-toggle i.fa-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle i.fa-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle i.fa-moon {
    display: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--primary-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

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

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

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

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-warning {
    background: var(--warning);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* ============================================
   Upload Zone
   ============================================ */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone.dragover {
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

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

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

.upload-subtitle span {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

/* ============================================
   Upload Queue
   ============================================ */
.upload-queue {
    margin-top: 24px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.upload-preview {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.upload-preview i {
    font-size: 1.5rem;
    color: var(--text-muted);
}

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

.upload-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 0.75rem;
    margin-top: 4px;
}

.upload-status.uploading {
    color: var(--primary);
}

.upload-status.completed {
    color: var(--success);
}

.upload-status.failed {
    color: var(--danger);
}

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

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

/* List View Mode */
.gallery-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

.gallery-grid.list-view .gallery-item {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.gallery-grid.list-view .gallery-thumb {
    width: 80px;
    height: 80px;
    aspect-ratio: 1;
    flex-shrink: 0;
}

.gallery-grid.list-view .gallery-info {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-grid.list-view .gallery-overlay {
    position: static;
    background: none;
    opacity: 1;
    padding: 0 16px;
}

.gallery-grid.list-view .gallery-overlay .btn {
    background: var(--bg-tertiary);
}

/* Folders list view */
.folders-grid.list-view {
    grid-template-columns: 1fr !important;
}

.folders-grid.list-view .folder-item {
    padding: 12px 16px;
}

.gallery-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-thumb {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

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

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

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

.gallery-action {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    transform: translateY(10px);
}

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

.gallery-action:hover {
    background: var(--primary);
    color: white;
}

.video-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modal Content height consistency */
.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    /* Consistent max height */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent overflow outside radius */
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-body {
    overflow-y: auto;
    /* Allow scrolling for content */
    flex: 1;
}

.gallery-info {
    padding: 12px;
}

.gallery-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* Gallery Selection */
.gallery-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-select,
.gallery-item.selected .gallery-select {
    opacity: 1;
}

.gallery-select .fa-check-square {
    display: none;
    color: var(--primary);
}

.gallery-select .fa-square {
    color: var(--text-muted);
}

.gallery-item.selected .gallery-select .fa-check-square {
    display: block;
}

.gallery-item.selected .gallery-select .fa-square {
    display: none;
}

.gallery-item.selected {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.gallery-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Folder drag-over state */
.folder-item.drag-over {
    outline: 3px solid var(--primary);
    background: var(--primary-light) !important;
}

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 99999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop.active {
    display: flex !important;
}

.modal {
    background: var(--bg-secondary);
    background-color: #ffffff;
    border-radius: var(--radius);
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    margin: auto;
    position: relative;
}

[data-theme="dark"] .modal {
    background-color: #1e293b;
}

.modal-backdrop.active .modal {
    display: block;
}

.modal-lg {
    width: 800px;
}

.modal-xl {
    width: 1200px;
}

.modal-fullscreen {
    width: 100%;
    height: 100%;
}

/* Custom Video Player */
.video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-player video {
    width: 100%;
    display: block;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-player:hover .video-controls {
    opacity: 1;
}

.video-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.video-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
}

.video-progress:hover {
    height: 6px;
}

.video-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.9;
    transition: var(--transition);
}

.video-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.video-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-family: monospace;
}

.video-btn.play-btn {
    font-size: 1.25rem;
}

.video-volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-volume input[type="range"] {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.video-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

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

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

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

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

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

/* Preview Modal */
.preview-modal .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    max-height: 80vh;
}

.preview-modal img,
.preview-modal video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

select.form-control {
    cursor: pointer;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.toast-content {
    flex: 1;
}

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

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ============================================
   Storage Progress
   ============================================ */
.storage-widget {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

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

.storage-used {
    font-weight: 600;
    color: var(--text-primary);
}

.storage-total {
    color: var(--text-secondary);
}

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

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
}

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

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

/* ============================================
   Folder Grid
   ============================================ */
.folder-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.folder-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.folder-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.folder-name {
    font-weight: 500;
    color: var(--text-primary);
}

.folder-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Folder Selection Checkbox */
.folder-select {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.folder-item:hover .folder-select,
.folder-item.selected .folder-select {
    opacity: 1;
}

.folder-select .fa-square {
    display: block;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.folder-select .fa-check-square {
    display: none;
    color: var(--primary);
    font-size: 1.1rem;
}

.folder-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.folder-item.selected .folder-select .fa-square {
    display: none;
}

.folder-item.selected .folder-select .fa-check-square {
    display: block;
}

.folder-item.dragging {
    opacity: 0.5;
}

/* ============================================
   Tags
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================
   QR Code Section
   ============================================ */
.qr-preview {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    display: inline-block;
}

.qr-preview img {
    display: block;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   Utilities
   ============================================ */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.bg-primary {
    background: var(--primary) !important;
}

.bg-success {
    background: var(--success) !important;
}

.bg-danger {
    background: var(--danger) !important;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-4 {
    margin-top: 24px;
}

.p-4 {
    padding: 24px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 12px;
}

.gap-3 {
    gap: 16px;
}

.gap-4 {
    gap: 24px;
}

/* ============================================
   Login Page
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

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

.auth-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 12px;
    color: var(--text-primary);
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}