/* ZipZap Glassmorphism Design System */

/* CSS Variables - Light Theme (default) */
:root {
    /* Accent colors */
    --accent: #00BCD4;
    --accent-dark: #00ACC1;
    --accent-light: #4DD0E1;
    --accent-rgb: 0, 188, 212;

    /* Neutral colors */
    --neutral-white: #F5F5F5;
    --neutral-light: #EEEEEE;
    --neutral-medium: #BDBDBD;
    --neutral-dark: #424242;
    --neutral-black: #1A1A1A;

    /* Glass colors */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.8);
    --glass-bg-dark: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: rgba(0, 0, 0, 0.1);

    /* File type colors */
    --color-pdf: #E53935;
    --color-image: #2196F3;
    --color-video: #9C27B0;
    --color-audio: #FF9800;
    --color-folder: var(--accent);
    --color-default: #757575;

    /* Text colors */
    --text-primary: #1A1A1A;
    --text-secondary: #757575;
    --text-on-accent: #FFFFFF;

    /* Background */
    --bg-gradient-start: #F5F5F5;
    --bg-gradient-end: #E0E0E0;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Dark Theme */
[data-theme="dark"] {
    --glass-bg: rgba(0, 0, 0, 0.7);
    --glass-bg-light: rgba(0, 0, 0, 0.8);
    --glass-bg-dark: rgba(0, 0, 0, 0.6);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.3);

    --text-primary: #F5F5F5;
    --text-secondary: #BDBDBD;

    --bg-gradient-start: #1A1A1A;
    --bg-gradient-end: #2A2A2A;
}

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

/* Base styles */
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 500; }
h4 { font-size: 1rem; font-weight: 500; }

.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-error { color: #F44336; }

/* Glass Card */
.glass-card {
    background: linear-gradient(to bottom, var(--glass-bg-light), var(--glass-bg-dark));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px var(--glass-shadow);
    padding: 24px;
}

.glass-card-sm {
    padding: 16px;
    border-radius: var(--radius-md);
}

/* Glass Top Bar */
.glass-top-bar {
    background: linear-gradient(to bottom, var(--glass-bg-light), var(--glass-bg));
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Glass Bottom Bar */
.glass-bottom-bar {
    background: linear-gradient(to top, var(--glass-bg-light), var(--glass-bg));
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 24px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Glass Button */
.glass-button {
    background: linear-gradient(to right, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-rgb), 0.7));
    border: 1px solid rgba(var(--accent-rgb), 0.5);
    border-radius: var(--radius-md);
    color: var(--text-on-accent);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.glass-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.glass-button:disabled {
    background: linear-gradient(to right, rgba(189, 189, 189, 0.5), rgba(189, 189, 189, 0.3));
    border-color: rgba(189, 189, 189, 0.3);
    cursor: not-allowed;
    transform: none;
}

.glass-button-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.glass-button-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Glass Icon Button - for file actions */
.glass-button-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.glass-button-icon:hover {
    background: var(--glass-bg-light);
    color: var(--accent);
    transform: scale(1.05);
    border-color: var(--accent);
}

.glass-button-icon svg {
    width: 18px;
    height: 18px;
}

/* Glass Input */
.glass-input {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.2s ease;
}

[data-theme="dark"] .glass-input {
    background: rgba(0, 0, 0, 0.4);
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.glass-input::placeholder {
    color: var(--text-secondary);
}

/* Glass Progress */
.glass-progress {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

[data-theme="dark"] .glass-progress {
    background: rgba(255, 255, 255, 0.1);
}

.glass-progress-fill {
    background: linear-gradient(to right, var(--accent), var(--accent-dark));
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* File Icon Colors */
.file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon-pdf { background: rgba(229, 57, 53, 0.15); color: var(--color-pdf); }
.file-icon-image { background: rgba(33, 150, 243, 0.15); color: var(--color-image); }
.file-icon-video { background: rgba(156, 39, 176, 0.15); color: var(--color-video); }
.file-icon-audio { background: rgba(255, 152, 0, 0.15); color: var(--color-audio); }
.file-icon-folder { background: rgba(var(--accent-rgb), 0.15); color: var(--color-folder); }
.file-icon-default { background: rgba(117, 117, 117, 0.15); color: var(--color-default); }

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Login page specific */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: var(--accent);
}

.login-title {
    text-align: center;
    margin-bottom: 24px;
}

/* File browser */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 80px; /* Space for bottom bar */
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.file-item:hover {
    background: var(--glass-bg-light);
    transform: translateX(4px);
}

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

.file-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-item-chevron {
    color: var(--text-secondary);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-secondary);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Bottom navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
    border-radius: var(--radius-sm);
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
}

.nav-item.active {
    background: rgba(var(--accent-rgb), 0.1);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* Quota bar */
.quota-bar {
    padding: 8px 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Upload button (FAB) */
.fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
    transition: all 0.2s ease;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* Modal/Dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 1.5rem;
    line-height: 1;
}

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

/* Upload progress overlay */
.upload-overlay {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    min-width: 300px;
}

/* Drag and drop zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

/* Settings */
.settings-section {
    margin-bottom: 24px;
}

.settings-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.settings-item:hover {
    background: var(--glass-bg);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

/* Color picker */
.color-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.color-preset {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.selected {
    border-color: var(--text-primary);
}

/* Toggle switch */
.toggle {
    width: 48px;
    height: 28px;
    background: var(--neutral-medium);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(20px);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}

.badge-accent {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
}

.badge-error {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* Snackbar */
.snackbar {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-dark);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .file-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .file-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .bottom-nav-container {
        display: none;
    }

    /* Sidebar for desktop */
    .sidebar {
        display: flex;
        width: 240px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        flex-direction: column;
        background: var(--glass-bg);
        border-right: 1px solid var(--glass-border);
        padding: 24px 16px;
    }

    .main-content {
        margin-left: 240px;
    }

    .fab {
        bottom: 24px;
    }
}

/* Hide on mobile/show on desktop and vice versa */
.desktop-only { display: none; }
.mobile-only { display: block; }

@media (min-width: 1024px) {
    .desktop-only { display: block; }
    .mobile-only { display: none; }
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Hidden file input */
.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
