/**
 * مركز الوليد - ملف التنسيقات الرئيسي الشامل والمُحسّن
 * Al-Walid Center - Core Clean & Fully Responsive Stylesheet
 * Optimized for Mobile (320px - 430px), Tablets, and Desktops
 * Dark / Light Themes, RTL / LTR Support, Touch-Friendly UI/UX
 */

:root {
    --font-ar: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-en: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Light Theme (Default fallback) */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --accent: #6366f1;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --touch-min: 44px;
}

[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-alt: #1f2937;
    --bg-card: #141e33;
    --border-color: #1e293b;
    --border-hover: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.12);
    --primary-glow: rgba(59, 130, 246, 0.25);

    --accent: #818cf8;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ========================================================
   Global Reset & Accessibility
   ======================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    max-width: 100%;
}

body {
    font-family: var(--font-ar);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

html[lang="en"] body {
    font-family: var(--font-en);
}

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

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: 0.95rem;
    touch-action: manipulation;
}

/* ========================================================
   Navbar & Navigation Header
   ======================================================== */
.navbar {
    background-color: rgba(17, 24, 39, 0.92);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    transition: var(--transition);
}

[data-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.92);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin-inline-start: 0.4rem;
    white-space: nowrap;
}

/* Desktop Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    white-space: nowrap;
}

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

.nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Theme & Lang Toggles */
.theme-toggle, .lang-toggle, .mobile-menu-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0 0.5rem;
}

.lang-toggle {
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0 0.65rem;
}

.theme-toggle:hover, .lang-toggle:hover, .mobile-menu-btn:hover {
    background-color: var(--border-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Mobile Menu Button (Hamburger) */
.mobile-menu-btn {
    display: none;
}

.mobile-menu-btn .menu-close-icon {
    display: none;
}

.mobile-menu-btn.active .menu-open-icon {
    display: none;
}

.mobile-menu-btn.active .menu-close-icon {
    display: block;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    display: none;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem 1.25rem;
    animation: fadeIn 0.2s ease;
}

.mobile-nav-drawer.active {
    display: block;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    min-height: var(--touch-min);
    transition: var(--transition);
}

.mobile-nav-link svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.mobile-nav-link.active svg {
    color: var(--primary);
}

.mobile-nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* ========================================================
   Buttons
   ======================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    user-select: none;
    text-align: center;
    min-height: 40px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px var(--primary-glow);
}

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

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

.btn-danger {
    background-color: var(--danger);
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    min-height: 34px;
}

.btn-xs {
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    min-height: 28px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    min-height: 48px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.btn-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* ========================================================
   Main Container & Layouts
   ======================================================== */
.main-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    flex: 1;
}

.max-w-900 { max-width: 900px; margin-left: auto; margin-right: auto; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }
.max-w-700 { max-width: 700px; margin-left: auto; margin-right: auto; }
.max-w-500 { max-width: 500px; margin-left: auto; margin-right: auto; }

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Homepage Disclaimer Banner */
.disclaimer-banner {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.7;
    font-size: 0.92rem;
    box-shadow: var(--shadow-sm);
}

.disclaimer-banner svg {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* ========================================================
   Upload Dropzone
   ======================================================== */
.upload-card {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 1.75rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.upload-card:hover, .upload-card.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px var(--primary-glow);
}

.upload-icon-anim {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.25rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.upload-card:hover .upload-icon-anim {
    transform: scale(1.08) translateY(-3px);
    background: var(--primary);
    color: #ffffff;
}

.upload-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.upload-limits {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ========================================================
   Pre-Upload Staging Box
   ======================================================== */
.staging-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.25s ease;
}

.staging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.staging-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.staging-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 1.25rem;
    padding-inline-end: 0.25rem;
}

.staging-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-surface-alt);
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
}

.staging-item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    flex: 1;
}

.staging-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.staging-item-size {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.staging-item-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.staging-item-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.staging-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========================================================
   Live Upload Queue
   ======================================================== */
.upload-queue {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.queue-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.queue-file-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    flex: 1;
}

.queue-file-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.queue-file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.queue-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.queue-percent {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.progress-track {
    width: 100%;
    height: 7px;
    background-color: var(--bg-surface-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    transition: width 0.15s linear;
}

/* ========================================================
   Upload Results Section (Owner / Uploader Only)
   ======================================================== */
.results-section {
    margin-top: 2.5rem;
    animation: fadeIn 0.3s ease;
}

.results-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.results-success-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--success-light);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}

.results-cards-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition);
}

.result-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.result-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.result-file-details {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    overflow: hidden;
    flex: 1;
}

