/* Modern Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

/* 1. Overall Layout */
.todo-container {
    background: white;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 0.5rem;
}

.date-display {
    color: #888;
    font-size: 0.95rem;
    font-weight: 500;
}

/* 5. Progress Bar */
.progress-section {
    background: #fafafa;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #eee;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #10B981;
    /* Green fill */
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Input Area */
.input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group {
    display: flex;
    flex: 1;
    gap: 8px;
}

#todo-input {
    flex: 2;
    /* Takes more space */
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

#todo-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#category-select {
    flex: 1;
    padding: 0 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: white;
    cursor: pointer;
    font-size: 0.95rem;
    outline: none;
}

#add-btn {
    padding: 12px 20px;
    background-color: #3B82F6;
    /* Blue */
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#add-btn:hover {
    background-color: #2563EB;
}

/* Filter Section */
.filter-section {
    display: flex;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 12px;
    gap: 4px;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: #6B7280;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: #111;
}

.filter-btn.active {
    background: white;
    color: #3B82F6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 4. Todo List */
.todo-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
}

.todo-item {
    background: white;
    border: 1px solid #f3f4f6;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.todo-item:hover {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
    /* Prevent text overflow */
}

/* Checkbox */
.check-circle {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    /* Slightly rounded square like standard checkboxes */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    transition: all 0.2s;
}

.todo-item.completed .check-circle {
    background-color: #10B981;
    border-color: #10B981;
}

/* Text */
.todo-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.todo-text {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 500;
    transition: all 0.2s;
}

.todo-category {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    width: fit-content;
}

/* 3. Category Colors (Badges) */
.badge-business {
    background-color: #EFF6FF;
    /* Light Blue */
    color: #3B82F6;
}

.badge-personal {
    background-color: #ECFDF5;
    /* Light Green */
    color: #10B981;
}

.badge-study {
    background-color: #F5F3FF;
    /* Light Purple */
    color: #8B5CF6;
}

/* Completed State */
.todo-item.completed {
    opacity: 0.6;
}

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

/* Delete Button */
.delete-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background-color: #FEF2F2;
    color: #EF4444;
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 1.5rem;
}

.text-btn {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
}

.text-btn:hover {
    color: #EF4444;
    text-decoration: underline;
}

/* Scrollbar */
.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-thumb {
    background-color: #e5e7eb;
    border-radius: 3px;
}

/* 6. Responsive */
@media (max-width: 480px) {
    .todo-container {
        padding: 1.5rem;
    }

    .input-area {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        flex-direction: row;
    }

    #add-btn {
        width: 100%;
    }
}