:root {
    --bg-body: #0f172a;
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --bg-gradient-size: 400% 400%;
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #8b5cf6;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --priority-low: #10b981;
    --priority-medium: #f59e0b;
    --priority-high: #f97316;
    --priority-urgent: #ef4444;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-size: var(--bg-gradient-size);
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.glow-effect {
    box-shadow: 0 0 15px var(--primary-glow);
    transition: all 0.3s ease;
}

.glow-effect:hover {
    box-shadow: 0 0 25px var(--primary-glow), 0 0 50px var(--primary-glow);
    transform: translateY(-2px);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    width: 280px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.sidebar-header { 
    margin-bottom: 30px; 
}
.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.logo-icon { 
    font-size: 2.2rem; 
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); 
}
.logo h1 { 
    font-size: 1.6rem; 
    font-weight: 700; 
    letter-spacing: -0.5px; 
}

.sidebar-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-bottom: 30px; 
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.nav-item:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}
.nav-item.active { 
    background: rgba(255,255,255,0.15); 
    color: white; 
    font-weight: 600; 
}
.nav-item.active::before { 
    transform: scaleY(1); 
}

.nav-icon { 
    font-size: 1.3rem; 
}
.badge {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.category-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}
.category-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.category-btn:hover { 
    background: rgba(255,255,255,0.15); 
    color: white; 
}
.category-btn.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    color: white; 
    box-shadow: 0 0 10px var(--primary-glow); 
}

.sidebar-stats {
    padding: 20px;
    margin-bottom: auto;
    animation: fadeIn 0.8s ease;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.progress-text { 
    font-size: 0.85rem; 
    color: var(--text-secondary); 
    font-weight: 500; 
}

.sidebar-footer {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: white;
}

.icon-btn:hover { 
    background: rgba(255,255,255,0.2); 
    transform: scale(1.1); 
}
.icon-btn.danger:hover { 
    background: var(--danger); 
    border-color: var(--danger); 
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.6s ease;
}

.main-header {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.search-container input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.7;
}

.view-controls { 
    display: flex; 
    gap: 5px; 
    background: rgba(0,0,0,0.2); 
    padding: 5px; 
    border-radius: 30px; 
}
.view-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.view-btn.active { 
    background: white; 
    color: var(--bg-body); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
}

.primary-btn {
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.primary-btn:hover { 
    transform: translateY(-3px); 
}

.task-view { 
    display: none; 
}
.task-view.active { 
    display: block; 
    animation: fadeIn 0.4s ease; 
}

.task-list-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sort-label { 
    color: var(--text-secondary); 
    font-size: 0.9rem; 
}
#sort-select {
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.task-list { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.task-item {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    cursor: grab;
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0.5;
}

.task-item:hover {
    transform: translateX(5px) scale(1.01);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.task-item.completed { 
    opacity: 0.6; 
}
.task-item.completed::before { 
    background: var(--success); 
}
.task-item.completed .task-title { 
    text-decoration: line-through; 
    color: var(--text-muted); 
}

.task-checkbox {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    background: transparent;
}

.task-checkbox.checked { 
    background: var(--success); 
    border-color: var(--success); 
    box-shadow: 0 0 10px var(--success); 
}
.task-checkbox.checked::after { 
    content: '✓'; 
    color: white; 
    font-weight: bold; 
    font-size: 1.2rem; 
}

.task-content { 
    flex: 1; 
    min-width: 0; 
}
.task-title { 
    font-weight: 600; 
    font-size: 1.1rem; 
    color: white; 
    margin-bottom: 6px; 
    letter-spacing: -0.3px; 
}
.task-meta { 
    display: flex; 
    gap: 12px; 
    font-size: 0.85rem; 
    color: var(--text-secondary); 
    flex-wrap: wrap; 
    align-items: center; 
}

.task-category {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
}

.cat-study { 
    color: #60a5fa; 
    border-color: #60a5fa; 
}
.cat-exam { 
    color: #f472b6; 
    border-color: #f472b6; 
}
.cat-assignment { 
    color: #fbbf24; 
    border-color: #fbbf24; 
}
.cat-personal { 
    color: #34d399; 
    border-color: #34d399; 
}
.cat-health { 
    color: #a78bfa; 
    border-color: #a78bfa; 
}

.priority-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.p-low { 
    background: var(--priority-low); 
}
.p-medium { 
    background: var(--priority-medium); 
}
.p-high { 
    background: var(--priority-high); 
}
.p-urgent { 
    background: var(--priority-urgent); 
    animation: pulse 2s infinite; 
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.due-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.due-date.overdue { 
    color: var(--danger); 
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); 
}
.due-date.today { 
    color: var(--warning); 
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.5); 
}

.task-actions { 
    display: flex; 
    gap: 8px; 
    opacity: 0; 
    transition: var(--transition); 
}
.task-item:hover .task-actions { 
    opacity: 1; 
}

.action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover { 
    background: white; 
    transform: scale(1.1); 
}
.action-btn.delete:hover { 
    background: var(--danger); 
    color: white; 
}

.timeline-container {
    position: relative;
    padding-left: 40px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.2);
}

.timeline-group { 
    margin-bottom: 30px; 
}
.timeline-date {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-shadow: 0 0 10px var(--primary-glow);
}

.timeline-item {
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 0 10px var(--primary-glow);
}

.timeline-item:hover {
    transform: translateX(5px);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    animation: fadeIn 0.6s ease;
}

.empty-state.hidden { 
    display: none; 
}
.empty-icon { 
    font-size: 5rem; 
    margin-bottom: 20px; 
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3)); 
}
.empty-state h2 { 
    font-size: 2rem; 
    margin-bottom: 10px; 
    color: white; 
    font-weight: 700; 
}
.empty-state p { 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    opacity: 0.9; 
}

