:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4cb944;
    --background-color: #f5f7fa;
    --text-color: #333;
    --task-bg: #fff;
    --border-color: #ddd;
    --low-priority: #4caf50;
    --medium-priority: #ff9800;
    --high-priority: #f44336;
    --sidebar-width: 280px;
    --font-size: 16px;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dark-mode {
    --primary-color: #6c8fc7;
    --secondary-color: #1a7bb6;
    --accent-color: #5cc950;
    --background-color: #1e1e1e;
    --text-color: #f0f0f0;
    --task-bg: #2d2d2d;
    --border-color: #444;
}

.ocean-theme {
    --primary-color: #3a86ff;
    --secondary-color: #2667cc;
    --accent-color: #8338ec;
    --background-color: #f8f9fa;
    --text-color: #212529;
}

.forest-theme {
    --primary-color: #2a9d8f;
    --secondary-color: #264653;
    --accent-color: #e9c46a;
    --background-color: #f1faee;
    --text-color: #1d3557;
}

.high-contrast {
    --background-color: #000;
    --text-color: #fff;
    --task-bg: #222;
    --border-color: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    font-size: var(--font-size);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--task-bg);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s;
    position: relative;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-content {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: bold;
}

.username {
    font-weight: 600;
}

.nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: none;
    background: none;
    color: var(--text-color);
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-btn:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

.filters {
    margin: 1.5rem 0;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--task-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.theme-selector {
    margin: 1.5rem 0;
}

.theme-options {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.theme-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.theme-option:hover {
    transform: scale(1.1);
}

.theme-option[data-theme="default"] {
    background: linear-gradient(135deg, #4a6fa5 50%, #f5f7fa 50%);
}

.theme-option[data-theme="dark"] {
    background: linear-gradient(135deg, #6c8fc7 50%, #1e1e1e 50%);
}

.theme-option[data-theme="ocean"] {
    background: linear-gradient(135deg, #3a86ff 50%, #f8f9fa 50%);
}

.theme-option[data-theme="forest"] {
    background: linear-gradient(135deg, #2a9d8f 50%, #f1faee 50%);
}

.theme-option.active {
    border-color: var(--accent-color);
}

.accessibility {
    margin: 1.5rem 0;
}

.accessibility-options {
    margin-top: 0.5rem;
}

.accessibility-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.font-size-control {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.font-size-control button {
    padding: 0.25rem 0.5rem;
    background: var(--task-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--task-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
}

#menu-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    display: none;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.header-actions button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.header-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.view-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.task-input {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background-color: var(--task-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.task-input input[type="text"] {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--task-bg);
    color: var(--text-color);
    font-size: 1rem;
    width: 100%;
}

.task-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.task-options select, .task-options input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--task-bg);
    color: var(--text-color);
    font-size: 0.9rem;
}

#add-task {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
    align-self: flex-end;
}

#add-task:hover {
    background: var(--secondary-color);
}

.progress-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    background-color: var(--task-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 0.6s ease;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.2rem;
}

.progress-stats {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--task-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--priority-color, #4a6fa5);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: grab;
    position: relative;
}

.task:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task.completed {
    opacity: 0.7;
}

.task.completed .task-title {
    text-decoration: line-through;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
}

.task-category {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-actions button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.task-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.task-actions .complete-btn {
    color: var(--success-color);
}

.task-actions .delete-btn {
    color: var(--danger-color);
}

.subtask-list {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
}

.subtask {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.subtask input[type="checkbox"] {
    margin-right: 0.5rem;
}

.calendar-view {
    display: none;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.calendar-header button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem;
    color: var(--text-color);
    opacity: 0.8;
}

.calendar-day {
    min-height: 100px;
    background: var(--task-bg);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--border-color);
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day-number {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.calendar-day-today {
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-task {
    font-size: 0.75rem;
    padding: 0.25rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.rewards-view, .history-view {
    display: none;
}

.badges-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.badge {
    background: var(--task-bg);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge i {
    font-size: 2rem;
    color: var(--accent-color);
}

.badge.locked {
    opacity: 0.5;
}

.badge.locked i {
    color: var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: var(--task-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    opacity: 0.8;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.history-list {
    margin-top: 1rem;
}

.history-item {
    background: var(--task-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-action {
    font-weight: 600;
}

.history-task {
    flex: 1;
    margin: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: 0.85rem;
    opacity: 0.7;
}

.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 90;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.fab:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.fab-options {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s;
}

.fab-container.active .fab-options {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.fab-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--task-bg);
    color: var(--text-color);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.fab-option:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--task-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.onboarding {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-content {
    background: var(--task-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
}

.onboarding-slide h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.onboarding-slide p {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.next-slide, .start-using {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.next-slide:hover, .start-using:hover {
    background: var(--secondary-color);
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    #menu-toggle {
        display: block;
    }

    .task-options {
        flex-direction: column;
    }

    .progress-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .progress-stats {
        width: 100%;
    }

    .calendar-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .calendar-day {
        min-height: auto;
    }

    .badges-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    :root {
        --font-size: 14px;
    }

    .task-input {
        padding: 0.75rem;
    }

    .task {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .task-actions {
        align-self: flex-end;
    }

    .badges-container {
        grid-template-columns: repeat(2, 1fr);
    }
}