/* ============================================================
   assets/css/style.css  –  FileVault UI
   Modern, clean SaaS style with dark-mode support
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
    --fv-primary: #4f6ef7;
    --fv-primary-hover: #3b5be0;
    --fv-success: #22c55e;
    --fv-danger: #ef4444;
    --fv-warning: #f59e0b;

    --fv-bg: #f4f6fb;
    --fv-surface: #ffffff;
    --fv-surface-2: #f8f9fe;
    --fv-border: rgba(0, 0, 0, 0.07);
    --fv-text: #1e2030;
    --fv-text-muted: #6b7280;
    --fv-shadow: 0 2px 20px rgba(79, 110, 247, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.05);
    --fv-shadow-hover: 0 8px 32px rgba(79, 110, 247, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.08);

    --fv-radius: 16px;
    --fv-radius-sm: 10px;
    --fv-transition: 0.22s ease;
}

/* Dark mode overrides */
[data-bs-theme="dark"] {
    --fv-bg: #0f1117;
    --fv-surface: #1a1d2e;
    --fv-surface-2: #22263a;
    --fv-border: rgba(255, 255, 255, 0.07);
    --fv-text: #e8eaf6;
    --fv-text-muted: #9095a8;
    --fv-shadow: 0 2px 20px rgba(0, 0, 0, 0.4),
        0 1px 4px rgba(0, 0, 0, 0.3);
    --fv-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Base ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--fv-bg);
    color: var(--fv-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--fv-transition), color var(--fv-transition);
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar-glass {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--fv-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: background var(--fv-transition);
}

[data-bs-theme="dark"] .navbar-glass {
    background: rgba(26, 29, 46, 0.88);
}

.navbar-brand {
    font-size: 1.2rem;
    letter-spacing: -0.3px;
}

.nav-link {
    color: var(--fv-text-muted) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem !important;
    border-radius: var(--fv-radius-sm);
    transition: color var(--fv-transition), background var(--fv-transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--fv-primary) !important;
    background: rgba(79, 110, 247, 0.07);
}

/* ── Layout ───────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 3rem 0 4rem;
}

/* ── Shadows ──────────────────────────────────────────────── */
.shadow-soft {
    box-shadow: var(--fv-shadow);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--fv-surface);
    border: 1px solid var(--fv-border);
    border-radius: var(--fv-radius);
    transition: box-shadow var(--fv-transition);
}

.upload-card,
.download-card {
    border: none;
}

.upload-card:hover {
    box-shadow: var(--fv-shadow-hover);
}

/* ── Hero Icon ────────────────────────────────────────────── */
.hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.12), rgba(79, 110, 247, 0.22));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--fv-primary);
}

.hero-icon--error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.22));
    color: var(--fv-danger);
}

.hero-icon--warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.22));
    color: var(--fv-warning);
}

/* ── Drop Zone ────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed rgba(79, 110, 247, 0.3);
    border-radius: var(--fv-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--fv-transition),
        background var(--fv-transition),
        transform var(--fv-transition);
    background: var(--fv-surface-2);
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--fv-primary);
    background: rgba(79, 110, 247, 0.04);
    transform: translateY(-2px);
}

.drop-zone.drag-over {
    border-style: solid;
    background: rgba(79, 110, 247, 0.07);
}

.drop-icon {
    font-size: 3rem;
    color: var(--fv-primary);
    opacity: 0.7;
    line-height: 1;
    transition: transform var(--fv-transition);
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    transform: scale(1.1) translateY(-3px);
}

.file-preview-icon {
    font-size: 3rem;
    color: var(--fv-primary);
    line-height: 1;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress {
    border-radius: 999px;
    background: var(--fv-surface-2);
    border: 1px solid var(--fv-border);
}

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--fv-primary), #7c8ff7);
    transition: width 0.15s ease;
}

/* ── Alerts (Success / Error) ─────────────────────────────── */
.alert-success-custom {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--fv-radius);
    padding: 1.25rem 1.5rem;
    color: var(--fv-text);
}

.alert-danger-custom {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: var(--fv-radius);
    padding: 1rem 1.5rem;
    color: var(--fv-text);
}

.success-check-icon {
    font-size: 1.6rem;
    color: var(--fv-success);
    margin-top: 2px;
}

/* ── Download Card ────────────────────────────────────────── */
.file-icon-lg {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--fv-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.file-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--fv-text-muted);
    background: var(--fv-surface-2);
    border: 1px solid var(--fv-border);
    border-radius: var(--fv-radius-sm);
    padding: 0.6rem 0.9rem;
    justify-content: center;
}