.modal {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-width: 550px;
    width: 90%;
    margin: auto;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content { padding: 30px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header h2 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: white; 
}
.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}
.close-btn:hover { 
    color: white; 
    transform: rotate(90deg); 
}

.form-group { 
    margin-bottom: 20px; 
}
.form-group label { 
    display: block; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
}
.form-row { 
    display: flex; 
    gap: 20px; 
}
.half { 
    flex: 1; 
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

option { 
    background: #0f172a; 
    color: white; 
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.secondary-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover { 
    background: rgba(255,255,255,0.2); 
}

.danger-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.danger-btn:hover { 
    background: #dc2626; 
    transform: scale(1.05); 
}

.spacer { 
    flex: 1; 
}

.theme-menu {
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-menu:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-menu button {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 1rem;
}

.theme-menu button:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
    transform: translateX(5px); 
}

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
    font-weight: 500;
}

.toast.success { 
    border-left-color: var(--success); 
}
.toast.error { 
    border-left-color: var(--danger); 
}
.toast.warning { 
    border-left-color: var(--warning); 
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1024px) {
    .app-wrapper { 
        flex-direction: column; 
        padding: 15px; 
    }
    .sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid rgba(255,255,255,0.1); 
        padding: 20px; 
    }
    .sidebar-nav { 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: center; 
    }
    .nav-item { 
        flex: 1; 
        justify-content: center; 
        font-size: 0.9rem; 
        padding: 10px; 
    }
    .badge { 
        display: none; 
    }
    .kanban-board { 
        grid-template-columns: 1fr; 
    }
    .main-header { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .search-container { 
        width: 100%; 
    }
    .view-controls { 
        justify-content: center; 
    }
}

@media (max-width: 768px) {
    .task-item { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
    }
    .task-actions { 
        width: 100%; 
        justify-content: flex-end; 
        margin-top: 10px; 
    }
    .form-row { 
        flex-direction: column; 
        gap: 0; 
    }
    .modal-content { 
        padding: 20px; 
    }
    .timeline-container { 
        padding-left: 25px; 
    }
    .timeline-container::before { 
        left: 8px; 
    }
    .timeline-item::before { 
        left: -28px; 
    }
}

.app-wrapper { max-width: none; padding: 12px; gap: 12px; }
.sidebar { width: 240px; padding: 18px; }
.main-content { gap: 12px; }
.main-header { padding: 10px 14px; min-height: 42px; }
.sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; background: rgba(255,255,255,0.1); color: white; cursor: pointer; font-size: 1.1rem; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }
.sidebar-collapsed .sidebar { display: none; }
.sidebar-collapsed .main-content { width: 100%; }
@media (max-width: 1024px) {
    .app-wrapper { flex-direction: row; }
    .sidebar { width: 240px; }
}

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}
::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
}
::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.2); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(255,255,255,0.3); 
}