/* ═══════════════════════════════════════════════════════
   CloudVault — Styles
   Dark theme with glassmorphism, smooth animations
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────── */
:root {
    /* Base colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --bg-card: rgba(26, 32, 53, 0.7);
    --bg-card-hover: rgba(35, 45, 70, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    /* Text colors */
    --text-primary: #f0f2f5;
    --text-secondary: #8b95a5;
    --text-muted: #5a6374;
    --text-accent: #818cf8;

    /* Accent colors */
    --accent-primary: #6366f1;
    --accent-primary-hover: #7c7ff7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Status colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(99, 102, 241, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sizing */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ─── Reset & Base ────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════
   LANDING SCREEN
   ═══════════════════════════════════════════════════════ */

/* ─── Base Buttons ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    line-height: 1;
}

.btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-accent);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-accent);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* ─── Base Input ──────────────────────────────────── */
.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.landing-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(40px, 20px) scale(1.02);
    }
}

.landing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    padding: 40px;
    animation: fadeUp 1s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.logo-text {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-weight: 300;
    opacity: 0.9;
}

.landing-tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

.btn-signin {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.btn-signin:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.3);
}

.btn-signin:disabled {
    opacity: 0.6;
    cursor: wait;
}

.btn-signin .icon {
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-signin:not(:disabled) .spinner {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 48px;
}

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.feature-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.landing-disclaimer {
    margin-top: 32px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   APP SCREEN LAYOUT
   ═══════════════════════════════════════════════════════ */

.app-screen {
    display: flex;
    height: 100vh;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── Sidebar ─────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.sidebar-logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo-text span {
    font-weight: 300;
}

.sidebar-actions {
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-upload-main {
    width: 100%;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.btn-new-folder {
    width: 100%;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
}

.sidebar-storage {
    margin: auto 16px 8px;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.storage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width var(--transition-smooth);
    width: 0%;
}

.storage-bar-fill.warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.storage-bar-fill.critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.storage-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-letter {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--accent-gradient);
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Main Wrapper ────────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

/* ─── Top Bar ─────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    gap: 16px;
}

.topbar-left {
    flex: 1;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Breadcrumbs ─────────────────────────────────── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.breadcrumb-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.breadcrumb-item.current {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-sep {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

/* ─── Search Box ──────────────────────────────────── */
.search-box {
    position: relative;
    width: 260px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ─── View Toggles ────────────────────────────────── */
.view-toggles {
    display: flex;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-toggles .btn-icon {
    border-radius: 0;
    border: none;
}

.view-toggles .btn-icon.active {
    background: var(--accent-primary);
    color: white;
}

/* ─── Main Content Area ───────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    background: var(--bg-primary);
}

/* ═══════════════════════════════════════════════════════
   FILE GRID / LIST
   ═══════════════════════════════════════════════════════ */

.files-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.files-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ─── Grid Card ───────────────────────────────────── */
.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    animation: cardFadeIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card:nth-child(1) {
    animation-delay: 0.02s;
}

.file-card:nth-child(2) {
    animation-delay: 0.04s;
}

.file-card:nth-child(3) {
    animation-delay: 0.06s;
}

.file-card:nth-child(4) {
    animation-delay: 0.08s;
}

.file-card:nth-child(5) {
    animation-delay: 0.10s;
}

.file-card:nth-child(6) {
    animation-delay: 0.12s;
}

.file-card:nth-child(7) {
    animation-delay: 0.14s;
}

.file-card:nth-child(8) {
    animation-delay: 0.16s;
}

.file-card:nth-child(n+9) {
    animation-delay: 0.18s;
}

.file-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Grid view card */
.grid-view .file-card {
    display: flex;
    flex-direction: column;
}

.file-thumbnail {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon-large svg {
    width: 48px;
    height: 48px;
}

.file-info {
    padding: 12px 14px;
}

.file-name {
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.file-actions-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.file-card:hover .file-actions-btn {
    opacity: 1;
}

.file-actions-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
}

.star-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    color: #f59e0b;
}

/* ─── List View Card ──────────────────────────────── */
.list-view .file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.list-view .file-card:hover {
    transform: none;
}

.file-icon-small {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon-small svg {
    width: 20px;
    height: 20px;
}

.list-view .file-name {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.file-meta-list {
    display: flex;
    gap: 40px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-size-col {
    width: 80px;
    text-align: right;
}

.file-date-col {
    width: 120px;
}

.star-badge-list {
    color: #f59e0b;
    flex-shrink: 0;
}

.list-view .file-actions-btn {
    position: relative;
    top: auto;
    right: auto;
    background: transparent;
}

/* ─── Empty State ─────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Skeleton Loading ────────────────────────────── */
.skeleton-card {
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-thumb {
    height: 140px;
    border-radius: 0;
}

.skeleton-text {
    height: 14px;
    width: 80%;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 10px;
    width: 50%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ═══════════════════════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════════════════════ */

.context-menu {
    position: fixed;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
    transition: all var(--transition-fast);
}

.context-menu.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-family: inherit;
    font-weight: 400;
    color: var(--text-primary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
}

.ctx-item:hover {
    background: var(--bg-glass-hover);
}

.ctx-danger {
    color: var(--danger);
}

.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.ctx-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-smooth);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-sm {
    width: 420px;
    max-width: 90vw;
}

.modal-lg {
    width: 900px;
    max-width: 95vw;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 8px;
}

/* ─── Preview ─────────────────────────────────────── */
.preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.preview-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.preview-text {
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-secondary);
}

.preview-unsupported,
.audio-preview {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.preview-icon {
    opacity: 0.3;
    margin-bottom: 16px;
}

.preview-icon svg,
.audio-preview .icon svg {
    width: 80px;
    height: 80px;
}

.audio-icon {
    opacity: 0.4;
    margin-bottom: 16px;
}

.audio-icon svg,
.audio-icon .icon svg {
    width: 80px;
    height: 80px;
}

.preview-error {
    color: var(--text-muted);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   UPLOAD PROGRESS PANEL
   ═══════════════════════════════════════════════════════ */

.upload-progress-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(120%);
    transition: transform var(--transition-smooth);
    z-index: 900;
}

.upload-progress-panel.show {
    transform: translateY(0);
}

.upload-progress-header {
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.upload-progress-body {
    padding: 14px 16px;
}

.upload-file-name {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width var(--transition-fast);
    width: 0%;
}

.upload-progress-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
}

/* ═══════════════════════════════════════════════════════
   DRAG & DROP OVERLAY
   ═══════════════════════════════════════════════════════ */

.drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    pointer-events: none;
}

.drop-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drop-overlay-content {
    text-align: center;
    color: var(--accent-primary);
    animation: dropBounce 2s ease-in-out infinite;
}

.drop-overlay-content svg {
    margin-bottom: 16px;
    opacity: 0.8;
}

.drop-overlay-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.drop-overlay-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@keyframes dropBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform var(--transition-smooth);
    font-size: 0.84rem;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   ICON HELPER
   ═══════════════════════════════════════════════════════ */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon svg {
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .search-box {
        width: 180px;
    }

    .files-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 640px) {
    .sidebar {
        display: none;
    }

    :root {
        --sidebar-width: 0;
    }

    .topbar {
        padding: 0 12px;
    }

    .search-box {
        width: 140px;
    }

    .landing-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .files-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .main-content {
        padding: 16px;
    }
}

/* Folder cards have a subtle special style */
.folder-card .file-thumbnail {
    background: rgba(92, 107, 192, 0.08);
}

.modal-open {
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   AUTH CARD & FORM
   ═══════════════════════════════════════════════════════ */

.auth-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    backdrop-filter: blur(20px);
    max-width: 400px;
    margin: 0 auto 8px;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.auth-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-group .input {
    padding-left: 44px;
}

.auth-form .btn-signin {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 14px 24px;
    font-size: 0.95rem;
}

.auth-form .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

.auth-toggle {
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-toggle a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

.auth-form.loading .input {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Sidebar Info Card ───────────────────────────── */
.sidebar-info {
    margin: auto 16px 8px;
    padding: 0;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}