.file-meta-item i {
    color: var(--fv-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.download-btn {
    border-radius: 999px;
    padding: 0.7rem 2.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--fv-primary), #7c8ff7);
    border: none;
    transition: transform var(--fv-transition), box-shadow var(--fv-transition), filter var(--fv-transition);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.35);
    filter: brightness(1.05);
    background: linear-gradient(135deg, var(--fv-primary), #7c8ff7);
    border: none;
}

/* ── History Table ────────────────────────────────────────── */
.history-table {
    font-size: 0.875rem;
}

.history-table thead th {
    background: var(--fv-surface-2);
    color: var(--fv-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--fv-border);
    padding: 0.85rem 0.75rem;
}

.history-table thead th:first-child {
    border-radius: var(--fv-radius) 0 0 0;
}

.history-table thead th:last-child {
    border-radius: 0 var(--fv-radius) 0 0;
}

.history-table tbody tr {
    transition: background var(--fv-transition);
    border-bottom: 1px solid var(--fv-border);
}

.history-table tbody tr:last-child {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: rgba(79, 110, 247, 0.03);
}

[data-bs-theme="dark"] .history-table tbody tr:hover {
    background: rgba(79, 110, 247, 0.07);
}

.file-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fv-primary);
    flex-shrink: 0;
}

/* ── Icon Buttons ─────────────────────────────────────────── */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fv-radius-sm);
    transition:
        background var(--fv-transition),
        border-color var(--fv-transition),
        transform var(--fv-transition);
}

.btn-icon:hover {
    transform: translateY(-1px);
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar {
    border-radius: var(--fv-radius-sm);
    overflow: hidden;
    border: 1px solid var(--fv-border);
    background: var(--fv-surface);
}

.search-bar .form-control {
    background: transparent;
    color: var(--fv-text);
}

.search-bar .form-control:focus {
    box-shadow: none;
    outline: none;
}

.search-bar .input-group-text {
    background: transparent;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination .page-link {
    border-radius: var(--fv-radius-sm);
    border: 1px solid var(--fv-border);
    color: var(--fv-text);
    background: var(--fv-surface);
    margin: 0 2px;
    padding: 0.45rem 0.75rem;
    transition: background var(--fv-transition), color var(--fv-transition), border-color var(--fv-transition);
}

.pagination .page-link:hover {
    background: rgba(79, 110, 247, 0.08);
    border-color: var(--fv-primary);
    color: var(--fv-primary);
}

.pagination .page-item.active .page-link {
    background: var(--fv-primary);
    border-color: var(--fv-primary);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Buttons overrides ────────────────────────────────────── */
.btn-primary {
    background: var(--fv-primary);
    border-color: var(--fv-primary);
    border-radius: var(--fv-radius-sm);
    font-weight: 500;
    transition: background var(--fv-transition), border-color var(--fv-transition),
        transform var(--fv-transition), box-shadow var(--fv-transition);
}

.btn-primary:hover {
    background: var(--fv-primary-hover);
    border-color: var(--fv-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.28);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.3em 0.6em;
    font-size: 0.75rem;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-content {
    background: var(--fv-surface);
    border-radius: var(--fv-radius);
    border: 1px solid var(--fv-border);
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
    background: var(--fv-surface);
    border: 1px solid var(--fv-border);
    border-radius: var(--fv-radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--fv-shadow);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--fv-border);
    font-size: 0.82rem;
    margin-top: auto;
}

/* ── Input & Form Controls ────────────────────────────────── */
.form-control {
    background: var(--fv-surface);
    border-color: var(--fv-border);
    color: var(--fv-text);
    border-radius: var(--fv-radius-sm);
    transition: border-color var(--fv-transition), box-shadow var(--fv-transition);
}

.form-control:focus {
    background: var(--fv-surface);
    color: var(--fv-text);
    border-color: var(--fv-primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

/* ── Utilities ────────────────────────────────────────────── */
.text-muted {
    color: var(--fv-text-muted) !important;
}

/* Smooth theme transition */
body,
.card,
.modal-content,
.navbar-glass,
.form-control,
.table {
    transition:
        background-color var(--fv-transition),
        border-color var(--fv-transition),
        color var(--fv-transition);
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 576px) {
    .main-content {
        padding: 1.5rem 0 3rem;
    }

    .file-meta-grid {
        grid-template-columns: 1fr;
    }

    .history-table thead th:nth-child(3),
    .history-table tbody td:nth-child(3),
    .history-table thead th:nth-child(4),
    .history-table tbody td:nth-child(4) {
        display: none;
    }
}