/* assets/css/styles.css */
:root {
    /* Base Sizing context */
    --base-font: 14px;
    --base-padding: 16px;
    --base-gap: 24px;
    --base-radius: 12px;
    --icon-size: 20px;

    /* Theme: Default Light */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Status Colors */
    --todo: #64748b;
    --in-progress: #3b82f6;
    --review: #a855f7;
    --done: #22c55e;
    --urgent: #ef4444;
    --high: #f97316;
    --medium: #eab308;
    --low: #10b981;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- SCALING MODES (The 5 Sizes) --- */
body.scale-xs {
    --base-font: 10px;
    --base-padding: 6px;
    --base-gap: 8px;
    --base-radius: 4px;
    --icon-size: 13px;
    --header-height: 40px;
}
body.scale-small {
    --base-font: 12px;
    --base-padding: 10px;
    --base-gap: 16px;
    --base-radius: 8px;
    --icon-size: 16px;
    --header-height: 56px;
}
/* Medium is base :root values */
body.scale-medium {
    --base-font: 14px;
    --base-padding: 16px;
    --base-gap: 24px;
    --base-radius: 12px;
    --icon-size: 18px;
    --header-height: 70px;
}
body.scale-large {
    --base-font: 16px;
    --base-padding: 22px;
    --base-gap: 32px;
    --base-radius: 16px;
    --icon-size: 22px;
    --header-height: 84px;
}
body.scale-xl {
    --base-font: 18px;
    --base-padding: 28px;
    --base-gap: 40px;
    --base-radius: 20px;
    --icon-size: 26px;
    --header-height: 100px;
}

/* --- THEMES --- */
body.theme-midnight {
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

body.theme-purple {
    --primary: #a855f7;
    --primary-hover: #9333ea;
    --bg-app: #faf5ff;
    --bg-card: #ffffff;
    --bg-sidebar: #4c1d95;
    --text-main: #1e1b4b;
    --text-muted: #6b21a8;
    --border-color: #e9d5ff;
}
body.theme-purple .sidebar * { color: #f3e8ff !important; }
body.theme-purple .sidebar .logo { color: white !important; }

body.theme-forest {
    --primary: #10b981;
    --primary-hover: #059669;
    --bg-app: #f0fdf4;
    --bg-card: #ffffff;
    --bg-sidebar: #064e3b;
    --text-main: #064e3b;
    --text-muted: #166534;
    --border-color: #bbf7d0;
}
body.theme-forest .sidebar * { color: #dcfce7 !important; }
body.theme-forest .sidebar .logo { color: white !important; }

body.theme-anamorphic {
    --primary: #00e5ff;
    --primary-hover: #00b8cc;
    --bg-app: #05070a;
    --bg-card: #0a0d14;
    --bg-sidebar: #020408;
    --text-main: #e0f2f1;
    --text-muted: #64ffda;
    --border-color: #1a237e;
}
body.theme-anamorphic .header h2 {
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5), 20px 0 30px rgba(0, 229, 255, 0.2);
    letter-spacing: 0.1em;
}

body.theme-cyber {
    --primary: #ff00ff;
    --primary-hover: #d400d4;
    --bg-app: #0d0221;
    --bg-card: #190e38;
    --bg-sidebar: #050110;
    --text-main: #00f2ff;
    --text-muted: #7000ff;
    --border-color: #4b0082;
}

body.theme-glass {
    --primary: #6366f1;
    --primary-hover: #4338ca;
    --bg-app: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-sidebar: rgba(255, 255, 255, 0.5);
    --text-main: #1e1b4b;
    --text-muted: #4338ca;
    --border-color: rgba(255, 255, 255, 0.4);
}
body.theme-glass .card, body.theme-glass .sidebar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* --- GOLD EDITION (Luxury) --- */
body.theme-gold {
    --primary: #fbbf24;
    --primary-hover: #f59e0b;
    --bg-app: #0a0a0a;
    --bg-card: #171717;
    --bg-sidebar: #0e0e0e;
    --text-main: #f3f4f6;
    --text-muted: #a3a3a3;
    --border-color: #262626;
}
body.theme-gold .sidebar * { color: #facc15 !important; }
body.theme-gold .btn-icon { color: #facc15 !important; }

/* --- NORDIC FROST (Clean) --- */
body.theme-nordic {
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --bg-app: #f0f9ff;
    --bg-card: #ffffff;
    --bg-sidebar: #0c4a6e;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e0f2fe;
}
body.theme-nordic .sidebar * { color: #e0f2fe !important; }

/* --- RETRO TERMINAL (Hacker) --- */
body.theme-terminal {
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --bg-app: #000000;
    --bg-card: #050505;
    --bg-sidebar: #000000;
    --text-main: #4ade80;
    --text-muted: #166534;
    --border-color: #064e3b;
}
body.theme-terminal * { font-family: 'JetBrains Mono', 'Courier New', monospace !important; }
body.theme-terminal h2 { text-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }

/* Visibility Fixes for Active States */
body.theme-gold .nav-link:hover *, body.theme-gold .nav-link.active *,
body.theme-terminal .nav-link:hover *, body.theme-terminal .nav-link.active * {
    color: #000000 !important;
}

/* --- LIGHT GREY (Minimalist) --- */
body.theme-lightgrey {
    --primary: #475569;
    --primary-hover: #334155;
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
}
body.theme-lightgrey .sidebar * { color: #f1f5f9 !important; }

/* --- MEDIUM GREY (Industrial) --- */
body.theme-medgrey {
    --primary: #94a3b8;
    --primary-hover: #64748b;
    --bg-app: #334155;
    --bg-card: #475569;
    --bg-sidebar: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: #64748b;
}
body.theme-medgrey .sidebar * { color: #f1f5f9 !important; }

/* --- DARK GREY (Graphite) --- */
body.theme-darkgrey {
    --primary: #94a3b8;
    --primary-hover: #cbd5e1;
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
}
body.theme-darkgrey .sidebar * { color: #f1f5f9 !important; }

/* --- NEUMORPHIC SOFT UI --- */
body.theme-neumorphic {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --bg-app: #ecf0f3;
    --bg-card: #ecf0f3;
    --bg-sidebar: #ecf0f3;
    --text-main: #44476a;
    --text-muted: #797d9a;
    --border-color: rgba(255, 255, 255, 0.5);
    --neu-shadow-dark: #d1d9e6;
    --neu-shadow-light: #ffffff;
}

body.theme-neumorphic .card, 
body.theme-neumorphic .sidebar,
body.theme-neumorphic .form-input,
body.theme-neumorphic .btn {
    background: var(--bg-card) !important;
    border: none !important;
    box-shadow: 8px 8px 16px var(--neu-shadow-dark), 
                -8px -8px 16px var(--neu-shadow-light) !important;
    border-radius: 20px;
    transition: all 0.2s ease;
}

body.theme-neumorphic .btn:active,
body.theme-neumorphic input:focus {
    box-shadow: inset 6px 6px 12px var(--neu-shadow-dark), 
                inset -6px -6px 12px var(--neu-shadow-light) !important;
    outline: none;
}

body.theme-neumorphic .header {
    background: transparent !important;
    border: none !important;
}

body.theme-neumorphic .badge {
    box-shadow: 4px 4px 8px var(--neu-shadow-dark), 
                -4px -4px 8px var(--neu-shadow-light);
    border: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: var(--base-font);
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Scaling impact globally */
h1 { font-size: calc(var(--base-font) * 2); font-weight: 800; }
h2 { font-size: calc(var(--base-font) * 1.5); font-weight: 700; }
p { font-size: var(--base-font); line-height: 1.6; }

.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--base-gap);
    transition: var(--transition);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed to start for better multi-line look */
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: var(--base-padding);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--base-radius);
    padding: var(--base-padding);
    transition: var(--transition);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--primary);
    color: white !important;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: rgba(0,0,0,0.05);
    color: var(--text-main) !important;
    box-shadow: none;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--base-font);
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: calc(var(--base-font) * 0.85);
    font-weight: 600;
}

.sidebar-nav-link i {
    font-size: var(--icon-size);
}

/* --- Auth Pages --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
    padding: calc(var(--base-padding) * 2.5);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.theme-midnight .auth-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
}


.sidebar-logo i {
    font-size: calc(var(--base-font) * 1.5);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(var(--base-padding) / 1.5);
    border-radius: var(--base-radius);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i {
    font-size: var(--icon-size);
    width: var(--icon-size);
    display: flex;
    justify-content: center;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white !important;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Sidebar collapsed state overrides */
body.sidebar-collapsed .sidebar-text {
    display: none;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* Theme specifics for Sidebar */
body.theme-purple .sidebar, body.theme-forest .sidebar {
    background: var(--bg-sidebar);
}

body.theme-purple .nav-link, body.theme-forest .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

body.theme-purple .nav-link:hover, body.theme-forest .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

body.theme-purple .btn-icon, body.theme-forest .btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}



/* --- AUTHENTICATION PAGES (Original First Style Restored) --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.auth-card h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    background: none;
    -webkit-text-fill-color: initial;
}

.auth-card p {
    color: #64748b;
    margin-bottom: 40px;
    font-size: 15px;
}

.auth-card .form-group {
    text-align: left;
    margin-bottom: 24px;
}

.auth-card label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

.auth-card .form-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
    transition: all 0.2s;
}

.auth-card .form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white !important;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main) !important;
    box-shadow: none;
}

body.theme-midnight .btn-secondary,
body.theme-forest .btn-secondary,
body.theme-purple .btn-secondary,
body.theme-anamorphic .btn-secondary,
body.theme-cyber .btn-secondary,
body.theme-gold .btn-secondary,
body.theme-terminal .btn-secondary,
body.theme-darkgrey .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white !important;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.auth-link {
    display: block;
    margin-top: 24px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

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

/* Progress Shimmer Animation */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 30%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}