.result-links-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-link-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.result-link-label {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.result-link-field {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.result-link-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.result-link-input:focus {
    border-color: var(--primary);
}

.result-badge-secret {
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.result-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* ========================================================
   Form Controls (Unified & Consistent)
   ======================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.form-control, .form-input, .form-textarea, .form-select {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.95rem;
    background: var(--bg-surface-alt);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition);
    line-height: 1.5;
}

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

.form-control:focus, .form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: var(--bg-surface);
}

.d-flex > .form-input,
.d-flex > .form-control,
.d-flex > .form-select {
    flex: 1;
    min-width: 0;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.char-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: end;
    margin-top: 0.25rem;
}

.file-input-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    background: var(--bg-surface-alt);
    cursor: pointer;
    transition: var(--transition);
}

.file-input-wrapper:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

/* Alerts */
.alert {
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.6;
}

.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }

/* ========================================================
   Category Badges
   ======================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.category-image { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.category-video { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.category-audio { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.category-document { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.category-archive { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.category-text { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.category-other { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-secondary { background: var(--bg-surface-alt); color: var(--text-secondary); }

/* ========================================================
   Modals
   ======================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.96);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
}

.modal.active .modal-dialog {
    transform: scale(1);
}

.modal-dialog-large {
    max-width: 900px;
}

.modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* ========================================================
   Tables & Responsive Data Display
   ======================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: inherit;
    min-width: 650px;
}

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table th {
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-link {
    color: var(--primary);
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ========================================================
   Legal, FAQ & Guide Pages
   ======================================================== */
.legal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
}

.legal-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 0.85rem;
}

.legal-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-section p, .legal-section ul {
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 0.85rem;
}

.legal-section ul {
    padding-inline-start: 1.5rem;
}

.legal-section li {
    margin-bottom: 0.45rem;
}

/* FAQ Accordion */
.faq-search-box {
    margin-bottom: 2rem;
}

.faq-accordion, .faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-surface-alt);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.faq-chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
    color: var(--text-muted);
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    display: none;
    padding: 0 1.35rem 1.25rem 1.35rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
    border-top: 1px solid transparent;
}

.faq-item.active .faq-answer {
    display: block;
    border-top-color: var(--border-color);
    padding-top: 1rem;
    background: var(--bg-surface);
}

/* How to Use Steps */
.steps-container, .steps-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.step-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    align-items: flex-start;
    transition: var(--transition);
}

.step-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.step-card.highlight-step {
    border-color: var(--warning);
    background: var(--warning-light);
}

.step-number, .step-num {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    flex-shrink: 0;
}

.step-card.highlight-step .step-number {
    background: var(--warning);
}

.step-content {
    flex: 1;
}

.step-icon-wrap {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.step-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
}

/* ========================================================
   Share & Manage Pages - UI/UX Refined
   ======================================================== */
.share-container {
    max-width: 820px;
    margin: 2rem auto;
    width: 100%;
}

.share-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--border-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

/* Header & File Identity */
.share-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.file-type-badge {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-xl);
    background: var(--bg-surface-alt);
    border: 1.5px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 0.15rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.file-type-badge:hover {
    transform: translateY(-2px);
}

.file-badge-icon svg {
    display: block;
}

.file-badge-ext {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
}

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

.share-file-title {
    font-size: 1.38rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
    margin: 0 0 0.5rem 0;
}

.share-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.meta-chip svg {
    color: var(--text-muted);
}

.meta-chip.chip-warning {
    background: var(--warning-light);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.meta-chip.chip-warning svg {
    color: var(--warning);
}

/* Preview Area */
.share-preview-area {
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    position: relative;
}

/* Image preview */
.img-preview-container {
    position: relative;
    background: #080d1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    max-height: 520px;
}

.preview-img-element {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.img-preview-toolbar {
    position: absolute;
    bottom: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 5;
}

.img-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: var(--transition);
}

.img-preview-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* Video preview */
.video-preview-container {
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-video-element {
    width: 100%;
    max-height: 480px;
    display: block;
    outline: none;
}

/* Audio preview */
.audio-preview-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-surface-alt) 0%, var(--bg-surface) 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-icon-pulse {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-title-wrap {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-audio-element {
    width: 100%;
    outline: none;
    border-radius: var(--radius-md);
}

/* PDF Preview */
.pdf-preview-container {
    position: relative;
    background: var(--bg-surface-alt);
}

.pdf-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.pdf-preview-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pdf-iframe {
    width: 100%;
    height: 520px;
    border: none;
    display: block;
}

/* Text / Code Preview */
.text-preview-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.text-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.8rem;
}

.text-code-box {
    width: 100%;
    max-height: 450px;
    overflow: auto;
    padding: 1.25rem;
    background: #050811;
    color: #e2e8f0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    text-align: left;
    direction: ltr;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* Non-previewable / Direct Download placeholder */
.preview-placeholder-card {
    padding: 2.75rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-surface-alt) 0%, var(--bg-surface) 100%);
}

.placeholder-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.placeholder-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.placeholder-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    max-width: 420px;
    margin: 0;
}

