/* ═══════════════════════════════════════════
   FastFile — Dark Theme Design System
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --surface: #1a1a2e;
    --surface-hover: #222240;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108,92,231,0.3);
    --teal: #00cec9;
    --danger: #ff6b6b;
    --danger-hover: #ee5a5a;
    --success: #51cf66;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

/* ─── Glass Effect ───────────────────────── */
.glass {
    background: rgba(26,26,46,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.glass-subtle {
    background: rgba(26,26,46,0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ─── Buttons ────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff; box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 25px var(--accent-glow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-hover); background: rgba(255,255,255,0.03); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-icon {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-muted); cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.btn-icon.btn-delete:hover { color: var(--danger); }
.btn-icon.btn-toggle.active { color: var(--teal); }
.btn-icon.btn-copy:hover { color: var(--accent-light); }

/* ─── Auth Pages ─────────────────────────── */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; padding: 20px;
}
.auth-bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: var(--accent); top: -10%; left: -5%; }
.orb-2 { width: 350px; height: 350px; background: var(--teal); bottom: -10%; right: -5%; animation-delay: -3s; }
.orb-3 { width: 250px; height: 250px; background: #e84393; top: 50%; left: 60%; animation-delay: -5s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-card {
    width: 100%; max-width: 420px; padding: 40px; position: relative; z-index: 1;
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 1.8rem; font-weight: 800; margin-top: 12px; background: linear-gradient(135deg, var(--text-primary), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }
.logo-icon { display: inline-block; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.input-wrapper {
    position: relative; display: flex; align-items: center;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: var(--radius); transition: all var(--transition);
}
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.input-wrapper input {
    width: 100%; padding: 12px 14px 12px 44px; background: none; border: none;
    color: var(--text-primary); font-family: inherit; font-size: 0.95rem; outline: none;
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.auth-form .btn { margin-top: 8px; padding: 14px; font-size: 1rem; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-secondary); font-size: 0.85rem; }

/* Flash Messages */
.flash-messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
    animation: slideUp 0.3s ease-out;
}
.flash-error { background: rgba(255,107,107,0.15); color: var(--danger); border: 1px solid rgba(255,107,107,0.2); }
.flash-success { background: rgba(81,207,102,0.15); color: var(--success); border: 1px solid rgba(81,207,102,0.2); }

/* ─── Dashboard ──────────────────────────── */
.dashboard-page { min-height: 100vh; display: flex; flex-direction: column; }

.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; margin: 16px; border-radius: var(--radius-lg);
    position: sticky; top: 16px; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.brand-name { font-weight: 700; font-size: 1.1rem; background: linear-gradient(135deg, var(--text-primary), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-right { display: flex; align-items: center; gap: 10px; }
.storage-badge, .user-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; color: var(--text-secondary);
}
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: #fff;
}
.username { font-weight: 600; color: var(--text-primary); }

.dash-main { flex: 1; padding: 0 24px 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Upload Zone */
.upload-zone {
    padding: 48px; text-align: center; margin-bottom: 24px;
    border: 2px dashed var(--border); cursor: pointer;
    transition: all var(--transition); position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent); background: rgba(108,92,231,0.05);
}
.upload-zone.drag-over .upload-icon { transform: translateY(-4px) scale(1.1); }
.upload-icon-wrapper { margin-bottom: 12px; }
.upload-icon { color: var(--accent-light); transition: transform var(--transition); }
.upload-zone h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { color: var(--text-secondary); font-size: 0.9rem; }
.upload-browse { color: var(--accent-light); cursor: pointer; font-weight: 600; }
.upload-browse:hover { text-decoration: underline; }
.upload-hint { font-size: 0.8rem !important; color: var(--text-muted) !important; margin-top: 8px; }

.upload-progress { padding: 16px 0; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 3px; transition: width 0.3s; }
.progress-text { color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.search-wrapper {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius);
}
.search-wrapper svg { color: var(--text-muted); flex-shrink: 0; }
.search-wrapper input { flex: 1; background: none; border: none; color: var(--text-primary); font-family: inherit; font-size: 0.9rem; outline: none; }
.search-wrapper input::placeholder { color: var(--text-muted); }
.file-count { padding: 10px 16px; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; border-radius: var(--radius); }
.file-count span { font-weight: 700; color: var(--accent-light); }

/* Breadcrumbs */
.breadcrumbs-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.breadcrumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.crumb {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: var(--radius-sm); font-size: 0.82rem;
    color: var(--text-secondary); transition: all var(--transition);
    font-weight: 500;
}
.crumb:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.crumb-active { color: var(--text-primary); font-weight: 600; }
.crumb-sep { color: var(--text-muted); flex-shrink: 0; }

/* Folders Grid */
.folders-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.folder-card {
    padding: 14px; transition: all var(--transition);
    animation: fadeIn 0.3s ease-out; display: flex; align-items: center;
    justify-content: space-between; gap: 8px;
}
.folder-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.folder-link {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-primary); flex: 1; min-width: 0;
}
.folder-link:hover { color: var(--accent-light); }
.folder-icon { color: var(--accent-light); flex-shrink: 0; fill: rgba(108,92,231,0.15); }
.folder-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); flex-shrink: 0; }
.folder-card:hover .folder-actions { opacity: 1; }
.btn-icon.btn-delete-folder:hover { color: var(--danger); }

