:root {
    /* Light Theme Variables */
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary-color: #0ea5e9; /* Sky 500 */
    --success-color: #10b981; /* Emerald 500 */
    --danger-color: #ef4444; /* Red 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    --bg-color: #f3f4f6; /* Gray 100 */
    --card-bg: #ffffff;
    --text-main: #1f2937; /* Gray 800 */
    --text-secondary: #6b7280; /* Gray 500 */
    --border-color: #e5e7eb; /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --primary-color: #6366f1; /* Indigo 500 */
    --primary-hover: #818cf8; /* Indigo 400 */
    --bg-color: #111827; /* Gray 900 */
    --card-bg: #1f2937; /* Gray 800 */
    --text-main: #f9fafb; /* Gray 50 */
    --text-secondary: #9ca3af; /* Gray 400 */
    --border-color: #374151; /* Gray 700 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-btn:hover {
    background-color: var(--border-color);
    transform: rotate(15deg);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.02);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.card-body {
    padding: 25px;
}

/* Input Form */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-control label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="date"],
select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    filter: brightness(110%);
}

.btn-info {
    background-color: var(--secondary-color);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.actions-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

/* Task List */
.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
}

#progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: right;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.5s ease;
}

.task-list {
    list-style: none;
}

.task-item {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid transparent;
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-item.priority-3 { border-left-color: var(--danger-color); }
.task-item.priority-2 { border-left-color: var(--warning-color); }
.task-item.priority-1 { border-left-color: var(--success-color); }

.task-item.completed {
    opacity: 0.6;
    background-color: transparent;
    border: 1px solid var(--border-color);
}

.task-item.completed .task-info {
    text-decoration: line-through;
}

.task-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.checkbox-wrapper input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-info {
    display: flex;
    flex-direction: column;
}

.task-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.task-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Schedule & Tips */
.schedule-timeline {
    position: relative;
    padding-left: 20px;
}

.schedule-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.schedule-item {
    position: relative;
    padding-left: 25px;
    margin-bottom: 20px;
}

.schedule-item::before {
    content: '';
    position: absolute;
    left: -24px; /* Adjust for padding + line width */
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid var(--card-bg);
    z-index: 1;
}

.schedule-item-break::before {
    background-color: var(--warning-color);
}

.schedule-time {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.schedule-content {
    background-color: var(--bg-color);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tips-box {
    margin-top: 30px;
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.tips-box h3 {
    color: var(--warning-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-with-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .progress-container {
        width: 100%;
    }
    
    .schedule-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .add-to-calendar-btn {
        width: 100%;
        text-align: center;
    }
}
