:root {
    /* Modern Dark Theme Colors */
    --bg-main: #0b0f19;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --bg-panel-hover: rgba(31, 41, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    /* Status Colors */
    --status-todo: #f59e0b;
    --status-progress: #3b82f6;
    --status-done: #10b981;
    
    /* Priority Colors */
    --prio-low: #3b82f6;
    --prio-medium: #f59e0b;
    --prio-high: #f97316;
    --prio-urgent: #ef4444;
    
    /* Category Colors */
    --cat-study: #8b5cf6;
    --cat-personal: #ec4899;
    --cat-work: #0ea5e9;
    --cat-shopping: #14b8a6;

    /* Layout */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    
    --radius: 16px;
    --radius-sm: 10px;
    
    --transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-color: var(--bg-main);
}

/* Beautiful Animated Dark Stars Background */
.animated-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
}

/* Static Parallax Stars */
#stars {
    width: 2px; height: 2px; background: transparent;
    box-shadow: 10vw 20vh #FFF, 30vw 50vh #FFF, 50vw 10vh #FFF, 70vw 80vh #FFF, 90vw 30vh #FFF, 20vw 80vh #FFF, 80vw 20vh #FFF, 60vw 60vh #FFF, 40vw 90vh #FFF, 85vw 5vh #FFF, 5vw 70vh #FFF, 95vw 90vh #FFF;
    animation: animStar 50s linear infinite;
}
#stars::after {
    content: " "; position: absolute; top: 100vh; width: 2px; height: 2px; background: transparent;
    box-shadow: 10vw 20vh #FFF, 30vw 50vh #FFF, 50vw 10vh #FFF, 70vw 80vh #FFF, 90vw 30vh #FFF, 20vw 80vh #FFF, 80vw 20vh #FFF, 60vw 60vh #FFF, 40vw 90vh #FFF, 85vw 5vh #FFF, 5vw 70vh #FFF, 95vw 90vh #FFF;
}
#stars2 {
    width: 3px; height: 3px; background: transparent;
    box-shadow: 15vw 15vh #FFF, 45vw 45vh #FFF, 75vw 75vh #FFF, 25vw 85vh #FFF, 85vw 35vh #FFF, 55vw 5vh #FFF;
    animation: animStar 100s linear infinite;
}
#stars2::after {
    content: " "; position: absolute; top: 100vh; width: 3px; height: 3px; background: transparent;
    box-shadow: 15vw 15vh #FFF, 45vw 45vh #FFF, 75vw 75vh #FFF, 25vw 85vh #FFF, 85vw 35vh #FFF, 55vw 5vh #FFF;
}
#stars3 {
    width: 4px; height: 4px; background: transparent;
    box-shadow: 12vw 60vh #FFF, 62vw 20vh #FFF, 82vw 80vh #FFF, 32vw 40vh #FFF;
    animation: animStar 150s linear infinite;
}
#stars3::after {
    content: " "; position: absolute; top: 100vh; width: 4px; height: 4px; background: transparent;
    box-shadow: 12vw 60vh #FFF, 62vw 20vh #FFF, 82vw 80vh #FFF, 32vw 40vh #FFF;
}

@keyframes animStar {
    from { transform: translateY(0px); }
    to { transform: translateY(-100vh); }
}

/* Falling/Shooting Stars */
.shooting-stars {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    transform: rotateZ(45deg);
}
.shooting-stars span {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 0 0 0 8px rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 255, 255, 1);
    animation: shooting 3s linear infinite;
}
.shooting-stars span::before {
    content: ''; position: absolute; top: 50%; transform: translateY(-50%);
    width: 300px; height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
}
.shooting-stars span:nth-child(1) { top: 0; right: 0; left: initial; animation-delay: 0s; animation-duration: 3s; }
.shooting-stars span:nth-child(2) { top: 0; right: 80px; left: initial; animation-delay: 0.2s; animation-duration: 3s; }
.shooting-stars span:nth-child(3) { top: 80px; right: 0px; left: initial; animation-delay: 0.4s; animation-duration: 3.5s; }
.shooting-stars span:nth-child(4) { top: 0; right: 180px; left: initial; animation-delay: 0.6s; animation-duration: 2.5s; }
.shooting-stars span:nth-child(5) { top: 0; right: 400px; left: initial; animation-delay: 0.8s; animation-duration: 3s; }
.shooting-stars span:nth-child(6) { top: 300px; right: 0px; left: initial; animation-delay: 1s; animation-duration: 3s; }

