/* ============================================================================
   AI Interview Co-pilot — Admin Panel Styles (v2)
   ============================================================================
   Dark glassmorphism admin dashboard. Consistent with the main frontend theme.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-primary: #07070e;
    --bg-secondary: #0d0d1a;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.3);
    --accent-blue: #00d4ff;
    --accent-purple: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff, #7c3aed);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.04) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* --- Glass Panel --- */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* --- Login Screen --- */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 36px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.error-text {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 12px;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: #1a1a2e; }

.input-with-toggle {
    display: flex;
    gap: 6px;
}
.input-with-toggle input { flex: 1; }
.btn-toggle-visibility {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background var(--transition-fast);
}
.btn-toggle-visibility:hover { background: rgba(255,255,255,0.1); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    outline: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.2);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.35);
    transform: translateY(-1px);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; }

/* --- Dashboard Layout --- */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 240px;
    min-height: 100vh;
    border-radius: 0;
    border-right: 1px solid var(--border);
    border-left: none;
    border-top: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-list {
    list-style: none;
    padding: 10px 0;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}
.nav-link.active {
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.06);
    border-left-color: var(--accent-blue);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* --- Main Dashboard Content --- */
.dashboard-main {
    flex: 1;
    padding: 28px;
    max-width: 900px;
}

.tab-content { animation: fadeIn 0.2s ease; }
.tab-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Tab Header --- */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.tab-header h2 { margin-bottom: 0; }

/* --- Settings Grid --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.setting-card {
    padding: 18px;
}
.setting-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}

/* --- Profile Form --- */
.profile-form {
    max-width: 700px;
}

/* --- CV Textarea --- */
.cv-textarea {
    min-height: 300px;
    font-family: var(--font-sans);
    line-height: 1.7;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 340px;
}
.toast.info { background: rgba(0, 212, 255, 0.12); color: var(--accent-blue); }
.toast.success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.toast.error { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

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

.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .dashboard { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        border-radius: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .nav-list { display: flex; overflow-x: auto; padding: 6px; }
    .nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 14px;
        white-space: nowrap;
    }
    .nav-link.active { border-bottom-color: var(--accent-blue); border-left-color: transparent; }
    .sidebar-footer { display: none; }
    .dashboard-main { padding: 16px; }
    .settings-grid { grid-template-columns: 1fr; }
    .profile-form { max-width: 100%; }
}
