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

:root {
    /* Light Theme Colors */
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Borders and Shadows */
    --border-color: #e2e8f0;
    --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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Overdue Task Colors */
    --overdue-bg: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    --overdue-text: #991b1b;
    --overdue-text-muted: #dc2626;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    
    /* Dark Theme Overdue Colors */
    --overdue-bg: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    --overdue-text: #fecaca;
    --overdue-text-muted: #fca5a5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* App Container */
.app-container {
    min-height: 100vh;
    background: var(--bg-secondary);
    position: relative;
}

/* Header Styles */
.app-header {
    background: var(--primary-gradient);
    /* Extra top padding so header action buttons never overlap the title */
    padding: 5.5rem 0 2rem 0;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.app-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.app-title i {
    font-size: 2.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

.app-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    margin-top: 0.25rem;
}

.header-actions {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10;
}

/* Mobile: reposition buttons to top corners */
@media (max-width: 768px) {
    .header-actions {
        position: absolute;
        top: 0.75rem;
        left: 1rem;
        right: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    
    .user-info {
        order: 1; /* Move to left */
    }
    
    .theme-toggle {
        order: 2; /* Move to right */
    }
    
    /* Mobile filter buttons - make them wrap to multiple rows */
    .task-filters {
        padding-bottom: 0.5rem;
    }
    
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        flex: 0 0 auto;
        min-width: 0;
    }
    
    .filter-btn i {
        font-size: 0.75rem;
    }
    
    /* Hide sort options on mobile to save space */
    .sort-options {
        display: none;
    }
}

/* Toggle switch */
.theme-toggle {
    --toggle-width: 48px;
    --toggle-height: 28px;
    --thumb-size: 22px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--toggle-width);
    height: var(--toggle-height);
    cursor: pointer;
}
.theme-toggle input { display: none; }
.theme-toggle .toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(8px);
    transition: background var(--transition-normal), border-color var(--transition-normal);
}
.theme-toggle .toggle-thumb {
    position: absolute;
    top: 50%;
    left: 3px;
    width: var(--thumb-size);
    height: var(--thumb-size);
    background: white;
    border-radius: 50%;
    transform: translate(0, -50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform var(--transition-normal), background var(--transition-normal);
}
.theme-toggle input:checked + .toggle-track { background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.5); }
.theme-toggle input:checked + .toggle-track .toggle-thumb { transform: translate(calc(var(--toggle-width) - var(--thumb-size) - 6px), -50%); background: #111827; }

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Add Task Section */
.add-task-section {
    margin-bottom: 2rem;
}

.add-task-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.task-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.add-task-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

/* Quick Actions */
.quick-actions {
    display: none;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.quick-actions.show {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 120px;
    justify-content: center;
    will-change: transform;
}

.quick-action-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn[data-priority="high"]:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.quick-action-btn[data-priority="medium"]:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
}

.quick-action-btn[data-priority="low"]:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%);
    color: #166534;
}

/* Task Filters */
.task-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sort-label i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
}

.sort-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sort-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.sort-btn:hover::before {
    left: 100%;
}

.sort-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sort-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}



/* Task Stats */
.task-stats {
    margin-bottom: 1rem;
}

.combined-stats {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.combined-stats:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
}

.stat-column {
    text-align: center;
    flex: 1;
}

.stat-divider {
    width: 1px;
    height: 3rem;
    background: var(--border-color);
    opacity: 0.6;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Task List Section */
.task-list-section {
    margin-top: 0;
}

/* Task List */
.task-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: 0;
}

/* Desktop: Two columns */
@media (min-width: 1024px) {
    .task-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .task-item {
        min-height: 140px;
    }
}