@keyframes shooting {
    0% { transform: translateX(0); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translateX(-1000px); opacity: 0; }
}

/* Utilities */
.hidden { display: none !important; }

.panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Auth View --- */
#auth-view {
    max-width: 380px;
    margin: 10vh auto auto;
    padding: 2.5rem;
    width: 100%;
    animation: fadeIn 0.4s ease;
    box-shadow: var(--shadow-md);
}

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

.auth-header .logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms & Inputs */
.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group i + input, .input-group i + select {
    padding-left: 2.5rem;
}

.input-group textarea {
    resize: vertical;
    min-height: 70px;
}

.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group select option {
    background: #0f172a;
    color: white;
}

.select-group select {
    appearance: none;
    cursor: pointer;
}

/* Buttons */
.btn-primary, .btn-danger {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.error-msg {
    color: var(--danger);
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 20px;
    font-weight: 500;
}

/* --- Main Dashboard --- */
.main-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

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

.header-left .logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.header-left h2 {
    font-weight: 700;
    letter-spacing: -0.025em;
    font-size: 1.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-group {
    flex: 1;
    min-width: 250px;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters .select-group {
    min-width: 150px;
    margin-bottom: 0;
}

.filters .select-group select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.filters .select-group select:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9);
}

.filters .select-group select:focus {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Dashboard Layout */
.dashboard-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    flex: 1;
}

@media (max-width: 992px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar {
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-container {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-box {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-value.highlight {
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Kanban Board */
.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.board-column {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 500px;
    background: rgba(15, 23, 42, 0.3);
    border: none;
}

.column-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-todo { color: var(--status-todo); }
.status-progress { color: var(--status-progress); }
.status-done { color: var(--status-done); }

.task-count {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-list {
    padding: 0 1rem 1rem 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
}

.task-list::-webkit-scrollbar { width: 6px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Task Card */
.task-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    cursor: grab;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Framer motion style spring */
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
    background: var(--bg-panel-hover);
}

.task-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.task-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.task-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Badges */
.badge-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Categories */
.badge-cat-study { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.badge-cat-personal { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }
.badge-cat-work { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; }
.badge-cat-shopping { background: rgba(20, 184, 166, 0.2); color: #5eead4; }

/* Priorities */
.badge-prio-low { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-prio-medium { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-prio-high { background: rgba(249, 115, 22, 0.2); color: #fdba74; }
.badge-prio-urgent { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.due-countdown {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.due-countdown.urgent {
    color: var(--danger);
    font-weight: 600;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
}

.task-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}

.task-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.task-actions .del-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success { border-left-color: var(--status-done); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--status-progress); }

/* Drag and Drop styles */
.drag-over {
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; margin-top: -50px; } }

/* Responsive */
@media (max-width: 768px) {
    .board-column { height: auto; min-height: 300px; max-height: 60vh; }
    .app-container { padding: 1rem; }
    .dashboard-content { gap: 1.5rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filters { flex-direction: column; }
}
/* ===== FILTER DROPDOWN IMPROVEMENTS ===== */

.filters .select-group select {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;

    transition: all 0.35s ease;

    box-shadow:
        0 4px 15px rgba(0,0,0,0.3),
        inset 0 1px 1px rgba(255,255,255,0.05);
}

/* Hover Animation */
.filters .select-group select:hover {
    transform: translateY(-3px) scale(1.03);

    border-color: #6366f1;

    box-shadow:
        0 10px 25px rgba(99, 102, 241, 0.35),
        0 0 15px rgba(99, 102, 241, 0.25);
}

/* Click Animation */
.filters .select-group select:active {
    transform: scale(0.96);
}

/* Focus Glow */
.filters .select-group select:focus {
    outline: none;

    border-color: #8b5cf6;

    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.25),
        0 10px 30px rgba(99, 102, 241, 0.3);
}

/* Dropdown options */
.filters .select-group select option {
    background: #0f172a;
    color: white;
    padding: 10px;
}

/* Smooth appearance */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Mobile responsive */
@media (max-width: 768px) {

    .filters {
        width: 100%;
        flex-direction: column;
    }

    .filters .select-group {
        width: 100%;
    }

    .filters .select-group select {
        width: 100%;
    }
}