/* ============================================
   FileHost – Dark Premium Theme
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(124, 100, 255, 0.4);
    --text-primary: #e8e8ec;
    --text-secondary: #8888a0;
    --text-tertiary: #55556a;
    --accent: #7c64ff;
    --accent-hover: #9580ff;
    --accent-glow: rgba(124, 100, 255, 0.15);
    --success: #4ade80;
    --danger: #f87171;
    --danger-hover: #ef4444;
    --warning: #fbbf24;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- Pages ---- */
.page { display: none; }
.page.active { display: block; }

/* ---- Login ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(124, 100, 255, 0.08) 0%, transparent 60%),
        var(--bg-primary);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 48px 36px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    color: var(--accent);
    margin-bottom: 16px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--transition);
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent);
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Main Content ---- */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---- Upload Zone ---- */
.upload-section {
    margin-bottom: 40px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(124, 100, 255, 0.03);
    box-shadow: 0 0 40px rgba(124, 100, 255, 0.06);
}

.upload-zone-content svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.upload-zone-content p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-browse {
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
}

.upload-hint {
    font-size: 13px !important;
    color: var(--text-tertiary) !important;
}

/* ---- Upload Progress ---- */
.upload-progress-list {
    margin-top: 16px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: fadeUp 0.3s ease;
}

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

.upload-item-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.upload-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-fill.complete {
    background: linear-gradient(90deg, var(--success), #22d3ee);
}

.upload-item-status {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.upload-item-status.uploading { color: var(--accent); }
.upload-item-status.complete  { color: var(--success); }
.upload-item-status.error     { color: var(--danger); }

.upload-item-actions {
    display: flex;
    gap: 8px;
}

/* ---- Files Section ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.file-count {
    font-size: 13px;
    color: var(--text-tertiary);
    background: var(--bg-card);
    padding: 2px 10px;
    border-radius: 12px;
}

.files-table-wrap {
    overflow-x: auto;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.files-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.files-table tbody tr {
    transition: background var(--transition);
}

.files-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.file-name-cell {
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size-cell { color: var(--text-secondary); }
.file-downloads-cell { color: var(--text-secondary); }
.file-date-cell { color: var(--text-tertiary); font-size: 13px; }

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

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state p {
    margin-top: 12px;
    font-size: 15px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 520px;
    animation: fadeUp 0.3s ease;
}

.modal-content h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.url-display {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.url-display input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: monospace;
    outline: none;
}

.modal-close {
    width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-content { padding: 20px 16px; }
    .topbar { padding: 12px 16px; }
    .login-card { padding: 36px 24px; }
    .upload-zone { padding: 32px 16px; }

    .files-table th:nth-child(3),
    .files-table td:nth-child(3),
    .files-table th:nth-child(4),
    .files-table td:nth-child(4) {
        display: none;
    }
}
