/* Green Theme Task List Styles */

/* CSS Variables - Green Palette (Default) */
:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #34D399;
    --background: #ECFDF5;
    --surface: #FFFFFF;
    --text-primary: #064E3B;
    --text-secondary: #065F46;
    --text-muted: #6B7280;
    --border: #A7F3D0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow: rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(16, 185, 129, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(16, 185, 129, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(16, 185, 129, 0.1);
}

/* Yellow Theme */
[data-theme="yellow"] {
    --primary: #F59E0B;
    --primary-dark: #D97706;
    --primary-light: #FBBF24;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #92400E;
    --text-secondary: #B45309;
    --text-muted: #6B7280;
    --border: #FDE68A;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow: rgba(245, 158, 11, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(245, 158, 11, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(245, 158, 11, 0.1);
}

/* Red Theme */
[data-theme="red"] {
    --primary: #EF4444;
    --primary-dark: #DC2626;
    --primary-light: #F87171;
    --background: #FEF2F2;
    --surface: #FFFFFF;
    --text-primary: #991B1B;
    --text-secondary: #B91C1C;
    --text-muted: #6B7280;
    --border: #FECACA;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow: rgba(239, 68, 68, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(239, 68, 68, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(239, 68, 68, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.theme-icon {
    display: inline-block;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: white;
    color: var(--primary-dark);
}

.btn-primary:hover {
    background-color: var(--background);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-text {
    display: inline;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.search-input,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Task List */
.task-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-subtext {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Task Card */
.task-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.task-card.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-card.priority-high {
    border-left-color: var(--danger);
}

.task-card.priority-medium {
    border-left-color: var(--warning);
}

.task-card.priority-low {
    border-left-color: var(--primary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.task-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.task-meta-item .icon {
    font-size: 1rem;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.high {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.priority-badge.medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.priority-badge.low {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.task-tag {
    background-color: var(--background);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-action-btn.complete {
    background-color: var(--success);
    color: white;
}

.task-action-btn.complete:hover {
    background-color: var(--primary-dark);
}

.task-action-btn.edit {
    background-color: var(--primary);
    color: white;
}

.task-action-btn.edit:hover {
    background-color: var(--primary-dark);
}

.task-action-btn.delete {
    background-color: var(--danger);
    color: white;
}

.task-action-btn.delete:hover {
    background-color: #DC2626;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 30px;
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--danger);
}

/* Form */
.task-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 640px) {
    .app-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
    
    .task-card {
        padding: 16px;
    }
    
    .task-title {
        font-size: 1.1rem;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .task-action-btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}