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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 30, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #0a0a0f 0%, #1e1b4b 100%);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══ AMBIENT BACKGROUND ═══ */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    z-index: 0;
    animation: ambientFloat 20s ease-in-out infinite;
}

@keyframes ambientFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -1%) rotate(1deg); }
    66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

/* ═══ HEADER ═══ */
.header {
    position: relative;
    z-index: 10;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ═══ NAVIGATION TABS ═══ */
.nav-tabs {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 4px;
    padding: 16px 32px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.6);
}

.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border);
}

.tab-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--border-active);
}

.tab-btn .emoji { font-size: 1.1rem; }

/* ═══ MAIN CONTENT ═══ */
.main {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ═══ CARDS ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: 0 0 30px var(--accent-glow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══ INPUT AREA ═══ */
.input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.input-area textarea {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
    line-height: 1.6;
}

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

.input-area textarea::placeholder { color: var(--text-muted); }

.btn-primary {
    padding: 16px 28px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    align-self: flex-end;
}

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

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

/* ═══ AI RESPONSE ═══ */
.ai-response {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    line-height: 1.8;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
}

.ai-response:empty::before {
    content: 'AI response will appear here...';
    color: var(--text-muted);
    font-style: italic;
}

.ai-response h1, .ai-response h2, .ai-response h3 { color: var(--accent); margin: 16px 0 8px; }
.ai-response strong { color: var(--text-primary); }
.ai-response code { background: rgba(99, 102, 241, 0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.ai-response ul, .ai-response ol { padding-left: 20px; }

.response-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══ LOADING ═══ */
.loading {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--accent);
    font-size: 0.9rem;
}

.loading.active { display: flex; }

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ═══ STATS ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-active); }
.stat-value { font-size: 2rem; font-weight: 800; background: var(--gradient-1); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ═══ TRACKER TABLE ═══ */
.tracker-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.tracker-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.tracker-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.tracker-table tr:hover td {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-applied { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-interview { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-offer { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-scam { background: rgba(239, 68, 68, 0.25); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ═══ SECURE LOGIN OVERLAY ═══ */
.login-overlay {
    position: fixed; inset: 0; background: var(--bg-primary);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 9999;
}
.login-box {
    background: var(--bg-secondary); padding: 50px; border-radius: var(--radius);
    border: 1px solid var(--border); text-align: center;
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.15); max-width: 400px; width: 90%;
}
.login-input {
    width: 100%; padding: 15px; margin-bottom: 20px; border-radius: var(--radius-sm);
    background: var(--bg-primary); border: 1px solid var(--border);
    color: var(--text-primary); outline: none; font-size: 1.1rem; text-align: center;
    font-family: inherit; transition: var(--transition);
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hidden { display: none !important; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .header { padding: 16px 20px; }
    .nav-tabs { padding: 12px 16px; }
    .main { padding: 16px; }
    .input-area { flex-direction: column; }
    .btn-primary { align-self: stretch; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