/* Large Desktop: Three columns for very wide screens */
@media (min-width: 1440px) {
    .task-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.task-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.task-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.task-item:hover::before {
    transform: scaleY(1);
}

.task-item.completed {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: var(--success-color);
}

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

/* Override overdue styles when task is completed */
.task-item.completed.overdue {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border-color: var(--success-color) !important;
}

.task-item.completed.overdue .task-name {
    text-decoration: line-through !important;
    color: var(--text-muted) !important;
}

.task-item.completed.overdue .task-description {
    color: var(--text-muted) !important;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-checkbox {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    background: var(--bg-primary);
    appearance: none;
    outline: none;
}

.task-checkbox.checked {
    background: var(--success-color);
    border-color: var(--success-color);
    animation: checkmark 0.3s ease;
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

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

.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-priority.high {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.task-priority.medium {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
}

.task-priority.low {
    background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%);
    color: #166534;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}



.task-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
}

.task-action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Task Item Styles */
.task-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    display: none;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.empty-state.show {
    display: block;
    height: auto;
    padding: 2rem 1rem;
    margin: 0;
    animation: fadeInUp 0.5s ease;
}

.empty-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}



/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideInUp 0.3s ease;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.modal-input,
.modal-textarea,
.modal-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

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

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary,
.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

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

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

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

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

.toast.show {
    display: flex;
}

/* Animations */
@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Task Item Animations */
    .task-item {
        animation: slideInLeft 0.5s ease;
    }
    
    @keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
    
    /* Overdue Task Styles */
    .overdue {
        border-color: var(--danger-color) !important;
        background: var(--overdue-bg) !important;
    }
    
    .overdue .task-name {
        color: var(--overdue-text) !important;
    }
    
    .overdue .task-description {
        color: var(--overdue-text-muted) !important;
    }
    
    /* Keep priority colors even when overdue */
    .overdue .task-priority.high {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
        color: #92400e !important;
    }
    
    .overdue .task-priority.medium {
        background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%) !important;
        color: #1e40af !important;
    }
    
    .overdue .task-priority.low {
        background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%) !important;
        color: #166534 !important;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .app-header { padding: 3.25rem 0 1.25rem 0; }
    .header-content { padding: 0 1rem; }
    .header-actions { position: static; justify-content: center; margin-top: 0.5rem; gap: 0.5rem; }
    .app-title { font-size: 1.8rem; }
    .app-title i { font-size: 1.6rem; }
    .main-content { padding: 1rem; }
    .add-task-container { padding: 1.5rem; }
    .input-group { flex-direction: column; }
    .quick-actions { flex-direction: column; gap: 0.75rem; }
    .quick-action-btn { flex: none; width: 100%; justify-content: center; padding: 1rem 1.5rem; font-size: 1rem; }
    .task-filters { flex-direction: column; align-items: stretch; }
    .filter-buttons { justify-content: center; }
    .sort-options { flex-direction: column; align-items: center; gap: 0.75rem; }
    .sort-buttons { justify-content: center; }
    .task-stats { grid-template-columns: 1fr; }
    .stat-row { gap: 0.5rem; }
    .stat-number { font-size: 1.5rem; }
    .stat-label { font-size: 0.7rem; }
    .modal-content { width: 95%; margin: 1rem; }
    .user-info { flex-wrap: nowrap; }
    .user-id { max-width: 50vw; }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .app-header { padding: 2.75rem 0 1rem 0; }
    .app-title { font-size: 1.6rem; }
    .app-title i { font-size: 1.4rem; }
    .sign-in-btn { padding: 0.45rem 0.85rem; }
    .sign-out-btn { padding: 0.45rem 0.85rem; }
    .theme-toggle { padding: 0.45rem; }
    .user-id { display: none; }
    .quick-action-btn { padding: 1.25rem 1.5rem; font-size: 1.1rem; }
    .add-task-container { padding: 1rem; }
    .main-content { padding: 0.75rem; }
    .sort-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
    .sort-label { font-size: 0.8rem; }
}