/* Action Buttons Bar */
.share-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.75rem;
}

.share-btn-download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.95rem 1.5rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.share-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.share-btn-download .btn-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.share-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.share-secondary-actions .btn {
    flex: 1;
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.92rem;
}

/* QR Code Card */
.share-qr-card {
    margin-top: 2rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.qr-card-header svg {
    color: var(--primary);
}

.qr-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.qr-canvas-wrap {
    padding: 0.75rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: inline-block;
    line-height: 0;
}

.qr-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    max-width: 320px;
    margin: 0;
}

/* Password Form Enhancements */
.password-box {
    padding: 2rem 1rem;
}

.lock-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-full);
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.05);
}

.password-input-wrap {
    position: relative;
    width: 100%;
}

.btn-toggle-pass {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.75rem;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: color 0.18s ease;
}

.btn-toggle-pass:hover {
    color: var(--text-primary);
}

.manage-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* ========================================================
   Admin Control Panel
   ======================================================== */
.auth-card-wrap {
    max-width: 440px;
    margin: 3rem auto;
    width: 100%;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.dashboard-tabs {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.35rem;
}

.dashboard-tabs::-webkit-scrollbar {
    display: none;
}

.dash-tab {
    padding: 0.75rem 1.15rem;
    background: transparent;
    border: none;
    border-bottom: 2.5px solid transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dash-tab:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.dash-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    box-shadow: var(--shadow-sm);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.kpi-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: block;
    margin-bottom: 0.2rem;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-alt);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body {
    padding: 1.25rem;
}

.info-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-title {
    color: var(--text-muted);
    font-weight: 600;
}

.info-val {
    font-weight: 700;
}

/* ========================================================
   Footer
   ======================================================== */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.footer-disclaimer {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0.85rem auto;
    line-height: 1.7;
    padding: 0 0.5rem;
}

.developer-credit, .copyright-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.developer-credit a, .copyright-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.developer-credit a:hover, .copyright-text a:hover {
    text-decoration: underline;
}

/* ========================================================
   Utilities & Animations
   ======================================================== */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }
.text-center { text-align: center; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none !important; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.w-100 { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

.spinner {
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   RESPONSIVE DESIGN & MOBILE BREAKPOINTS
   Exact support for: 320px, 360px, 375px, 390px, 414px, 430px
   Tablets (768px - 1024px), Desktop (1200px+)
   ======================================================== */

/* Tablet & Mobile (< 992px) */
@media (max-width: 992px) {
    .manage-layout {
        grid-template-columns: 1fr;
    }
}

/* Mobile & Small Tablets (< 768px) */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }

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

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.98rem;
    }

    .upload-card {
        padding: 2.25rem 1.25rem;
    }

    .upload-icon-anim {
        width: 58px;
        height: 58px;
        margin-bottom: 1rem;
    }

    .legal-card, .share-card {
        padding: 1.5rem 1.15rem;
    }

    .legal-title {
        font-size: 1.5rem;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.col-span-2 {
        grid-column: span 1;
    }

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

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-header .d-flex.flex-wrap {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .results-header .d-flex.flex-wrap #btnUploadMore {
        grid-column: span 2;
    }
}

/* Standard Mobile Phones (< 576px) */
@media (max-width: 576px) {
    .main-container {
        padding: 1.25rem 0.85rem;
    }

    .nav-container {
        padding: 0.65rem 0.85rem;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
    }

    .brand-badge {
        display: none;
    }

    .nav-actions .btn {
        display: none;
    }

    .hero-section {
        margin-bottom: 1.5rem;
    }

    .disclaimer-banner {
        padding: 0.85rem 1rem;
        font-size: 0.86rem;
    }

    .upload-card {
        padding: 1.75rem 1rem;
        border-radius: var(--radius-lg);
    }

    .upload-title {
        font-size: 1.15rem;
    }

    .upload-subtitle {
        font-size: 0.88rem;
        margin-bottom: 1.15rem;
    }

    .upload-limits {
        font-size: 0.78rem;
        flex-direction: column;
        gap: 0.35rem;
    }

    .staging-box {
        padding: 1rem 0.85rem;
    }

    .staging-item-name {
        max-width: 160px;
    }

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

    .staging-actions .btn {
        width: 100%;
    }

    .result-card {
        padding: 1.15rem 0.95rem;
        border-radius: var(--radius-lg);
    }

    .result-link-field {
        flex-direction: column;
        gap: 0.4rem;
    }

    .result-link-field .btn {
        width: 100%;
    }

    .result-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .result-card-actions > div {
        width: 100%;
    }

    .result-card-actions .d-flex {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.4rem;
        width: 100%;
    }

    .result-card-actions .btn {
        width: 100%;
        padding: 0.45rem 0.5rem;
        font-size: 0.82rem;
    }

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

    .step-card {
        padding: 1.15rem 1rem;
        gap: 0.85rem;
    }

    .step-number, .step-num {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .step-content h3 {
        font-size: 1.05rem;
    }

    .modal-dialog {
        padding: 0;
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-header {
        padding: 1rem 1.15rem;
    }

    .modal-body {
        padding: 1.15rem 1rem;
    }

    .share-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .share-file-meta {
        justify-content: center;
    }

    .share-actions-bar {
        flex-direction: column;
    }

    .share-secondary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .share-secondary-actions .btn {
        width: 100%;
        min-width: 0;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    .share-secondary-actions #btnOpenReportModal {
        grid-column: span 2;
    }

    .footer {
        padding: 1.5rem 1rem;
    }

    .footer-links {
        gap: 0.5rem 1rem;
        font-size: 0.82rem;
    }
}

/* Small Phones: 320px - 375px */
@media (max-width: 375px) {
    .nav-container {
        padding: 0.5rem 0.65rem;
        gap: 0.4rem;
    }

    .brand-title {
        font-size: 0.96rem;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .theme-toggle, .lang-toggle, .mobile-menu-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 0.4rem;
    }

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

    .legal-card, .share-card, .result-card {
        padding: 1rem 0.75rem;
    }

    .staging-item-name {
        max-width: 110px;
    }

    .staging-item-size {
        font-size: 0.74rem;
    }

    .result-card-actions .d-flex {
        grid-template-columns: 1fr;
    }

    .share-secondary-actions {
        grid-template-columns: 1fr;
    }

    .share-secondary-actions #btnOpenReportModal {
        grid-column: span 1;
    }
}

/* ========================================================
   Modern App Preloader (UI/UX Loading Screen)
   ======================================================== */
.app-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform, visibility;
}

.app-preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.025);
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    position: relative;
}

