/* ============================================
   MODERN TO-DO APP - COMPLETE STYLING
   ============================================ */

/* === CSS VARIABLES === */
:root {
    /* Dark Theme Colors - Enhanced with Vibrant Gradients */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --accent-2: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Vibrant Background with Gradients */
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
    --bg-secondary: rgba(30, 41, 59, 0.7);
    --bg-tertiary: rgba(51, 65, 85, 0.6);
    --bg-card: rgba(30, 41, 59, 0.5);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    /* Enhanced Glassmorphism */
    --border-color: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(99, 102, 241, 0.3);
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(99, 102, 241, 0.2);
    
    /* Sizing */
    --header-height: 70px;
    --sidebar-width: 280px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --spacing: 1rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* Light Theme - Enhanced with Vibrant Colors */
body.light-theme {
    /* Beautiful gradient backgrounds */
    --bg-primary: linear-gradient(135deg, #fdf4ff 0%, #fef3f2 25%, #fff7ed 50%, #f0f9ff 75%, #fdf4ff 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: rgba(253, 244, 255, 0.5);
    --bg-card: rgba(255, 255, 255, 0.85);
    
    /* Rich text colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    
    /* Colorful borders and shadows */
    --border-color: rgba(99, 102, 241, 0.15);
    --border-glow: rgba(99, 102, 241, 0.25);
    --shadow: rgba(99, 102, 241, 0.08);
    --glow: rgba(139, 92, 246, 0.15);
    
    /* Vibrant primary colors for light mode */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --accent-2: #8b5cf6;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: particleFloat 20s ease-in-out infinite;
    z-index: 0;
}

/* Enhanced particles for light theme */
body.light-theme::before {
    background: radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 10% 90%, rgba(99, 102, 241, 0.1) 0%, transparent 40%);
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    25% { transform: translate(10px, -10px); opacity: 0.7; }
    50% { transform: translate(-10px, 10px); opacity: 0.5; }
    75% { transform: translate(5px, 5px); opacity: 0.7; }
}

/* === HEADER === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Enhanced header for light theme */
body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.1),
                0 0 0 1px rgba(139, 92, 246, 0.1) inset;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* === MAIN LAYOUT === */
.main-container {
    margin-top: var(--header-height);
    display: flex;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--header-height));
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(30, 41, 59, 0.6);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Enhanced sidebar for light theme */
body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.8);
    border-right: 2px solid rgba(139, 92, 246, 0.15);
    box-shadow: 4px 0 30px rgba(139, 92, 246, 0.08),
                0 0 0 1px rgba(139, 92, 246, 0.1) inset;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* === BUTTONS === */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Enhanced icon buttons for light theme */
body.light-theme .icon-btn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

body.light-theme .icon-btn:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4),
                0 0 40px rgba(236, 72, 153, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6),
                0 0 60px rgba(236, 72, 153, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.full-width {
    width: 100%;
}

/* === FILTERS === */
.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Enhanced filters for light theme */
body.light-theme .filter-btn {
    color: var(--text-primary);
}

body.light-theme .filter-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

body.light-theme .filter-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.category-select {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-select:hover {
    border-color: var(--primary);
}

/* === STATISTICS === */
.stats-section {
    background: rgba(30, 41, 59, 0.5);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 0 20px rgba(99, 102, 241, 0.1);
}

/* Enhanced stats for light theme */
body.light-theme .stats-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(253, 244, 255, 0.95) 100%);
    border: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.12),
                0 0 0 1px rgba(139, 92, 246, 0.15) inset;
}

.stat-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    border-radius: 100px;
    transition: width 0.5s ease;
    width: 0;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5),
                0 0 40px rgba(236, 72, 153, 0.3);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 40px rgba(236, 72, 153, 0.3); }
    50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.7), 0 0 60px rgba(236, 72, 153, 0.5); }
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 45px;
}

/* === SEARCH === */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* === TASK INPUT === */
.task-input-card {
    background: rgba(30, 41, 59, 0.5);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 0 40px rgba(99, 102, 241, 0.05);
}

/* Enhanced input card for light theme */
body.light-theme .task-input-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(253, 244, 255, 0.95) 100%);
    border: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.12),
                0 0 0 1px rgba(139, 92, 246, 0.15) inset,
                0 0 60px rgba(236, 72, 153, 0.08);
}

.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.task-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Enhanced inputs for light theme */
body.light-theme .task-input,
body.light-theme .search-input,
body.light-theme .form-input,
body.light-theme .meta-select,
body.light-theme .meta-input,
body.light-theme .category-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(139, 92, 246, 0.15);
}

body.light-theme .task-input:focus,
body.light-theme .search-input:focus,
body.light-theme .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15),
                0 4px 20px rgba(139, 92, 246, 0.1);
}

body.light-theme .meta-select:hover,
body.light-theme .meta-input:hover,
body.light-theme .category-select:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.1);
}

