:root {
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.75);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color); color: var(--text-color);
    min-height: 100vh; display: flex; overflow-x: hidden;
    background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
}

#splash-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-color); z-index: 3000; display: flex;
    flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.3s ease;
}
.splash-img {
    width: 100vw; height: 100vh; object-fit: cover; position: absolute; top: 0; left: 0; z-index: -1;
}
.splash-content {
    background: rgba(15, 23, 42, 0.85); padding: 2rem; border-radius: 20px;
    backdrop-filter: blur(10px); text-align: center; border: 1px solid var(--border-color);
}
.splash-logo {
    font-size: 2rem; font-weight: 700; background: var(--primary-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px;
}

aside {
    width: 260px; background: var(--card-bg); backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color); display: flex; flex-direction: column;
    justify-content: space-between; padding: 2rem 1.5rem; position: fixed; height: 100vh; z-index: 100;
}

.logo {
    display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 700;
    background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 2.5rem;
}

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }

.nav-link {
    display: flex; align-items: center; gap: 15px; padding: 12px 16px;
    color: var(--text-muted); text-decoration: none; border-radius: 12px;
    font-weight: 500; transition: all 0.3s ease; cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-gradient); color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.nav-link i { font-size: 1.2rem; }

main {
    margin-left: 260px; flex-grow: 1; padding: 2.5rem; max-width: calc(100vw - 260px); padding-bottom: 4rem;
}

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; gap: 15px; }
.header-title h1 { font-size: 1.8rem; font-weight: 700; }
.header-title p { color: var(--text-muted); font-size: 0.9rem; }

.user-profile {
    display: flex; align-items: center; gap: 10px; background: var(--card-bg);
    padding: 6px 12px; border-radius: 50px; border: 1px solid var(--border-color); flex-shrink: 0; cursor: pointer;
}
.user-profile img { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }
.user-profile span { font-size: 0.9rem; font-weight: 500; }

#auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
    z-index: 2000; display: none; justify-content: center; align-items: center;
}
.auth-card {
    background: var(--card-bg); border: 1px solid var(--border-color); padding: 3rem 2rem;
    border-radius: 24px; text-align: center; max-width: 400px; width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.auth-card h2 { font-size: 1.8rem; margin-bottom: 1rem; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.google-btn {
    background: white; color: #1e293b; border: none; padding: 12px 24px; border-radius: 12px;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; font-size: 1rem; transition: transform 0.3s; box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}
.google-btn:hover { transform: scale(1.02); }

.task-action-bar { display: flex; gap: 15px; margin-bottom: 2rem; flex-wrap: wrap; }
.btn {
    background: var(--primary-gradient); color: white; border: none; padding: 12px 20px;
    border-radius: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 10px; transition: all 0.3s; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    white-space: nowrap; outline: none;
}
.btn:hover { opacity: 0.9; transform: scale(1.02); }

.search-box {
    flex-grow: 1; min-width: 200px; background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; display: flex; align-items: center; padding: 0 16px; backdrop-filter: blur(12px);
}
.search-box input {
    background: transparent; border: none; outline: none; color: white; padding: 12px; width: 100%; font-size: 0.95rem;
}
.search-box i { color: var(--text-muted); }

.tasks-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.task-card {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px;
    padding: 1.5rem; backdrop-filter: blur(12px); display: flex; flex-direction: column; justify-content: space-between; transition: all 0.3s;
}
.task-card:hover { border-color: rgba(99, 102, 241, 0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.task-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; gap: 10px; }
.task-title { font-size: 1.1rem; font-weight: 600; word-break: break-word; }
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-muted); }

.priority-badge { font-size: 0.7rem; padding: 4px 8px; border-radius: 20px; font-weight: 600; text-transform: uppercase; flex-shrink: 0; }
.priority-high { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.priority-medium { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.priority-low { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.task-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; word-break: break-word; }
.task-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 1rem; gap: 10px; }
.task-date { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.task-actions { display: flex; gap: 12px; }
.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; transition: color 0.2s; padding: 4px; }
.icon-btn.complete:hover { color: var(--success); }
.icon-btn.delete:hover { color: var(--danger); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card {
    background: var(--card-bg); border: 1px solid var(--border-color); padding: 1.5rem;
    border-radius: 20px; backdrop-filter: blur(12px); display: flex; align-items: center; gap: 20px;
}
.stat-icon { width: 55px; height: 55px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.stat-icon.total { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.stat-icon.pending { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-icon.completed { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.stat-info h3 { font-size: 1.6rem; font-weight: 700; }
.stat-info p { color: var(--text-muted); font-size: 0.85rem; }

.analytics-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.analytics-card { background: var(--card-bg); border: 1px solid var(--border-color); padding: 2rem; border-radius: 20px; backdrop-filter: blur(12px); }
.analytics-card h3 { margin-bottom: 1rem; font-size: 1.2rem; }
.progress-bar-container { background: rgba(255,255,255,0.05); border-radius: 20px; height: 25px; width: 100%; overflow: hidden; margin-top: 15px; border: 1px solid var(--border-color); }
.progress-bar { background: var(--primary-gradient); height: 100%; width: 0%; transition: width 0.6s ease; border-radius: 20px; }

.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); z-index: 1000; justify-content: center; align-items: center; padding: 1rem;
}
.modal.active { display: flex; }
.modal-content {
    background: #1e293b; border: 1px solid var(--border-color); padding: 2rem; border-radius: 24px;
    width: 100%; max-width: 450px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.close-modal { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.85rem; }
.form-control {
    width: 100%; background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border-color);
    padding: 12px 16px; border-radius: 12px; color: white; outline: none; font-size: 1rem;
}
.form-control:focus { border-color: var(--primary); }

@media (max-width: 768px) {
    body { flex-direction: column; }
    aside {
        width: 100%; height: 70px; position: fixed; bottom: 0; left: 0; top: auto;
        flex-direction: row; padding: 0 1rem; border-right: none; border-top: 1px solid var(--border-color);
        align-items: center; background: rgba(15, 23, 42, 0.95);
    }
    aside .logo { display: none; }
    .nav-links { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
    .nav-link { flex-direction: column; gap: 4px; padding: 8px 12px; font-size: 0.7rem; border-radius: 10px; align-items: center; }
    .nav-link i { font-size: 1.2rem; }
    aside > div:last-child { display: none; }
    main { margin-left: 0; max-width: 100vw; padding: 1.25rem; padding-bottom: 90px; }
    header { flex-direction: column; align-items: flex-start; margin-bottom: 1.5rem; gap: 10px; }
    .user-profile { align-self: flex-end; margin-top: -45px; }
    .task-action-bar, .analytics-container { flex-direction: column; grid-template-columns: 1fr; }
    .btn { width: 100%; }
}