/* ═══════════════════════════════════════════
   Webify WP Restorer - Custom Styles
   Theme: Deep Navy (#101548) + Cyan (#0ec5ca)
   ═══════════════════════════════════════════ */

:root {
    --primary: #101548;
    --primary-light: #1a1f5e;
    --primary-dark: #0a0e2a;
    --accent: #0ec5ca;
    --accent-glow: rgba(14, 197, 202, 0.3);
    --surface: #151a3d;
    --surface-light: #1e2450;
    --border: rgba(255,255,255,0.08);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-dark);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--primary-dark); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Layout ── */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--accent), #67e8f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo .version {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.nav-item.active {
    color: var(--accent);
    background: rgba(14, 197, 202, 0.08);
    border-left-color: var(--accent);
}

.nav-item .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.page-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(21, 26, 61, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.page-header h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.page-header p { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.85rem; }

.page-body { padding: 2rem; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s;
}

.card:hover { border-color: rgba(14, 197, 202, 0.2); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.3s;
}

.stat-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.processing { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.failed { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    color: #000;
}

.btn-primary:hover { box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-1px); }

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

.btn-secondary:hover { border-color: var(--accent); }

.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { padding: 0.75rem 1rem; text-align: left; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Progress ── */
.progress-bar { height: 6px; background: var(--primary-dark); border-radius: 3px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), #06b6d4); border-radius: 3px; transition: width 0.5s ease; }

.progress-circle {
    width: 60px;
    height: 60px;
    position: relative;
}

.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .track { fill: none; stroke: var(--primary-dark); stroke-width: 4; }
.progress-circle .fill-circle { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.progress-circle .value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(14, 197, 202, 0.05);
}

.upload-zone .icon { font-size: 3rem; margin-bottom: 1rem; }
.upload-zone .text { font-size: 1.1rem; font-weight: 500; margin-bottom: 0.5rem; }
.upload-zone .subtext { color: var(--text-muted); font-size: 0.85rem; }

/* ── Log Viewer ── */
.log-viewer {
    background: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

.log-entry { padding: 2px 0; }
.log-entry .time { color: var(--text-muted); }
.log-entry.success .msg { color: var(--success); }
.log-entry.error .msg { color: var(--error); }
.log-entry.warning .msg { color: var(--warning); }
.log-entry.info .msg { color: var(--info); }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ── Steps ── */
.steps { display: flex; gap: 0.5rem; align-items: center; }

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--surface-light);
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.step-dot.active { background: var(--accent); color: #000; border-color: var(--accent); }
.step-dot.completed { background: var(--success); color: #fff; border-color: var(--success); }
.step-dot.failed { background: var(--error); color: #fff; border-color: var(--error); }

.step-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; }
.step-line.completed { background: var(--success); }

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--error); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: var(--info); }

/* ── Animations ── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.fade-in { animation: fadeIn 0.3s ease; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-body { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
}

.login-box .logo { text-align: center; margin-bottom: 2rem; }
.login-box .logo h1 { background: linear-gradient(135deg, var(--accent), #67e8f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 1.5rem; margin: 0.5rem 0 0; }

/* ── Install Page ── */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); padding: 2rem; }
.install-box { width: 100%; max-width: 600px; }

/* ── Wizard ── */
.wizard-steps { display: flex; justify-content: center; gap: 0; margin-bottom: 2rem; }
