/* ===== General Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    overflow: hidden;
}

/* ===== Header Section ===== */
.header {
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ===== Main Content ===== */
.main-content {
    padding: 30px 20px;
}

/* ===== Form Section ===== */
.form-section {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-field,
.filter-field {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus,
.filter-field:focus {
    outline: none;
    border-color: #2d5aa0;
    box-shadow: 0 0 0 3px rgba(45, 90, 160, 0.1);
}

.error-message {
    font-size: 0.75rem;
    color: #e74c3c;
    min-height: 16px;
    display: block;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-add {
    background: linear-gradient(135deg, #2d5aa0 0%, #1a365d 100%);
    color: white;
    align-self: flex-end;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 90, 160, 0.4);
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #d0d0d0;
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

.btn-delete {
    background: #d32f2f;
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-delete:hover {
    background: #b71c1c;
}

.btn-complete {
    background: #2e7d32;
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-complete:hover {
    background: #1b5e20;
}

/* ===== Action Section ===== */
.action-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.filter-field {
    flex: 1;
    min-width: 100px;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* ===== To-Do Section ===== */
.todo-section {
    margin-top: 30px;
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.todo-header h2 {
    font-size: 1.3rem;
    color: #333;
}

.todo-count {
    background: linear-gradient(135deg, #2d5aa0 0%, #1a365d 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-left: 4px solid #2d5aa0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.todo-item:hover {
    box-shadow: 0 3px 10px rgba(45, 90, 160, 0.15);
    background: #f0f3f7;
}

.todo-item.completed {
    opacity: 0.6;
    border-left-color: #2e7d32;
}

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

.todo-content {
    flex: 1;
}

.todo-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.todo-date {
    font-size: 0.85rem;
    color: #999;
}

.todo-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* ===== Footer Section ===== */
.footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .form-section {
        grid-template-columns: 1fr;
    }

    .btn-add {
        align-self: stretch;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .action-section {
        flex-direction: column;
    }

    .filter-group {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .todo-actions {
        margin-left: 0;
        width: 100%;
    }

    .btn-delete,
    .btn-complete {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 0;
    }

    .main-content {
        padding: 20px 15px;
    }

    .header {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .header .subtitle {
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .input-field,
    .filter-field {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}