/* ==================== CSS VARIABLES ==================== */
:root {
    /* Primary Colors - Modern Purple/Blue Gradient */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    
    /* Semantic Colors */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Background & Text */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Backgrounds */
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.9);
    
    /* Borders */
    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;
    
    /* Shadows - Modern & Layered */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 80px rgba(0, 0, 0, 0.2);
    
    /* Modern Effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --blur: blur(10px);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==================== DARK MODE ==================== */
body.dark-mode {
    --text-color: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg-color: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-card: rgba(31, 41, 55, 0.9);
    --border-color: #374151;
    --border-color-light: #4b5563;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background var(--transition-slow);
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(138, 119, 255, 0.3), transparent 50%);
    opacity: 0.6;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

/* ==================== CONTAINER ==================== */
.container {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all var(--transition-base);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== HEADER ==================== */
header {
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color-light);
}

header h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.2;
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.icon-btn:hover::before {
    width: 100%;
    height: 100%;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.icon-btn:active {
    transform: translateY(0);
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    position: relative;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--success-color) 0%, 
        var(--primary-color) 50%, 
        var(--secondary-color) 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== STATS ==================== */
.stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== SEARCH ==================== */
.search-section {
    margin-bottom: 20px;
}

#search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all var(--transition-base);
    outline: none;
    box-shadow: var(--shadow-sm);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

#search-input::placeholder {
    color: var(--text-muted);
}

/* ==================== CONTROLS & FILTERS ==================== */
.controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.filter-btn:hover {
    color: var(--text-color);
    background: var(--bg-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.control-group {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.select-control {
    flex: 1;
    min-width: 160px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.select-control:hover {
    border-color: var(--primary-light);
}

.select-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ==================== INPUT SECTION ==================== */
.input-section {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.task-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

#task-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all var(--transition-base);
    outline: none;
    box-shadow: var(--shadow-xs);
}

#task-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

#add-btn {
    padding: 16px 28px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#add-btn:active {
    transform: translateY(0);
}

.note-section {
    margin-bottom: 16px;
}

#note-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

#note-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.task-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.option-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#priority-select,
#category-select,
#due-date-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

#priority-select:hover,
#category-select:hover,
#due-date-input:hover {
    border-color: var(--primary-light);
}

#priority-select:focus,
#category-select:focus,
#due-date-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ==================== TASK LIST ==================== */
.task-list {
    list-style: none;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
    animation: taskSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: grab;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.task-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.task-item.completed {
    opacity: 0.6;
    background: var(--bg-secondary);
}

.task-item.priority-high {
    border-left: 6px solid var(--danger-color);
}

.task-item.priority-medium {
    border-left: 6px solid var(--warning-color);
}

.task-item.priority-low {
    border-left: 6px solid var(--success-color);
}

.task-item.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: var(--danger-color);
}

body.dark-mode .task-item.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.15) 100%);
}

.task-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
}

@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--success-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.task-content {
    flex: 1;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.task-text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    word-break: break-word;
    line-height: 1.5;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-xs);
}

.badge-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.badge-due {
    background: linear-gradient(135deg, var(--info-color), var(--primary-color));
    color: white;
}

.badge-overdue {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.task-note {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-left: 4px solid var(--primary-color);
    line-height: 1.6;
}

.task-subtasks {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.subtask-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.task-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-xs);
}

.btn-edit {
    background: var(--info-color);
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-subtasks {
    background: var(--warning-color);
    color: white;
}

.btn-subtasks:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== BULK ACTIONS ==================== */
.bulk-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bulk-btn {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-xs);
}

.bulk-btn:hover {
    background: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bulk-btn.danger:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* ==================== FILE ACTIONS ==================== */
.file-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.file-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.file-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-btn.stats-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.file-btn.stats-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    padding: 32px;
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-color);
}

.stats-modal-content {
    max-width: 720px;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--text-color);
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    margin-bottom: 24px;
}

#edit-task-input,
#edit-note-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    margin-bottom: 16px;
    outline: none;
    transition: all var(--transition-base);
    font-family: inherit;
}

#edit-note-input {
    resize: vertical;
    min-height: 80px;
}

#edit-task-input:focus,
#edit-note-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.edit-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.modal-footer {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
    color: var(--text-color);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.modal-btn.primary:hover {
    box-shadow: var(--shadow-lg);
}

/* ==================== STATS MODAL ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-container {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    min-height: 300px;
    border: 2px solid var(--border-color);
}

.chart-container h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ==================== SUBTASKS MODAL ==================== */
.subtask-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#subtask-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-base);
}

#subtask-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.subtask-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

/* ==================== SETTINGS MODAL ==================== */
.setting-item {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
}

.setting-item:hover {
    border-color: var(--primary-light);
}

.setting-item label {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.setting-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 16px 28px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2000;
    transition: bottom var(--transition-slow);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.toast.show {
    bottom: 40px;
}

#undo-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    transition: all var(--transition-base);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#undo-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ==================== EMPTY STATE ==================== */
.task-list:empty::before {
    content: '📭 Nema zadataka. Dodajte novi zadatak!';
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 80px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 24px;
        max-width: 100%;
    }

    header h1 {
        font-size: 2rem;
    }

    .header-top {
        flex-wrap: wrap;
        gap: 16px;
    }

    .stats {
        gap: 12px;
    }

    .stat-item {
        padding: 12px 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
    }

    .control-group {
        flex-direction: column;
    }

    .select-control {
        width: 100%;
    }

    .task-input-group {
        flex-direction: column;
    }

    #add-btn {
        width: 100%;
        justify-content: center;
    }

    .task-options {
        flex-direction: column;
    }

    .option-group {
        width: 100%;
    }

    .bulk-actions {
        flex-direction: column;
    }

    .bulk-btn {
        width: 100%;
        justify-content: center;
    }

    .file-actions {
        flex-direction: column;
    }

    .file-btn {
        width: 100%;
    }

    .task-actions {
        width: 100%;
    }

    .task-btn {
        flex: 1;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .modal-content {
        padding: 20px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    body::before {
        display: none;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        padding: 20px;
    }

    .container::before {
        display: none;
    }

    .header-controls,
    .search-section,
    .controls,
    .input-section,
    .bulk-actions,
    .file-actions,
    .task-actions {
        display: none !important;
    }

    .task-item {
        break-inside: avoid;
        box-shadow: none;
    }
}