.preloader-brand-icon {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(99, 102, 241, 0.22) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px var(--primary-glow);
    margin-bottom: 1.4rem;
    animation: preloaderIconFloat 2.6s ease-in-out infinite alternate;
}

.preloader-ring {
    position: absolute;
    inset: -6px;
    border-radius: calc(var(--radius-xl) + 6px);
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: preloaderSpin 1.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.preloader-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
    letter-spacing: -0.02em;
}

.preloader-bar-wrap {
    width: 170px;
    height: 4px;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.preloader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
    background-size: 200% 100%;
    animation: preloaderIndeterminate 1.3s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

@keyframes preloaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes preloaderIconFloat {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 25px var(--primary-glow);
    }
    100% {
        transform: translateY(-5px) scale(1.04);
        box-shadow: 0 0 45px var(--primary-glow);
    }
}

@keyframes preloaderIndeterminate {
    0% {
        left: -45%;
        width: 30%;
    }
    50% {
        width: 60%;
    }
    100% {
        left: 100%;
        width: 30%;
    }
}

/* ========================================================
   Modern 404 Error Page Styles
   ======================================================== */
.page-404 {
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-404-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.error-404-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3.5rem 2.5rem;
    max-width: 720px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: errorCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes errorCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.error-visual-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.error-glow-bg {
    position: absolute;
    width: 240px;
    height: 130px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(99, 102, 241, 0.1) 60%, transparent 80%);
    filter: blur(28px);
    z-index: 0;
    pointer-events: none;
}

.error-number-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-family: var(--font-en);
}

.error-digit {
    font-size: 6.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    user-select: none;
}

.error-center-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
    animation: errorIconPulse 2.4s ease-in-out infinite;
}

@keyframes errorIconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.35);
    }
}

.error-text-content {
    margin-bottom: 2.2rem;
}

.error-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.error-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 520px;
    margin: 0 auto;
}

.error-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 2.4rem;
}

.error-quick-links-box {
    border-top: 1px solid var(--border-color);
    padding-top: 1.8rem;
    margin-top: 1rem;
}

.quick-links-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.quick-links-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.quick-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.quick-link-pill:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .error-404-card {
        padding: 2.2rem 1.25rem;
    }

    .error-digit {
        font-size: 4.5rem;
    }

    .error-center-icon {
        width: 60px;
        height: 60px;
    }

    .error-center-icon svg {
        width: 38px;
        height: 38px;
    }

    .error-title {
        font-size: 1.35rem;
    }

    .error-desc {
        font-size: 0.95rem;
    }

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

    .error-actions-group .btn {
        width: 100%;
        justify-content: center;
    }
}