/* Mobile devices - hide user info, show only sign out button */
@media (max-width: 768px) {
    .user-id {
        display: none;
    }
    
    .user-info {
        padding: 0;
        gap: 0;
        background: transparent !important;
        border: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    
    .sign-out-btn {
        padding: 0;
        min-width: auto;
        border-radius: 999px;
        width: 48px;
        height: 28px;
        justify-content: center;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .sign-out-btn span {
        display: none;
    }
    
    .sign-out-btn i {
        margin: 0;
        font-size: 0.9rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* User Info and Authentication Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 0.9rem;
    position: relative;
    z-index: 15;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.user-id {
    opacity: 0.8;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.sign-out-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-normal), border-color var(--transition-normal);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 20;
    min-width: 72px;
    justify-content: center;
}

.sign-out-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Sign In Button */
.sign-in-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-normal), border-color var(--transition-normal);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    z-index: 15;
}

.sign-in-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Authentication Modal */
.auth-modal {
    max-width: 450px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.auth-close:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.auth-form {
    margin-bottom: 2rem;
}

.auth-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color var(--transition-normal);
}

.link-btn:hover {
    color: var(--secondary-color);
}

/* Social Authentication */
.social-auth {
    text-align: center;
}

.divider {
    position: relative;
    margin: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.social-btn.google:hover {
    background: #ea4335;
    color: white;
    border-color: #ea4335;
}

.social-btn.facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.social-btn.github:hover {
    background: #333;
    color: white;
    border-color: #333;
}



/* Toast Error Styling */
.toast.error {
    background: var(--danger-color);
}

/* Footer Styles */
.app-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.footer-link:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.footer-separator {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 0 0.25rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-copyright p {
    margin: 0;
}

/* Drag and Drop Styles */
.task-item.draggable {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-item.draggable:hover {
    cursor: grabbing;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.task-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
    z-index: 1000;
    position: relative;
}

.task-item.dragging::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0.1;
    border-radius: var(--radius-lg);
    pointer-events: none;
}

/* Custom sort button styling */
.sort-btn[data-sort="custom"] {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-btn[data-sort="custom"] i {
    font-size: 0.9rem;
}

/* Calendar Modal Styles */
.calendar-modal {
    max-width: 800px;
    width: 90%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.calendar-modal::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.calendar-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.calendar-nav-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

#currentMonth {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.calendar-grid {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    text-align: center;
}

.calendar-header > div {
    padding: 1rem 0.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-header > div:last-child {
    border-right: none;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.calendar-day {
    background: var(--bg-primary);
    min-height: 80px;
    padding: 0.5rem;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.other-month {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.calendar-day-number {
    font-size: 0.9rem;
    font-weight: 500;
}

.calendar-add-task-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 2;
}

.calendar-day:hover .calendar-add-task-btn {
    opacity: 1;
}

.calendar-add-task-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    margin-right: 0.25rem;
}

.calendar-task-dot.completed {
    background: var(--success-color);
}

.calendar-task-dot.active {
    background: var(--warning-color);
}

.calendar-task-dot.overdue {
    background: var(--danger-color);
}

    .calendar-task-count {
        font-size: 0.7rem;
        color: var(--text-secondary);
        margin-top: 0.25rem;
    }

    /* Selected Day Tasks Styles */
    .selected-day-tasks {
        margin-top: 1.5rem;
        background: var(--bg-primary);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        overflow: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }

    .selected-day-tasks::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .selected-day-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        background: var(--primary-gradient);
        color: white;
    }

    .selected-day-header h4 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .close-day-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all var(--transition-normal);
    }

    .close-day-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .add-task-day-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all var(--transition-normal);
        flex-shrink: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .add-task-day-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

    /* Responsive display classes for selected day header buttons */
    .header-desktop-only {
        display: flex;
    }

    .header-mobile-only {
        display: none;
    }

    @media (max-width: 768px) {
        .header-desktop-only {
            display: none;
        }
        
        .header-mobile-only {
            display: flex;
        }
    }

    /* Quick Task Modal Styles */
    .quick-task-modal {
        max-width: 500px;
        width: 90%;
    }

    .quick-task-date {
        margin-bottom: 1rem;
    }

    .quick-task-date label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--text-primary);
    }

    .date-display {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 0.75rem;
        font-weight: 500;
        color: var(--primary-color);
        text-align: center;
    }

    /* Prevent zoom on mobile input focus */
    .quick-task-modal input[type="text"],
    .quick-task-modal select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    @media (max-width: 768px) {
        .quick-task-modal input[type="text"],
        .quick-task-modal select {
            font-size: 16px; /* Ensures no zoom on mobile */
        }
    }

    .close-day-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

    .selected-day-task-list {
        padding: 1rem 1.5rem;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }

    .selected-day-task-list::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .selected-day-task-list .task-item {
        margin-bottom: 1rem;
    }

    .selected-day-task-list .task-item:last-child {
        margin-bottom: 0;
    }

    .calendar-task-item {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        background: var(--bg-secondary);
        border-radius: var(--radius-md);
        border-left: 4px solid var(--border-color);
        transition: all var(--transition-normal);
    }

    .calendar-task-item:hover {
        transform: translateX(4px);
        box-shadow: var(--shadow-md);
    }

    .calendar-task-item.completed {
        border-left-color: var(--success-color);
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    }

    .calendar-task-item.active {
        border-left-color: var(--warning-color);
    }

    .calendar-task-item.overdue {
        border-left-color: var(--danger-color);
        background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    }

    .calendar-task-status {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    .calendar-task-status.completed {
        background: var(--success-color);
    }

    .calendar-task-status.active {
        background: var(--warning-color);
    }

    .calendar-task-status.overdue {
        background: var(--danger-color);
    }

    .calendar-task-content {
        flex: 1;
    }

    .calendar-task-name {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }

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

    .calendar-task-meta {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .calendar-task-priority {
        padding: 0.2rem 0.5rem;
        border-radius: var(--radius-sm);
        font-size: 0.7rem;
        font-weight: 500;
        margin-left: 0.5rem;
    }

    .calendar-task-priority.high {
        background: var(--danger-color);
        color: white;
    }

    .calendar-task-priority.medium {
        background: var(--warning-color);
        color: white;
    }

    .calendar-task-priority.low {
        background: var(--success-color);
        color: white;
    }

    .no-tasks-message {
        text-align: center;
        padding: 2rem;
        color: var(--text-muted);
        font-style: italic;
    }

/* Responsive Calendar */
@media (max-width: 768px) {
    .calendar-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }
    
    .calendar-day-number {
        font-size: 0.8rem;
    }
    
    .calendar-task-dot {
        width: 6px;
        height: 6px;
    }
    
    .calendar-task-count {
        font-size: 0.6rem;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-separator {
        display: none;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
}
