/* ============================================================
   PegBin — Portal Backup Klien
   Ricky Ndolu
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ==================== NAVBAR ==================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.brand-icon { font-size: 1.5rem; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.nav-user {
    font-weight: 500;
    color: var(--text);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== LOGIN ==================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}

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

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--surface-alt);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #075985;
    border: 1px solid #bae6fd;
    padding: 24px;
    text-align: center;
    font-size: 1rem;
}

/* ==================== ANNOUNCEMENT ==================== */
.announcement {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.announcement-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.announcement-content {
    color: #7c2d12;
}

.announcement-content strong {
    color: #9a3412;
}

/* ==================== COUNTDOWN TIMER ==================== */
.countdown-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    color: white;
}

.countdown-label {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
}

.countdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown-unit {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-top: 2px;
    text-transform: uppercase;
}

.countdown-sep {
    font-size: 1.3rem;
    font-weight: 700;
    opacity: 0.6;
    margin-top: -10px;
}

@media (max-width: 640px) {
    .countdown-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==================== BREADCRUMB & FOLDER BROWSER ==================== */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 14px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.88rem;
}

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

.breadcrumb-link:hover {
    text-decoration: underline;
}

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

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 4px;
}

.dir-row td {
    background: #f8fafc;
}

.folder-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-link:hover {
    color: var(--primary);
}

/* ==================== DASHBOARD ==================== */
.dashboard { }

.welcome-section {
    margin-bottom: 28px;
}

.welcome-section h1 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 4px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.info-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    border-color: #93c5fd;
}

.stat-card.info-card .stat-label {
    color: #1e40af;
    font-size: 0.95rem;
}

.stat-card.info-card .stat-icon {
    background: #bfdbfe;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== FILE TABLE ==================== */
.file-section {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
}

.file-section h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--text);
}

.file-table-wrapper {
    overflow-x: auto;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.file-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-table tr:last-child td {
    border-bottom: none;
}

.file-table tr:hover {
    background: var(--surface-alt);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.file-icon { font-size: 1.1rem; }

.file-size {
    color: var(--text-muted);
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
}

.file-folder {
    color: var(--text-muted);
    font-size: 0.8rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-date {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.85rem;
}

.file-action {
    text-align: center;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
    .main-content { padding: 16px; }
    .login-card { padding: 24px; border-radius: 0; box-shadow: none; border: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .navbar { padding: 10px 16px; }
    .nav-right { gap: 8px; }
    .nav-user { display: none; }
}
