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

:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --shadow-color: rgba(102, 126, 234, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    transition: background 0.5s ease;
}

body.theme-blue {
    --primary-start: #4facfe;
    --primary-end: #00f2fe;
    --shadow-color: rgba(79, 172, 254, 0.4);
}

body.theme-green {
    --primary-start: #43e97b;
    --primary-end: #38f9d7;
    --shadow-color: rgba(67, 233, 123, 0.4);
}

body.theme-orange {
    --primary-start: #fa709a;
    --primary-end: #fee140;
    --shadow-color: rgba(250, 112, 154, 0.4);
}

body.theme-dark {
    --primary-start: #2c3e50;
    --primary-end: #34495e;
    --shadow-color: rgba(52, 73, 94, 0.4);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    padding: 40px 30px;
    transition: background 0.5s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.theme-switcher {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    padding: 3px;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: white;
}

.theme-btn.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.theme-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.todo-input-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.priority-select {
    cursor: pointer;
    font-weight: 500;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 20px;
}

.btn-add {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-add:active {
    transform: translateY(0);
}

.controls-section {
    padding: 25px 30px;
    background: white;
    border-bottom: 2px solid #e9ecef;
}

.filter-section,
.sort-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section:last-of-type,
.sort-section {
    margin-bottom: 20px;
}

.control-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-buttons,
.sort-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-btn,
.priority-filter-btn,
.sort-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.filter-btn:hover,
.priority-filter-btn:hover,
.sort-btn:hover {
    border-color: var(--primary-start);
    color: var(--primary-start);
}

.filter-btn.active,
.priority-filter-btn.active,
.sort-btn.active {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    border-color: transparent;
}

.task-count {
    color: #666;
    font-weight: 600;
    font-size: 1em;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 10px;
}

.todo-list-section {
    padding: 30px;
    min-height: 300px;
}

.todo-list {
    list-style: none;
}

.todo-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.todo-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #999;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    flex-shrink: 0;
}

.priority-badge.high {
    background: #ffe5e5;
    color: #e74c3c;
}

.priority-badge.medium {
    background: #fff4e5;
    color: #f39c12;
}

.priority-badge.low {
    background: #e5f9e5;
    color: #27ae60;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-text {
    font-size: 1.05em;
    color: #333;
    word-wrap: break-word;
    margin-bottom: 5px;
}

.todo-date {
    font-size: 0.85em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-icon {
    font-size: 0.9em;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1em;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .theme-switcher {
        justify-content: center;
    }

    .filter-section,
    .sort-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-label {
        width: 100%;
    }

    .filter-buttons,
    .sort-buttons {
        width: 100%;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    header {
        padding: 30px 20px;
    }

    .header-text h1 {
        font-size: 2em;
    }

    .todo-input-section,
    .todo-list-section {
        padding: 20px;
    }

    .controls-section {
        padding: 20px;
    }

    .todo-item {
        flex-wrap: wrap;
    }

    .btn-delete {
        width: 100%;
        margin-top: 10px;
    }
}