/* Files Grid */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.file-card {
    padding: 16px; transition: all var(--transition);
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.file-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.file-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.file-icon { font-size: 1.6rem; }
.file-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.file-card:hover .file-actions { opacity: 1; }
.file-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.file-meta { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 10px; flex-wrap: wrap; }
.file-sep { color: var(--text-muted); }
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-public { background: rgba(0,206,201,0.12); color: var(--teal); }
.badge-private { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state p { margin-top: 12px; font-size: 1rem; }
.empty-hint { font-size: 0.85rem !important; }

/* ─── Share Page ─────────────────────────── */
.share-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; padding: 20px;
}
.share-bg-orbs { position: fixed; inset: 0; pointer-events: none; }
.share-bg-orbs .orb-1 { width: 300px; height: 300px; background: var(--accent); top: -5%; right: -5%; }
.share-bg-orbs .orb-2 { width: 250px; height: 250px; background: var(--teal); bottom: -5%; left: -5%; animation-delay: -4s; }

.share-card { width: 100%; max-width: 520px; padding: 32px; position: relative; z-index: 1; animation: slideUp 0.5s ease-out; }
.share-header { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.brand-name-sm { font-weight: 700; font-size: 0.95rem; color: var(--text-secondary); }

.share-preview { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; background: rgba(0,0,0,0.3); }
.preview-img { width: 100%; max-height: 350px; object-fit: contain; display: block; }
.preview-video { width: 100%; max-height: 350px; display: block; }
.preview-audio-wrap { padding: 40px 20px; text-align: center; }
.preview-audio { width: 100%; margin-top: 16px; }
.preview-generic { padding: 50px; text-align: center; }
.preview-icon { font-size: 4rem; }

.share-info { margin-bottom: 20px; }
.share-filename { font-size: 1.3rem; font-weight: 700; word-break: break-all; }
.share-meta { display: flex; gap: 6px; font-size: 0.8rem; color: var(--text-secondary); margin-top: 6px; flex-wrap: wrap; }
.btn-download { padding: 16px; font-size: 1rem; margin-bottom: 20px; }
.share-cdn-link label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cdn-copy-row {
    display: flex; align-items: center; gap: 8px; margin-top: 6px;
    background: rgba(0,0,0,0.3); padding: 10px 14px; border-radius: var(--radius-sm);
}
.cdn-copy-row code { flex: 1; font-size: 0.78rem; color: var(--accent-light); word-break: break-all; font-family: 'SF Mono', monospace; }

/* ─── Paste Bar ──────────────────────────── */
.paste-bar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px; z-index: 1500;
    animation: slideUpCenter 0.3s ease-out;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
@keyframes slideUpCenter {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.paste-bar[hidden] { display: none; }
.paste-info { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 0.85rem; font-weight: 500; }
.paste-info svg { color: var(--accent-light); flex-shrink: 0; }
.paste-actions { display: flex; gap: 8px; }

/* Cut highlight */
.file-card.cut-highlight {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--accent);
}

/* Clipboard button colors */
.btn-icon.btn-clipboard-copy:hover { color: var(--accent-light); }
.btn-icon.btn-clipboard-cut:hover { color: #fdcb6e; }

/* ─── Modal ──────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
    z-index: 1000; animation: fadeIn 0.2s;
}
.modal-overlay[hidden] { display: none; }
.modal { width: 90%; max-width: 400px; padding: 28px; }
.modal h3 { font-size: 1.1rem; margin-bottom: 16px; }
.modal-text { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.modal-input {
    width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: inherit; font-size: 0.95rem;
    outline: none; margin-bottom: 20px; transition: border-color var(--transition);
}
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ─── Toast ──────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
    animation: toastIn 0.3s ease-out; min-width: 250px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast-success { background: rgba(81,207,102,0.15); color: var(--success); border: 1px solid rgba(81,207,102,0.2); backdrop-filter: blur(10px); }
.toast-error { background: rgba(255,107,107,0.15); color: var(--danger); border: 1px solid rgba(255,107,107,0.2); backdrop-filter: blur(10px); }
.toast-info { background: rgba(108,92,231,0.15); color: var(--accent-light); border: 1px solid rgba(108,92,231,0.2); backdrop-filter: blur(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast-out { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ─── Error Page ─────────────────────────── */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.error-card { padding: 60px; text-align: center; }
.error-code { font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.error-msg { color: var(--text-secondary); margin: 12px 0 28px; font-size: 1.1rem; }

/* ─── Drag & Drop & Multi-Select ─────────── */
.drop-target.drag-over {
    border-color: var(--accent);
    background: rgba(108,92,231,0.1);
    box-shadow: 0 0 0 2px var(--accent-glow);
    transform: scale(1.02);
}
.file-card.dragging, .folder-card.dragging {
    opacity: 0.5;
    border-style: dashed;
}
.folder-card, .file-card { position: relative; }
.item-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    z-index: 10;
    opacity: 0;
    transition: all var(--transition);
    cursor: pointer;
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.item-checkbox:checked {
    opacity: 1;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.item-checkbox:checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.file-card:hover .item-checkbox,
.folder-card:hover .item-checkbox,
.item-checkbox:checked {
    opacity: 1;
}

.item-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}
.file-card.selected, .folder-card.selected {
    border-color: var(--accent);
    background: rgba(108,92,231,0.08);
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
    .dash-header { margin: 8px; padding: 10px 16px; top: 8px; flex-wrap: wrap; gap: 8px; }
    .header-right { gap: 6px; }
    .storage-badge { display: none; }
    .dash-main { padding: 0 12px 12px; }
    .upload-zone { padding: 32px 16px; }
    .files-grid { grid-template-columns: 1fr; }
    .folders-grid { grid-template-columns: 1fr 1fr; }
    .file-actions, .folder-actions { opacity: 1; }
    .toolbar { flex-direction: column; }
}
.file-thumbnail { cursor: pointer; }
