/* === VARIABLES === */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a28;
    --bg-input: #16161f;
    --border: #2a2a3a;
    --border-glow: #7c3aed;
    --purple-dim: #6d28d9;
    --purple: #8b5cf6;
    --purple-bright: #a78bfa;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --purple-glow-strong: rgba(139, 92, 246, 0.6);
    --text: #e2e2f0;
    --text-dim: #8888a0;
    --text-bright: #ffffff;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--bg-dark); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }

/* === BACKGROUND EFFECTS === */
.bg-grid {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.bg-glow {
    position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
    filter: blur(120px); opacity: 0.15;
}
.bg-glow-1 { width: 600px; height: 600px; background: var(--purple); top: -200px; right: -100px; }
.bg-glow-2 { width: 400px; height: 400px; background: var(--purple-dim); bottom: -150px; left: -100px; }

/* === LOGIN PAGE === */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1rem;
    background: radial-gradient(ellipse at center, #12101f 0%, var(--bg-dark) 70%);
}

.login-container { position: relative; width: 100%; max-width: 400px; }

.login-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 300px; background: var(--purple-glow);
    border-radius: 50%; filter: blur(100px); opacity: 0.3; pointer-events: none;
}

.login-card {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    backdrop-filter: blur(20px);
}

.login-header { text-align: center; margin-bottom: 2rem; }

.login-icon {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--purple-dim), var(--purple));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 30px var(--purple-glow);
}
.login-icon svg { width: 28px; height: 28px; color: white; }

.login-header h1 {
    font-size: 1.5rem; font-weight: 700; color: var(--text-bright);
    letter-spacing: -0.02em;
}
.login-subtitle { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.3rem; }

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; margin-bottom: 1.5rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.input-group input {
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text-bright);
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.95rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus {
    border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.login-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--purple-dim), var(--purple));
    color: white; border: none; padding: 0.85rem; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-top: 0.5rem;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--purple-glow); }
.login-btn:active { transform: translateY(0); }
.login-btn svg { width: 18px; height: 18px; }

/* === DASHBOARD === */
.dash-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
}

.header-brand { display: flex; align-items: center; gap: 0.75rem; }

.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--purple-dim), var(--purple));
    border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px var(--purple-glow);
}
.brand-icon svg { width: 22px; height: 22px; color: white; }

.header-brand h1 { font-size: 1.25rem; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; }

.header-nav { display: flex; align-items: center; gap: 1rem; }

.nav-status {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; color: var(--text-dim);
    background: rgba(139, 92, 246, 0.08);
    padding: 0.4rem 0.8rem; border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple-bright); box-shadow: 0 0 8px var(--purple-glow-strong); }

.nav-logout {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); color: var(--text-dim);
    transition: color 0.2s, background 0.2s;
}
.nav-logout:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.nav-logout svg { width: 18px; height: 18px; }

/* === MAIN CONTENT === */
.dash-main {
    position: relative; z-index: 1;
    max-width: 1200px; margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* Empty state */
.empty-state {
    text-align: center; padding: 4rem 1rem;
    color: var(--text-dim);
}
.empty-icon { margin-bottom: 1.5rem; }
.empty-icon svg { width: 64px; height: 64px; stroke: var(--purple-dim); }
.empty-state p { font-size: 1rem; }
.empty-hint { font-size: 0.85rem; margin-top: 0.5rem; }
.empty-hint code {
    background: rgba(139, 92, 246, 0.1); padding: 0.15rem 0.4rem;
    border-radius: 4px; font-size: 0.8rem; color: var(--purple-bright);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
    overflow: hidden;
    cursor: pointer;
}

.project-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.12);
}

.card-glow {
    position: absolute; top: -50%; right: -50%;
    width: 200px; height: 200px; border-radius: 50%;
    background: var(--purple-glow); filter: blur(60px);
    opacity: 0; transition: opacity 0.3s;
    pointer-events: none;
}
.project-card:hover .card-glow { opacity: 0.3; }

.card-icon {
    flex-shrink: 0; width: 48px; height: 48px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    transition: background 0.25s, border-color 0.25s;
}
.project-card:hover .card-icon {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.card-content { flex: 1; min-width: 0; position: relative; z-index: 1; }
.card-content h2 {
    font-size: 1rem; font-weight: 600; color: var(--text-bright);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-content p {
    font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-arrow {
    flex-shrink: 0; color: var(--text-dim);
    transition: color 0.2s, transform 0.2s;
    position: relative; z-index: 1;
}
.card-arrow svg { width: 18px; height: 18px; }
.project-card:hover .card-arrow { color: var(--purple-bright); transform: translateX(3px); }

/* === FOOTER === */
.dash-footer {
    position: relative; z-index: 1;
    text-align: center; padding: 1.5rem;
    font-size: 0.75rem; color: var(--text-dim);
    border-top: 1px solid var(--border);
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .project-grid { grid-template-columns: 1fr; }
    .header-brand h1 { font-size: 1.05rem; }
    .login-card { padding: 2rem 1.5rem; }
    .dash-main { padding: 1.5rem 1rem 3rem; }
}

/* === ANIMATIONS === */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}
.bg-glow-1 { animation: pulse-glow 8s ease-in-out infinite; }
.bg-glow-2 { animation: pulse-glow 8s ease-in-out 4s infinite; }

@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.project-card { animation: fade-in 0.4s ease-out backwards; }
.project-card:nth-child(2) { animation-delay: 0.05s; }
.project-card:nth-child(3) { animation-delay: 0.1s; }
.project-card:nth-child(4) { animation-delay: 0.15s; }
.project-card:nth-child(5) { animation-delay: 0.2s; }
.project-card:nth-child(6) { animation-delay: 0.25s; }