.input-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.meta-group label {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-select,
.meta-input {
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

/* === TASK LIST === */
.task-list-container {
    background: rgba(30, 41, 59, 0.4);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 1rem;
    min-height: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Enhanced task list for light theme */
body.light-theme .task-list-container {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(139, 92, 246, 0.15);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.1),
                0 0 0 1px rgba(139, 92, 246, 0.12) inset;
}

#task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    background: rgba(30, 41, 59, 0.6);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    padding: 1rem;
    transition: var(--transition);
    cursor: move;
    animation: slideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Enhanced task items for light theme */
body.light-theme .task-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 244, 255, 0.98) 100%);
    border: 2px solid rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08),
                0 0 0 1px rgba(139, 92, 246, 0.1) inset;
}

.task-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.task-item:hover::before {
    left: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task-item:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(99, 102, 241, 0.3) inset,
                0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-3px);
}

/* Enhanced task item hover for light theme */
body.light-theme .task-item:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2),
                0 0 0 2px rgba(139, 92, 246, 0.2) inset,
                0 0 40px rgba(236, 72, 153, 0.15);
    transform: translateY(-3px);
}

.task-item.dragging {
    opacity: 0.5;
}

.task-item.completed {
    opacity: 0.7;
}

.task-item.overdue .due-date {
    color: var(--danger);
    font-weight: 600;
}

.task-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.task-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    appearance: none;
    transition: var(--transition-fast);
    position: relative;
    margin-top: 2px;
}

.checkbox:hover {
    border-color: var(--primary);
}

.checkbox:checked {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5),
                0 0 30px rgba(139, 92, 246, 0.3);
}

.checkbox:checked::before {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 0.5rem;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag i {
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.tag i:hover {
    opacity: 1;
    color: var(--danger);
}

.subtask-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.task-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.pin-icon {
    color: var(--warning);
    font-size: 1.1rem;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.priority-badge,
.category-badge,
.due-date {
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.priority-badge {
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.due-date {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.action-btn:hover {
    transform: scale(1.1);
}

.pin-btn:hover {
    background: var(--warning);
    color: white;
}

.details-btn:hover {
    background: var(--info);
    color: white;
}

.edit-btn:hover {
    background: var(--success);
    color: white;
}

.delete-btn:hover {
    background: var(--danger);
    color: white;
}

/* === EDIT INPUT === */
.edit-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* === MODALS === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    padding: 1rem;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 0 40px rgba(99, 102, 241, 0.2);
    transform: scale(0.9);
    transition: var(--transition);
}

/* Enhanced modals for light theme */
body.light-theme .modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 244, 255, 0.98) 100%);
    border: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 20px 80px rgba(139, 92, 246, 0.2),
                0 0 0 1px rgba(139, 92, 246, 0.15) inset,
                0 0 60px rgba(236, 72, 153, 0.15);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* This targets only the small 'X' buttons in the top corners */
.modal-header .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.modal-header .modal-close:hover {
    background: var(--danger);
    color: white;
}

/* This ensures the 'Done' button remains a functional close trigger without being forced into a circle */
.modal-footer .modal-close {
    width: auto;
    height: auto;
    border-radius: var(--border-radius);
}

.modal-body {
    padding: 1.5rem;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.url-output-container {
    display: flex;
    gap: 0.5rem;
}

/* === DETAILS MODAL === */
.details-section {
    margin-bottom: 1.5rem;
}

.details-section:last-child {
    margin-bottom: 0;
}

.details-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.details-section select,
.details-section input,
.details-section textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.details-section textarea {
    resize: vertical;
    min-height: 100px;
}

.subtasks-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.subtask-item input[type="checkbox"] {
    margin: 0;
}

.subtask-item.completed span {
    text-decoration: line-through;
    opacity: 0.6;
}

/* === TOAST NOTIFICATIONS === */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px var(--shadow);
    z-index: 3000;
    opacity: 0;
    transform: translateX(400px);
    transition: var(--transition);
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--info);
}

/* === CONFETTI === */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confetti-fall 3s ease-in forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 4px 0 10px var(--shadow);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 250px;
        --header-height: 60px;
    }

    .header-content {
        padding: 0 1rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .task-input-card {
        padding: 1rem;
    }

    .input-row {
        flex-direction: column;
    }

    .input-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .meta-group {
        width: 100%;
        justify-content: space-between;
    }

    .task-item {
        padding: 0.75rem;
    }

    .task-main {
        flex-direction: column;
    }

    .task-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .task-meta {
        justify-content: flex-start;
    }

    .stat-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .modal-content {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 0.25rem;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .task-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === PRINT STYLES === */
@media print {
    .app-header,
    .sidebar,
    .search-container,
    .task-input-card,
    .task-actions,
    .modal {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .task-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

}
