:root {
    --primary: #F58220;
    --primary-dark: #C75D00;
    --primary-light: #FFE7D1;
    --bg: #FFFFFF;
    --surface: #FAFAFA;
    --border: #E5E5E5;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --success: #2E7D32;
    --error: #D32F2F;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --font: 'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg);
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-block { width: 100%; }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.btn-icon:hover { color: var(--primary); background: var(--primary-light); }

/* Inputs */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.copy-input {
    display: flex;
    gap: 0.5rem;
}

/* Screens */
.view-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view-screen.active {
    display: flex;
}

/* Login & Share Card */
#login-screen, #share-screen {
    align-items: center;
    justify-content: center;
    background-color: var(--surface);
}

.login-card, .share-card {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo h2 { color: var(--text-primary); font-size: 24px; }
.logo i { font-size: 28px; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 2rem; }
.file-icon-large { font-size: 48px; color: var(--primary); margin: 1rem 0; }
.error-text { color: var(--error); font-size: 14px; margin-bottom: 1rem; }

/* Dashboard Layout */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    width: 300px;
}

.search-bar i { color: var(--text-secondary); margin-right: 0.5rem; }
.search-bar input { border: none; background: transparent; width: 100%; outline: none; font-size: 14px; }

.user-actions { display: flex; align-items: center; gap: 1rem; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.main-layout { display: flex; flex: 1; }

.sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-links { list-style: none; }
.nav-links li {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links li:hover { background: var(--bg); color: var(--text-primary); }
.nav-links li.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-links li i { font-size: 18px; }

.storage-meter { padding: 1rem; }
.storage-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 0.5rem; color: var(--text-secondary); }
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

.content-area { flex: 1; padding: 2rem; background: var(--bg); }
.content-view { display: none; }
.content-view.active { display: block; }
.page-title { margin-bottom: 2rem; font-size: 24px; }

/* Dashboard Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--surface);
    padding: 1.5rem; border-radius: var(--radius);
    display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--primary-light); color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.stat-label { color: var(--text-secondary); font-size: 13px; }
.stat-value { font-size: 20px; font-weight: 600; }

.dashboard-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.section h3 { font-size: 16px; margin-bottom: 1rem; color: var(--text-primary); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.recent-list { display: flex; flex-direction: column; gap: 0.5rem; }
.recent-item {
    display: flex; justify-content: space-between; padding: 0.75rem;
    border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}

/* Files Grid */
.files-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.breadcrumbs { font-size: 18px; font-weight: 600; display: flex; gap: 0.5rem; align-items: center; }
.breadcrumbs span { cursor: pointer; color: var(--text-secondary); }
.breadcrumbs span:hover { color: var(--primary); }
.breadcrumbs span:last-child { color: var(--text-primary); cursor: default; }

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem; text-align: center; color: var(--text-secondary);
    margin-bottom: 2rem; transition: border-color 0.2s;
}
.dropzone.dragover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.dropzone i { font-size: 32px; margin-bottom: 0.5rem; }

.upload-container { background: var(--surface); padding: 1rem; border-radius: var(--radius); margin-bottom: 2rem; }
.upload-container h4 { margin-bottom: 1rem; font-size: 14px; }
.upload-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 13px; }

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.file-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; text-align: center;
    position: relative; transition: all 0.2s; cursor: pointer;
}
.file-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.file-icon { font-size: 40px; color: var(--text-secondary); margin-bottom: 1rem; }
.file-card.folder .file-icon { color: var(--primary); }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem; }
.file-meta { font-size: 12px; color: var(--text-secondary); }

.file-actions {
    position: absolute; top: 0.5rem; right: 0.5rem; display: none; background: rgba(255,255,255,0.9); border-radius: 4px; padding: 2px;
}
.file-card:hover .file-actions { display: flex; gap: 0.25rem; }

.empty-state { text-align: center; color: var(--text-secondary); padding: 4rem 0; grid-column: 1 / -1; }
.empty-state i { font-size: 48px; margin-bottom: 1rem; color: var(--border); }

/* Modals */
.modal-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.modal {
    background: var(--bg); border-radius: var(--radius); width: 100%; max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 101;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 1rem; }

/* Toasts */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    background: var(--bg); border-radius: 8px; box-shadow: var(--shadow);
    padding: 1rem; display: flex; align-items: center; gap: 0.75rem; font-size: 14px;
    min-width: 250px; border-left: 4px solid var(--primary); animation: slideIn 0.3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem; }
    .nav-links { display: flex; overflow-x: auto; gap: 0.5rem; }
    .nav-links li { margin-bottom: 0; white-space: nowrap; }
    .search-bar { display: none; } /* Hide on mobile for simplicity */
    .dashboard-sections { grid-template-columns: 1fr; }
}
