/* Global Reset & Variables */
:root {
    /* Default (Dark) */
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --surface-bg: rgba(0, 0, 0, 0.2);
    /* Used for inputs, cards */
    --glass-border: rgba(255, 255, 255, 0.1);

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #ec4899;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-nav: 0 4px 30px rgba(0, 0, 0, 0.5);

    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 20%);
}

[data-theme="light"] {
    --bg-color: #e0f2fe;
    --card-bg: rgba(255, 255, 255, 0.6);
    --surface-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.4);

    --text-main: #0f172a;
    --text-muted: #475569;

    --shadow-nav: 0 4px 30px rgba(0, 0, 0, 0.05);

    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 20%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: var(--bg-gradient);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-container {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    padding: 2rem;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

/* Tasks Module */
.task-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    flex: 1;
    position: relative;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    padding: 0 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-icon {
    padding: 0.75rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition);
}

.task-item.completed .checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

.task-item.completed .checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.task-text {
    flex: 1;
    font-size: 1.1rem;
}

.delete-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.delete-btn:hover {
    color: #ef4444;
    /* Red 500 */
    background: rgba(239, 68, 68, 0.1);
}

/* Timers Module */
.timers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.timer-card {
    background: var(--surface-bg);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.timer-card h3 {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.time-display {
    font-family: 'Courier Prime', monospace;
    /* Monospaced for numbers */
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.timer-controls .btn {
    padding: 1rem 2.5rem;
    /* Increased padding */
    font-size: 1.25rem;
    /* Increased font size */
    border-radius: 16px;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--text-main);
    color: var(--bg-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem 2rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--glass-border);
        border-right: none;
    }

    .nav-links {
        flex-direction: row;
    }

    .nav-item span {
        display: none;
    }

    .logo span {
        display: none;
    }
}