/* ====== VARIÁVEIS DE TEMA ====== */
:root {
    /* Tema Claro */
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-hover: #f1f5f9;
    --bg-modal: rgba(0, 0, 0, 0.5);
    --bg-gradient-start: #ffffff;
    --bg-gradient-end: #f8fafc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-primary: #e2e8f0;
    --border-secondary: rgba(226, 232, 240, 0.8);
    --border-hover: #cbd5e1;
    --border-light: #f1f5f9;
    
    --shadow-primary: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    --shadow-card: rgba(0, 0, 0, 0.06);
    --shadow-modal: rgba(0, 0, 0, 0.1);
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-blue-light: #eff6ff;
    --accent-green: #10b981;
    --accent-green-light: #f0fdf4;
    --accent-red: #ef4444;
    --accent-red-light: #fef2f2;
    --accent-yellow: #f59e0b;
    --accent-yellow-light: #fffbeb;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #f5f3ff;
    --accent-gray: #6b7280;
    --accent-gray-light: #f3f4f6;
    
    /* Priority Colors */
    --priority-urgent-bg: #fef2f2;
    --priority-urgent-text: #dc2626;
    --priority-urgent-border: #fecaca;
    --priority-high-bg: #fffbeb;
    --priority-high-text: #f59e0b;
    --priority-high-border: #fef3c7;
    --priority-normal-bg: #f0fdf4;
    --priority-normal-text: #10b981;
    --priority-normal-border: #bbf7d0;
    --priority-low-bg: #eff6ff;
    --priority-low-text: #3b82f6;
    --priority-low-border: #bfdbfe;
    
    /* Tag Colors */
    --tag-work-bg: #fef2f2;
    --tag-work-text: #dc2626;
    --tag-work-border: #fecaca;
    --tag-personal-bg: #f0f9ff;
    --tag-personal-text: #0284c7;
    --tag-personal-border: #bae6fd;
    --tag-study-bg: #f0fdf4;
    --tag-study-text: #16a34a;
    --tag-study-border: #bbf7d0;
    --tag-health-bg: #fefce8;
    --tag-health-text: #ca8a04;
    --tag-health-border: #fef3c7;
    --tag-urgent-bg: #fdf2f8;
    --tag-urgent-text: #be185d;
    --tag-urgent-border: #fbcfe8;
    --tag-meeting-bg: #f3f4f6;
    --tag-meeting-text: #374151;
    --tag-meeting-border: #d1d5db;
    --tag-project-bg: #f5f3ff;
    --tag-project-text: #7c3aed;
    --tag-project-border: #ddd6fe;
    
    --scrollbar-track: rgba(0, 0, 0, 0.05);
    --scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.3);
}

/* Tema Escuro */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --bg-modal: rgba(0, 0, 0, 0.8);
    --bg-gradient-start: #1e293b;
    --bg-gradient-end: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --border-primary: #475569;
    --border-secondary: rgba(71, 85, 105, 0.8);
    --border-hover: #64748b;
    --border-light: #334155;
    
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --shadow-card: rgba(0, 0, 0, 0.4);
    --shadow-modal: rgba(0, 0, 0, 0.6);
    
    --accent-blue: #60a5fa;
    --accent-blue-hover: #3b82f6;
    --accent-blue-light: rgba(59, 130, 246, 0.1);
    --accent-green: #34d399;
    --accent-green-light: rgba(52, 211, 153, 0.1);
    --accent-red: #f87171;
    --accent-red-light: rgba(248, 113, 113, 0.1);
    --accent-yellow: #fbbf24;
    --accent-yellow-light: rgba(251, 191, 36, 0.1);
    --accent-purple: #a78bfa;
    --accent-purple-light: rgba(167, 139, 250, 0.1);
    --accent-gray: #9ca3af;
    --accent-gray-light: rgba(156, 163, 175, 0.1);
    
    /* Priority Colors - Dark */
    --priority-urgent-bg: rgba(248, 113, 113, 0.15);
    --priority-urgent-text: #fca5a5;
    --priority-urgent-border: rgba(248, 113, 113, 0.3);
    --priority-high-bg: rgba(251, 191, 36, 0.15);
    --priority-high-text: #fbbf24;
    --priority-high-border: rgba(251, 191, 36, 0.3);
    --priority-normal-bg: rgba(52, 211, 153, 0.15);
    --priority-normal-text: #6ee7b7;
    --priority-normal-border: rgba(52, 211, 153, 0.3);
    --priority-low-bg: rgba(96, 165, 250, 0.15);
    --priority-low-text: #93c5fd;
    --priority-low-border: rgba(96, 165, 250, 0.3);
    
    /* Tag Colors - Dark */
    --tag-work-bg: rgba(248, 113, 113, 0.15);
    --tag-work-text: #fca5a5;
    --tag-work-border: rgba(248, 113, 113, 0.3);
    --tag-personal-bg: rgba(56, 189, 248, 0.15);
    --tag-personal-text: #7dd3fc;
    --tag-personal-border: rgba(56, 189, 248, 0.3);
    --tag-study-bg: rgba(52, 211, 153, 0.15);
    --tag-study-text: #86efac;
    --tag-study-border: rgba(52, 211, 153, 0.3);
    --tag-health-bg: rgba(251, 191, 36, 0.15);
    --tag-health-text: #fde047;
    --tag-health-border: rgba(251, 191, 36, 0.3);
    --tag-urgent-bg: rgba(244, 114, 182, 0.15);
    --tag-urgent-text: #f9a8d4;
    --tag-urgent-border: rgba(244, 114, 182, 0.3);
    --tag-meeting-bg: rgba(156, 163, 175, 0.15);
    --tag-meeting-text: #d1d5db;
    --tag-meeting-border: rgba(156, 163, 175, 0.3);
    --tag-project-bg: rgba(167, 139, 250, 0.15);
    --tag-project-text: #c4b5fd;
    --tag-project-border: rgba(167, 139, 250, 0.3);
    
    --scrollbar-track: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.5);
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.task-board { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 1024px) { .task-board { flex-direction: row; align-items: flex-start; } }
.column { 
    background-color: var(--bg-tertiary); 
    border-radius: 1rem; 
    padding: 1.25rem; 
    flex: 1; 
    min-width: 300px; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 4px 12px var(--shadow-primary); 
    border: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
    overflow: visible !important; /* Permitir que elementos filhos ultrapassem os limites */
    margin: 0.25rem; /* Margem adicional para evitar cortes */
}
.column:hover {
    box-shadow: 0 6px 16px var(--shadow-hover);
}
.column-title { 
    font-weight: 600; 
    color: var(--text-primary); 
    padding-bottom: 0.75rem; 
    margin-bottom: 1rem; 
    display: flex; 
    align-items: center;
    border-bottom: 2px solid var(--border-primary);
}
.column-title i { 
    margin-right: 0.75rem; 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 8px;
    font-size: 0.9rem;
}

.task-counter {
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-out;
    min-width: 24px;
    text-align: center;
}

.clear-completed-btn {
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.clear-completed-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.column[data-status="todo"] .column-title i { background-color: rgba(239, 68, 68, 0.15); color: #ef4444; }
.column[data-status="inprogress"] .column-title i { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.column[data-status="done"] .column-title i { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }

.column[data-status="todo"] .column-title {
    border-bottom-color: rgba(239, 68, 68, 0.3);
}
.column[data-status="inprogress"] .column-title {
    border-bottom-color: rgba(245, 158, 11, 0.3);
}
.column[data-status="done"] .column-title {
    border-bottom-color: rgba(16, 185, 129, 0.3);
}
.tasks-container { 
    flex-grow: 1; 
    min-height: 150px;
    max-height: calc(100vh - 300px); /* Altura máxima para colunas */
    overflow-y: auto; /* Adiciona scroll vertical quando necessário */
    scrollbar-width: thin; /* Para Firefox */
    padding: 0.5rem; /* Padding em todos os lados para evitar corte da animação */
    margin: 0.25rem; /* Margem adicional para evitar cortes */
}
/* Estilização da barra de rolagem para Chrome/Safari */
.tasks-container::-webkit-scrollbar {
    width: 6px;
}
.tasks-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}
.tasks-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}
.tasks-container::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}
.task {
    /* Common container styles */
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 3px 10px var(--shadow-card);
    transition: all 0.3s ease-in-out;
    border: 1px solid var(--border-secondary);
    /* Extra styles for swipe functionality */
    position: relative;
    overflow: hidden;
    padding: 0;
}


/* Priority badge styles */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 500;
    margin-right: 0;
    line-height: 1.2;
}

.priority-badge.urgent {
    background-color: var(--priority-urgent-bg);
    color: var(--priority-urgent-text);
}

.priority-badge.high {
    background-color: var(--priority-high-bg);
    color: var(--priority-high-text);
}

.priority-badge.normal {
    background-color: var(--priority-normal-bg);
    color: var(--priority-normal-text);
}

.priority-badge.low {
    background-color: var(--priority-low-bg);
    color: var(--priority-low-text);
}

/* Tag styles */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 500;
    margin-right: 0;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.tag.work {
    background-color: var(--tag-work-bg);
    color: var(--tag-work-text);
    border: 1px solid var(--tag-work-border);
}

.tag.personal {
    background-color: var(--tag-personal-bg);
    color: var(--tag-personal-text);
    border: 1px solid var(--tag-personal-border);
}

.tag.study {
    background-color: var(--tag-study-bg);
    color: var(--tag-study-text);
    border: 1px solid var(--tag-study-border);
}

.tag.health {
    background-color: var(--tag-health-bg);
    color: var(--tag-health-text);
    border: 1px solid var(--tag-health-border);
}

.tag.urgent {
    background-color: var(--tag-urgent-bg);
    color: var(--tag-urgent-text);
    border: 1px solid var(--tag-urgent-border);
}

.tag.meeting {
    background-color: var(--tag-meeting-bg);
    color: var(--tag-meeting-text);
    border: 1px solid var(--tag-meeting-border);
}

.tag.project {
    background-color: var(--tag-project-bg);
    color: var(--tag-project-text);
    border: 1px solid var(--tag-project-border);
}

.tag.default {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag.suggested {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-hover);
    cursor: pointer;
}

.tag.suggested:hover {
    background-color: var(--border-primary);
}

.tag.removable {
    padding-right: 0.25rem;
}

.tag.removable .remove-tag {
    margin-left: 0.25rem;
    padding: 0.125rem;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.1);
    color: currentColor;
    cursor: pointer;
    font-size: 0.625rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.tag.removable .remove-tag:hover {
    background-color: rgba(0,0,0,0.2);
}

/* Filter section */
.filter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: white;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.filter-tag {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background-color: rgba(255,255,255,0.3);
}

.filter-tag.active {
    background-color: white;
    color: #4f46e5;
}

.clear-filters {
    background-color: rgba(239, 68, 68, 0.8);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    background-color: rgba(239, 68, 68, 1);
}

/* Selectize customization */
.selectize-control.multi .selectize-input {
    border: 1px solid var(--border-hover);
    border-radius: 0.5rem;
    padding: 0.75rem;
    min-height: 3rem;
    background: var(--bg-secondary);
    box-shadow: 0 1px 2px 0 var(--shadow-primary);
    transition: all 0.2s ease;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

.selectize-control.multi .selectize-input:focus,
.selectize-control.multi .selectize-input.focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
    outline: none;
}

.selectize-control.multi .selectize-input > div {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0.25rem 0.125rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.selectize-control.multi .selectize-input > div.work {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.selectize-control.multi .selectize-input > div.personal {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
}

.selectize-control.multi .selectize-input > div.study {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.selectize-control.multi .selectize-input > div.health {
    background: linear-gradient(135deg, #ca8a04, #eab308);
}

.selectize-control.multi .selectize-input > div.urgent {
    background: linear-gradient(135deg, #be185d, #ec4899);
}

.selectize-control.multi .selectize-input > div.meeting {
    background: linear-gradient(135deg, #374151, #6b7280);
}

.selectize-control.multi .selectize-input > div.project {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.selectize-control.multi .selectize-input > div .remove {
    margin-left: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.selectize-control.multi .selectize-input > div .remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.selectize-dropdown {
    border: 1px solid var(--border-hover);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    box-shadow: 0 10px 15px -3px var(--shadow-hover), 0 4px 6px -2px var(--shadow-primary);
    margin-top: 0.25rem;
    z-index: 1000;
    position: absolute;
    width: 100%;
}

.selectize-dropdown .option {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selectize-dropdown .option:hover {
    background: var(--bg-hover);
}

.selectize-dropdown .option.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.selectize-dropdown .create {
    padding: 0.75rem;
    background: #f0f9ff;
    border-top: 1px solid #e0e7ff;
    color: #1e40af;
    font-weight: 500;
}

.selectize-dropdown .create:hover {
    background: #dbeafe;
}

/* Correções para o container das tags */
.selectize-control {
    position: relative;
    width: 100%;
}

.selectize-control.multi .selectize-input input {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    flex: 1;
    min-width: 120px;
}

/* Correções para o modal */
#modal-tags-select {
    width: 100%;
}

/* Garantir que o dropdown não seja cortado */
.selectize-dropdown {
    max-height: 200px;
    overflow-y: auto;
}

/* Correções para o input dentro do selectize */
.selectize-input input[type="text"] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Subtasks styles */
.subtasks-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
}

.subtasks-list {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.subtasks-list.expanded {
    max-height: 200px;
    overflow-y: auto;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.subtask-item:last-child {
    border-bottom: none;
}

.subtask-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.subtask-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.subtask-checkbox .checkmark {
    width: 16px;
    height: 16px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.subtask-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #10b981;
    border-color: #10b981;
}

.subtask-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.subtask-text-input {
    flex: 1;
    font-size: 0.75rem;
    color: #374151;
    background: transparent;
    border: none;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 0;
    text-decoration: none;
}

.subtask-text-input:hover {
    background-color: #F9FAFB;
}

.subtask-text-input:focus {
    background-color: #ffffff;
    border: 1px solid #3B82F6;
    outline: none;
    cursor: text;
}

.subtask-text-input.completed {
    text-decoration: line-through;
    color: #9ca3af;
}

.remove-subtask {
    padding: 0.25rem;
    color: #ef4444;
    background: none;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.subtask-item:hover .remove-subtask {
    opacity: 1;
}

.remove-subtask:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.remove-subtask.confirm-delete {
    background-color: #dc2626;
    color: white;
    opacity: 1;
}

.remove-subtask.confirm-delete:hover {
    background-color: #b91c1c;
}

/* Subtasks modal styles */
.subtask-modal-item {
    transition: all 0.2s ease;
}

.subtask-modal-item:hover {
    background-color: #f8fafc;
}

.subtask-text-input {
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.subtask-text-input:focus {
    background: white;
    border-color: #3b82f6;
}

.remove-subtask-modal {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.remove-subtask-modal:hover {
    opacity: 1;
    background-color: #fef2f2;
}

/* Inline subtask addition */
.add-subtask-inline {
    margin-top: 8px;
    border-top: 1px dashed #E5E7EB;
    padding-top: 8px;
}

.add-subtask-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-subtask-input {
    flex: 1;
    font-size: 0.75rem;
    padding: 4px 6px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background-color: #F9FAFB;
    color: #6B7280;
    transition: all 0.2s ease;
}

.add-subtask-input:focus {
    outline: none;
    border-color: #3B82F6;
    background-color: #ffffff;
    color: #374151;
}

.add-subtask-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    color: #6B7280;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-subtask-btn:hover {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* Subtasks icon combo */
.subtasks-icon-combo {
    display: flex;
    align-items: center;
    gap: 1px;
    position: relative;
}

.subtasks-icon-combo i:first-child {
    font-size: 0.7rem;
}

.subtasks-icon-combo i:last-child {
    font-size: 0.6rem;
    margin-left: -2px;
}

/* Progress bar animation */
@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--progress-width); }
}

.progress-fill.animate {
    animation: progressFill 0.5s ease-out;
}

/* Responsive adjustments for subtasks */
@media (max-width: 768px) {
    .subtasks-progress {
        gap: 0.375rem;
    }
    
    .progress-text {
        font-size: 0.6rem;
    }
    
    .subtask-item {
        padding: 0.25rem 0;
        gap: 0.375rem;
    }
    
    .subtask-text {
        font-size: 0.7rem;
    }
    
    .subtask-checkbox .checkmark {
        width: 14px;
        height: 14px;
    }
    
    .remove-subtask {
        font-size: 0.7rem;
        padding: 0.125rem;
    }
}

.task-surface, .recurring-task-item { cursor: grab; }
.task-surface:active, .recurring-task-item:active { cursor: grabbing; }
.task-surface.grabbing { cursor: grabbing; }
.task .action-buttons, .recurring-task-item .action-buttons { 
    display: flex; 
    align-items: center; 
    gap: 0.25rem; 
    opacity: 1; 
    transition: all 0.3s ease; 
    flex-shrink: 0;
}

.task .action-btn, .recurring-task-item .action-btn { 
    color: #64748b; 
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 6px; 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    font-size: 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task .action-btn::before, .recurring-task-item .action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.task .action-btn:hover, .recurring-task-item .action-btn:hover { 
    color: #334155; 
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.task .action-btn:hover::before, .recurring-task-item .action-btn:hover::before {
    opacity: 1;
}

.task .action-btn:active, .recurring-task-item .action-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

/* Botão Delete - Vermelho elegante */
.task .delete-btn, .recurring-task-item .delete-btn {
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.task .delete-btn:hover, .recurring-task-item .delete-btn:hover {
    color: #b91c1c;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
}

.task .delete-btn.confirm-delete, .recurring-task-item .delete-btn.confirm-delete { 
    color: #ffffff; 
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #dc2626;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Botão Edit - Azul moderno */
.task .edit-btn, .recurring-task-item .edit-btn { 
    color: #2563eb; 
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.task .edit-btn:hover, .recurring-task-item .edit-btn:hover { 
    color: #1d4ed8; 
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
}



/* Botão Planning - Roxo (Unifica tempo estimado + datas) */
.task .planning-btn, .recurring-task-item .planning-btn {
    color: #7c3aed;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #d1d5db;
    position: relative;
}

.task .planning-btn:hover, .recurring-task-item .planning-btn:hover {
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #a855f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Estilo para ícones duplos no botão de planejamento */
.planning-btn i:first-child {
    position: relative;
    z-index: 1;
}

.planning-btn i:last-child {
    position: relative;
    z-index: 2;
    opacity: 0.8;
}

/* Estilos removidos - agora integrados na nova animação */
.task.dragging { opacity: 0.5; transform: scale(1.05); }
.drop-zone-indicator {
    background-color: rgba(100, 181, 246, 0.2);
    border: 2px dashed #64b5f6;
    border-radius: 0.5rem;
    margin: -0.5rem 0 0.5rem;
    height: 50px;
    transition: all 0.2s ease-in-out;
    pointer-events: none; /* Importante: isso faz com que o indicador não interfira com eventos de mouse */
    position: relative;
    z-index: 1; /* Abaixo dos itens arrastáveis */
    animation: pulse-light 1.5s infinite;
}
#loading-spinner { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 100; 
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.report-table th, .report-table td { padding: 0.75rem; text-align: left; }
.report-table tbody tr:nth-child(even) { background-color: #f9fafb; }
.tab-btn { border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-btn.active { border-color: #3b82f6; color: #3b82f6; }

/* Novo estilo para abas de navegação */
.tabs-container {
    margin-bottom: 2rem;
    background-color: white;
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn {
    position: relative;
    padding: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #64748b;
    border-radius: 0.5rem;
    border: none;
    transition: all 0.3s ease;
    background: transparent;
}

.tab-btn:hover {
    color: #334155;
    background-color: #f1f5f9;
}

.tab-btn.active {
    color: #3b82f6;
    background-color: #eff6ff;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 0.25rem;
    background-color: #3b82f6;
    border-radius: 0.125rem;
}

.tab-btn i {
    margin-right: 0.5rem;
    opacity: 0.7;
}

.tab-btn.active i {
    opacity: 1;
}

/* --- Estilos para Swipe em Mobile --- */
.task-surface {
    position: relative;
    z-index: 2;
    width: 100%;
    background-color: var(--bg-secondary);
    padding: 0.75rem;
    transition: all 0.3s ease;
    border-radius: 1rem;
    -webkit-user-drag: element;
    user-select: none;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.25rem;
}

.task-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
    min-width: 0;
    min-height: 0;
    gap: 0.25rem;
}

/* Quando não há conteúdo visível, esconder */
.task-icon-wrapper:empty {
    display: none;
}

.task-left-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.task-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.task-text {
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

/* Otimização para quebra de linha inteligente */
.task-meta .priority-badge {
    order: 1;
}

.task-meta .task-frequency {
    order: 2;
}

.task-meta .tag {
    order: 3;
}

.task-meta .task-created-date {
    order: 4;
    margin-left: auto;
    flex-shrink: 0;
}

/* Garantir que elementos não quebrem desnecessariamente */
.task-meta > * {
    white-space: nowrap;
}

/* Otimização geral de altura */
.task {
    margin-bottom: 0.75rem;
}

.task:last-child {
    margin-bottom: 0;
}

.real-time-timer {
    font-size: 0.65rem;
    color: #6b7280;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-weight: 500;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    padding: 0.1rem 0.3rem;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
    line-height: 1.2;
}
.task.is-recurring .task-surface {
    border-left: 4px solid;
}

/* Diária - Roxo/Indigo */
.task.is-recurring[data-frequency="daily"] .task-surface {
    background-color: #e0e7ff; /* indigo-100 */
    border-left-color: #6366f1; /* indigo-500 */
}
.task.is-recurring[data-frequency="daily"] .task-frequency {
    background-color: #818cf8; /* indigo-400 */
}

/* Semanal - Azul */
.task.is-recurring[data-frequency="weekly"] .task-surface {
    background-color: #dbeafe; /* blue-100 */
    border-left-color: #3b82f6; /* blue-500 */
}
.task.is-recurring[data-frequency="weekly"] .task-frequency {
    background-color: #60a5fa; /* blue-400 */
}

/* Mensal - Laranja (cor distinta, não confunde com outras) */
.task.is-recurring[data-frequency="monthly"] .task-surface {
    background-color: #fff7ed; /* orange-50 */
    border-left-color: #ea580c; /* orange-600 */
}
.task.is-recurring[data-frequency="monthly"] .task-frequency {
    background-color: #fb923c; /* orange-400 */
}

/* Melhorias para tarefas comuns */
.task .task-surface {
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.task:hover .task-surface {
   /* transform: translateY(-3px); */
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    background-color: #fefefe;
}

/* Estilo para tarefa por coluna */
.column[data-status="todo"] .task:not(.is-recurring) .task-surface {
    border-left-color: #ef4444; /* red-500 */
}

.column[data-status="inprogress"] .task:not(.is-recurring) .task-surface {
    border-left-color: #f59e0b; /* amber-500 */
}

.column[data-status="done"] .task:not(.is-recurring) .task-surface {
    border-left-color: #10b981; /* emerald-500 */
}

.swipe-indicators {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 500;
}
.swipe-indicator {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    opacity: 0; /* Escondido por padrão */
    transition: opacity 0.2s;
}
.swipe-indicator.left {
    justify-content: flex-start;
    padding-left: 1.5rem;
}
 .swipe-indicator.right {
    justify-content: flex-end;
    padding-right: 1.5rem;
}
.task.swiping-right .swipe-indicator.right,
.task.swiping-left .swipe-indicator.left {
    opacity: 1;
}

/* Indicadores de reordenamento vertical */
.reorder-indicators {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 500;
    pointer-events: none;
}
.reorder-indicator {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    background-color: rgba(79, 70, 229, 0.2); /* indigo com transparência */
}
.reorder-indicator.up {
    align-items: flex-start;
    padding-top: 0.5rem;
}
.reorder-indicator.down {
    align-items: flex-end;
    padding-bottom: 0.5rem;
}
.task.swiping-up .reorder-indicator.up,
.task.swiping-down .reorder-indicator.down {
    opacity: 1;
}
.reorder-arrow {
    background-color: rgba(79, 70, 229, 0.9);
    border-radius: 9999px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Classe para bloquear o scroll durante swipes */
body.swiping-in-progress {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Animações e transições */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animação elegante para tarefa em foco - sem alterar tamanho */
@keyframes focusInnerGlow {
    0% { 
        box-shadow: 
            0 4px 20px rgba(16, 185, 129, 0.2),
            inset 0 0 0 1px rgba(16, 185, 129, 0.1),
            inset 0 0 20px rgba(16, 185, 129, 0.05);
    }
    50% { 
        box-shadow: 
            0 6px 25px rgba(16, 185, 129, 0.3),
            inset 0 0 0 2px rgba(16, 185, 129, 0.3),
            inset 0 0 30px rgba(16, 185, 129, 0.15);
    }
    100% { 
        box-shadow: 
            0 4px 20px rgba(16, 185, 129, 0.2),
            inset 0 0 0 1px rgba(16, 185, 129, 0.1),
            inset 0 0 20px rgba(16, 185, 129, 0.05);
    }
}

@keyframes focusColorShift {
    0%, 100% { 
        background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
        border-left-color: #10b981;
    }
    33% { 
        background: linear-gradient(135deg, #f0fdf4 0%, #bbf7d0 100%);
        border-left-color: #059669;
    }
    66% { 
        background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
        border-left-color: #047857;
    }
}



@keyframes highlight {
    0% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.task {
    animation: fadeIn 0.3s ease-out;
    overflow: visible !important;
}

.task.highlight-move .task-surface {
    animation: highlight 1.5s ease-out;
}

.task.is-focused {
    overflow: visible !important;
    position: relative;
    z-index: 10;
}

/* Aura sutil ao redor da tarefa focada */
.task.is-focused::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 1.2rem;
    z-index: -1;
    pointer-events: none;
}

/* Superfície da tarefa focada com bordas internas elegantes */
.task.is-focused .task-surface {
    animation: 
        focusInnerGlow 2s ease-in-out infinite,
        focusColorShift 4s ease-in-out infinite;
    z-index: 5;
    will-change: box-shadow, background, border-color;
    position: relative;
    overflow: hidden;
}

/* Efeito de borda interna pulsante sutil */
.task.is-focused .task-surface::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 1rem;
    background: linear-gradient(45deg, 
        rgba(16, 185, 129, 0.1), 
        rgba(16, 185, 129, 0.05), 
        rgba(16, 185, 129, 0.1)
    ) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    animation: innerBorderPulse 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Garantir que o conteúdo da tarefa focada fique acima dos efeitos */
.task.is-focused .task-header,
.task.is-focused .task-content {
    position: relative;
    z-index: 2;
}

@keyframes innerBorderPulse {
    0%, 100% {
        opacity: 0.4;
        background: linear-gradient(45deg, 
            rgba(16, 185, 129, 0.1), 
            rgba(16, 185, 129, 0.05), 
            rgba(16, 185, 129, 0.1)
        ) border-box;
    }
    50% {
        opacity: 0.8;
        background: linear-gradient(45deg, 
            rgba(16, 185, 129, 0.2), 
            rgba(16, 185, 129, 0.1), 
            rgba(16, 185, 129, 0.2)
        ) border-box;
    }
}


/* ====== RESPONSIVE HEADER STYLES ====== */

/* Header mobile optimizations */
header {
    transition: all 0.3s ease;
}

header h1 {
    line-height: 1.2;
    word-break: break-word;
}

header .flex-wrap > * {
    min-width: fit-content;
}

/* Button text hidden on small screens, shown on larger */
@media (min-width: 640px) {
    header .hidden.sm\\:inline {
        display: inline !important;
    }
}

/* Extra small screens - stack everything */
@media (max-width: 480px) {
    header {
        padding: 1rem !important;
    }
    
    header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem;
    }
    
    header p {
        font-size: 0.875rem !important;
    }
    
    header .flex-wrap {
        gap: 0.5rem !important;
    }
    
    header button {
        min-width: 2.5rem;
        min-height: 2.5rem;
        justify-content: center;
    }
    
    header .bg-gray-50,
    header .bg-blue-50,
    header .bg-red-50 {
        padding: 0.5rem !important;
    }
    
    /* Ensure text doesn't overflow on mobile */
    header #username-display {
        max-width: 6rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Medium screens adjustments */
@media (max-width: 768px) and (min-width: 481px) {
    header .md\\:justify-end {
        justify-content: center !important;
    }
    
    header #username-display {
        max-width: 8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Melhorias para dispositivos móveis */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .column {
        margin-bottom: 1rem;
        min-width: 100%;
    }
    
    .task-surface {
        padding: 0.75rem 1rem;
    }
    
    .task-board {
        gap: 1rem;
    }
    
    /* Ajuste para mobile: altura menor para as colunas */
    .tasks-container {
        max-height: calc(100vh - 350px);
    }
    
    /* Otimizações de espaçamento para mobile */
    .task-header {
        gap: 0.15rem;
    }
    
    .task-left-content {
        gap: 0.375rem;
    }
    
    .task-icon-wrapper {
        gap: 0.2rem;
    }
    
    .task .action-buttons, .recurring-task-item .action-buttons {
        gap: 0.15rem;
    }
    
    .task .action-btn, .recurring-task-item .action-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    .real-time-timer {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
    
    /* Compactar ainda mais no mobile */
    .task-surface {
        padding: 0.6rem;
        gap: 0.4rem;
    }
    
    .task-content {
        gap: 0.2rem;
    }
    
    .task-meta {
        gap: 0.3rem;
    }
    
    .priority-badge, .tag {
        font-size: 0.6rem;
        padding: 0.05rem 0.3rem;
    }
    
    .task-frequency {
        font-size: 0.55rem;
        padding: 0.05rem 0.3rem;
    }
    
    .task-created-date {
        font-size: 0.55rem;
    }
}

.task-frequency {
    display: inline-flex;
    align-items: center;
    background-color: #818cf8;
    color: white;
    border-radius: 8px;
    padding: 0.1rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.task-frequency::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.task-created-date {
    display: flex;
    align-items: center;
    color: #6b7280;
    font-size: 0.6rem;
    opacity: 0.8;
    line-height: 1.2;
}

/* Estilização adicional para tarefas */

/* Estilos para edição de tarefa */
.edit-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.edit-input {
    font-weight: 500;
    line-height: 1.4;
    color: #334155;
    letter-spacing: -0.01em;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    outline: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-family: inherit;
    background-color: #f8fafc;
    width: 100%;
    box-sizing: border-box;
}

.edit-input:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.edit-textarea {
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
}

.edit-input-single {
    height: 40px;
}

.edit-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.edit-save-btn,
.edit-cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.edit-save-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.edit-save-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.edit-cancel-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.edit-cancel-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.edit-save-btn:active,
.edit-cancel-btn:active {
    transform: translateY(0);
}

/* Tooltip para textarea */
.edit-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Melhor espaçamento quando em edição */
.task-text-wrapper:has(.edit-container) {
    margin: -0.25rem;
}

/* Melhorias para a aba de tarefas recorrentes */
.recurring-task-item {
    background-color: white;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-out;
    border-left: 4px solid #6366f1; /* indigo-500 por padrão */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin: 0.5rem 0;
    position: relative;
}

.recurring-task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Cores por frequência para tarefas recorrentes */
.recurring-task-item[data-frequency="daily"] {
    border-left-color: #6366f1; /* indigo-500 */
    background-color: rgba(224, 231, 255, 0.3); /* indigo-100 com transparência */
}

.recurring-task-item[data-frequency="weekly"] {
    border-left-color: #3b82f6; /* blue-500 */
    background-color: rgba(219, 234, 254, 0.3); /* blue-100 com transparência */
}

.recurring-task-item[data-frequency="monthly"] {
    border-left-color: #ea580c; /* orange-600 */
    background-color: rgba(255, 247, 237, 0.3); /* orange-50 com transparência */
}

.recurring-frequency-badge {
    display: inline-block;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.recurring-frequency-badge.daily {
    background-color: #818cf8; /* indigo-400 */
}

.recurring-frequency-badge.weekly {
    background-color: #60a5fa; /* blue-400 */
}

.recurring-frequency-badge.monthly {
    background-color: #fb923c; /* orange-400 */
}

/* Melhorias para o formulário de tarefas recorrentes */
#add-recurring-task-form {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}


#add-recurring-task-form input:focus, 
#add-recurring-task-form select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#add-recurring-task-form button[type="submit"] {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

#add-recurring-task-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(59, 130, 246, 0.3);
}

/* Melhorias para o título da seção */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, #6366f1, #3b82f6);
    border-radius: 3px;
}

/* Melhorias para a tabela de relatórios */
.report-table {
    border-collapse: separate;
    border-spacing: 0;
}

.report-table th {
    background-color: #f8fafc;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #64748b;
}

.report-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.report-table tbody tr {
    transition: all 0.2s ease;
}

.report-table tbody tr:hover {
    background-color: #f1f5f9;
}

.report-duration {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Estilos para reordenamento de tarefas recorrentes */
.recurring-task-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.recurring-task-item .drag-handle {
    cursor: grab;
    color: #cbd5e0;
    transition: color 0.2s;
    padding: 0.5rem;
}

.recurring-task-item .drag-handle:hover {
    color: #4b5563;
}

.recurring-task-item .drag-handle:active {
    cursor: grabbing;
}

.recurring-drop-zone-indicator {
    background-color: rgba(100, 181, 246, 0.2);
    border: 2px dashed #64b5f6;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    height: 50px;
    transition: all 0.2s ease-in-out;
    animation: pulse-light 1.5s infinite;
    pointer-events: none; /* Importante: isso faz com que o indicador não interfira com eventos de mouse */
    position: relative;
    z-index: 1; /* Abaixo dos itens arrastáveis */
}

@keyframes pulse-light {
    0% { background-color: rgba(100, 181, 246, 0.1); }
    50% { background-color: rgba(100, 181, 246, 0.3); }
    100% { background-color: rgba(100, 181, 246, 0.1); }
}

#recurring-tasks-list {
    padding: 1rem;
    min-height: 100px;
    position: relative; /* Importante para posicionamento correto do indicador */
}

#recurring-tasks-list:empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-style: italic;
}

#recurring-tasks-list:empty:before {
    content: "Arraste tarefas recorrentes aqui";
}

.recurring-task-item.highlight-move {
    animation: highlight 1.5s ease-out;
}

/* Time Estimation Styles */
.time-estimation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    margin: 2px 4px 2px 0;
    transition: all 0.2s ease;
}

.time-estimation.time-on-track {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.time-estimation.time-over-estimate {
    background: #fef2f2;
    border-color: #fecaca;
    animation: pulse-warning 2s infinite;
}

.time-estimation.time-under-estimate {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

.time-separator {
    color: #94a3b8;
    font-weight: 300;
}

.estimated-time {
    font-weight: 600;
    color: #475569;
}

.spent-time {
    font-weight: 500;
}

.over-estimate-warning {
    margin-left: 4px;
    font-size: 0.8rem;
    animation: bounce 1s infinite;
}

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

.time-estimation:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Time Spent Display Styles */
.time-spent-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #bae6fd;
    margin: 2px 4px 2px 0;
    transition: all 0.2s ease;
    color: #0369a1;
}

.time-spent-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(3, 105, 161, 0.2);
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.time-spent-text {
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 0.5px;
}

/* Animação para tempo em tempo real */
.time-spent-display.real-time {
    animation: pulse-time 2s infinite;
}

.modal-time-spent.real-time {
    animation: pulse-time 2s infinite;
    font-weight: 700;
}

@keyframes pulse-time {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.pomodoro-timer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin: 2px 4px 2px 0;
    animation: pulse-pomodoro 2s infinite;
}

.pomodoro-timer-status.pomodoro-work {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #dc2626;
}

.pomodoro-timer-status.pomodoro-break {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.pomodoro-timer-status.pomodoro-long-break {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 1px solid #d8b4fe;
    color: #7c3aed;
}

.pomodoro-timer-status.paused {
    opacity: 0.7;
    animation: pulse-paused 2s infinite;
}

@keyframes pulse-paused {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
}

@keyframes pulse-pomodoro {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

.pomodoro-icon {
    font-size: 1rem;
    line-height: 1;
}

.pomodoro-timer-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Pomodoro Modal Styles */
.pomodoro-option-btn {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pomodoro-option-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pomodoro-option-btn.work-btn:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.pomodoro-option-btn.break-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.pomodoro-option-btn.long-break-btn:hover {
    border-color: #7c3aed;
    background: #f3e8ff;
}

.pomodoro-timer-large {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #f3f4f6;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #374151;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.timer-progress {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Botão Pomodoro */
.task .pomodoro-btn, .recurring-task-item .pomodoro-btn {
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.task .pomodoro-btn:hover, .recurring-task-item .pomodoro-btn:hover {
    color: #b91c1c;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
}

/* Date and Deadline Styles */
.date-info {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 500;
    margin-right: 0.3rem;
    margin-bottom: 0.1rem;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.date-info.start-date {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.date-info.start-date.is-today {
    background-color: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.date-info.due-date {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.date-info.due-date.due-today {
    background-color: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    animation: pulse-warning 2s infinite;
}

.date-info.due-date.due-tomorrow {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.date-info.due-date.overdue {
    background-color: #7f1d1d;
    color: #fef2f2;
    border: 1px solid #991b1b;
    font-weight: 700;
    animation: pulse-urgent 1.5s infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

.date-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}



/* Task border color based on deadline status */
.task[data-due-status="overdue"] .task-surface {
    border-left: 4px solid #dc2626;
}

.task[data-due-status="due-today"] .task-surface {
    border-left: 4px solid #f59e0b;
}

.task[data-due-status="due-tomorrow"] .task-surface {
    border-left: 4px solid #3b82f6;
}

/* Modal styles for date editing */
.edit-dates-modal {
    max-width: 500px;
}

.edit-dates-modal .grid {
    gap: 1rem;
}

.edit-dates-modal input[type="date"],
.edit-dates-modal input[type="time"] {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.edit-dates-modal input[type="date"]:focus,
.edit-dates-modal input[type="time"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-dates-modal input[type="date"]:invalid,
.edit-dates-modal input[type="time"]:invalid {
    border-color: #ef4444;
}

/* Responsive adjustments for dates */
@media (max-width: 768px) {
    .date-info {
        font-size: 0.6rem;
        padding: 0.05rem 0.3rem;
        margin-right: 0.2rem;
    }
    
    .edit-dates-modal .grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Mobile Optimizations */
@media (max-width: 768px) {
    /* Modal backdrop adjustments */
    .fixed.inset-0.bg-black.bg-opacity-50.flex.items-center.justify-center {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    /* Modal content adjustments */
    .fixed.inset-0 .bg-white.rounded-lg {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 2rem);
        margin: auto;
        overflow-y: auto;
        border-radius: 1rem;
        width: 100%;
    }
    
    /* Specific modal content classes */
    .edit-planning-modal,
    .pomodoro-start-modal,
    .pomodoro-control-modal,
    .pomodoro-settings-modal,
    .pomodoro-complete-modal {
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
    
    /* Form elements in modals */
    .edit-planning-modal .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pomodoro-settings-modal .space-y-4 {
        gap: 1rem;
    }
    
    .edit-planning-modal input,
    .pomodoro-settings-modal input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.875rem;
        min-height: 48px;
    }
    
    /* Button adjustments */
    .edit-planning-modal .flex.gap-3,
    .pomodoro-start-modal .flex.gap-3,
    .pomodoro-control-modal .flex.gap-2,
    .pomodoro-settings-modal .flex.gap-3,
    .pomodoro-complete-modal .flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .edit-planning-modal button,
    .pomodoro-start-modal button,
    .pomodoro-control-modal button,
    .pomodoro-settings-modal button,
    .pomodoro-complete-modal button {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 0.5rem;
    }
    
    /* Pomodoro timer display */
    .pomodoro-timer-large {
        padding: 1.5rem;
        margin: 0.5rem 0;
    }
    
    .timer-display {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    /* Pomodoro option buttons */
    .pomodoro-option-btn {
        padding: 1rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .pomodoro-option-btn .text-2xl {
        font-size: 1.5rem;
    }
    
    /* Tags modal specific */
    .bg-white.rounded-lg.p-6.max-w-md {
        max-width: calc(100vw - 1rem);
        padding: 1.5rem;
    }
    
    /* Priority modal specific */
    .bg-white.rounded-lg.p-6.max-w-sm {
        max-width: calc(100vw - 1rem);
        padding: 1.5rem;
    }
    
    .priority-option {
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Selectize adjustments for mobile */
    .selectize-control.multi .selectize-input {
        min-height: 48px;
        font-size: 16px;
        padding: 0.5rem;
    }
    
    .selectize-dropdown {
        font-size: 16px;
    }
    
    .selectize-dropdown .option {
        padding: 0.75rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Modal title adjustments */
    .fixed.inset-0 .bg-white h3,
    .fixed.inset-0 .bg-white .text-lg {
        font-size: 1.25rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    /* Ensure text is readable */
    .fixed.inset-0 .bg-white p,
    .fixed.inset-0 .bg-white label,
    .fixed.inset-0 .bg-white .text-sm {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Scroll behavior for long modals */
    .fixed.inset-0 .bg-white {
        position: relative;
        margin-top: auto;
        margin-bottom: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* Prevent modal content from being too small */
    .fixed.inset-0 .bg-white > div {
        flex: 1;
    }
    
    /* Improve spacing in modal content */
    .edit-planning-modal > div,
    .pomodoro-start-modal > div,
    .pomodoro-control-modal > div,
    .pomodoro-settings-modal > div,
    .pomodoro-complete-modal > div {
        margin-bottom: 1rem;
    }
    
    /* Fix modal close button area */
    .fixed.inset-0 {
        touch-action: manipulation;
    }
}

/* Time Estimation Comparison Styles */
.time-estimate-comparison {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 4px 4px 4px 0;
    min-width: 140px;
    transition: all 0.2s ease;
}

.time-estimate-comparison:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.time-estimate-comparison.on-track {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.time-estimate-comparison.caution {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    animation: pulse-caution 3s infinite;
}

.time-estimate-comparison.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
    border-color: #facc15;
    animation: pulse-warning 2s infinite;
}

.time-estimate-comparison.exceeded {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-color: #f87171;
    animation: pulse-exceeded 1.5s infinite;
}

@keyframes pulse-caution {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
    }
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.2);
    }
}

@keyframes pulse-exceeded {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3);
    }
}

.estimate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.estimate-status {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
}

.estimate-percentage {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    text-align: right;
    line-height: 1.2;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-estimate-comparison.on-track .estimate-percentage {
    color: #059669;
}

.time-estimate-comparison.caution .estimate-percentage {
    color: #d97706;
}

.time-estimate-comparison.warning .estimate-percentage {
    color: #ca8a04;
}

.time-estimate-comparison.exceeded .estimate-percentage {
    color: #dc2626;
    animation: flash-text 1s infinite;
}

@keyframes flash-text {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

.estimate-details {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    justify-content: center;
}

.spent-time {
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.estimate-separator {
    color: #9ca3af;
    font-weight: 300;
}

.estimated-time {
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.estimate-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(156, 163, 175, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.estimate-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.time-estimate-comparison.on-track .estimate-progress-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.time-estimate-comparison.caution .estimate-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.time-estimate-comparison.warning .estimate-progress-fill {
    background: linear-gradient(90deg, #eab308, #ca8a04);
}

.time-estimate-comparison.exceeded .estimate-progress-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    animation: progress-glow 1.5s infinite;
}

@keyframes progress-glow {
    0%, 100% {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .time-estimate-comparison {
        min-width: 120px;
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .estimate-status {
        font-size: 0.65rem;
    }
    
    .estimate-percentage {
        font-size: 0.6rem;
        white-space: nowrap;
    }
}

/* Alert notification styles para alertas de estimativa */
.estimate-alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2);
    z-index: 1000;
    max-width: 320px;
    animation: slideInRight 0.3s ease-out;
}

.estimate-alert-notification.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
    border-color: #facc15;
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.2);
}

.estimate-alert-notification.caution {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.2);
}

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

.estimate-alert-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.estimate-alert-text {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.estimate-alert-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.estimate-alert-close:hover {
    color: #374151;
}

/* Time Estimation Styles */

/* Estimate Accuracy Modal Styles */
.estimate-accuracy-modal {
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.stat-percentage {
    font-size: 0.75rem;
    font-weight: 500;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-description {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.recent-tasks-section {
    margin-top: 24px;
}

.recent-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.recent-task-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.recent-task-item.over {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-color: #f87171;
}

.recent-task-item.under {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 4px;
}

.task-metrics {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
}

.task-metrics span {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.estimated {
    background: #f3f4f6;
    color: #6b7280;
}

.actual {
    background: #e0f2fe;
    color: #0369a1;
}

.accuracy.accurate {
    background: #dcfce7;
    color: #166534;
}

.accuracy.over {
    background: #fecaca;
    color: #dc2626;
}

.accuracy.under {
    background: #dbeafe;
    color: #2563eb;
}

.task-status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tips-section {
    margin-top: 20px;
}

.tips-section ul {
    margin: 0;
    padding-left: 0;
}

.tips-section li {
    list-style: none;
    margin-bottom: 8px;
}

/* Responsive adjustments para o modal */
@media (max-width: 768px) {
    .estimate-accuracy-modal {
        max-width: 100%;
        padding: 0 8px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .task-metrics {
        flex-direction: column;
        gap: 4px;
    }
    
    .recent-task-item {
        padding: 10px 12px;
    }
}

/* Grid system para o modal */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

/* Responsividade do grid */
@media (max-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Utility classes para cores de fundo */
.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-yellow-50 { background-color: #fefce8; }

.border-green-200 { border-color: #bbf7d0; }
.border-red-200 { border-color: #fecaca; }
.border-blue-200 { border-color: #bfdbfe; }

.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }
.text-yellow-600 { color: #ca8a04; }
.text-green-500 { color: #10b981; }
.text-red-500 { color: #ef4444; }
.text-blue-500 { color: #3b82f6; }
.text-orange-600 { color: #ea580c; }
.text-yellow-800 { color: #92400e; }
.text-yellow-700 { color: #a16207; }

/* Animation para loading dos dados */
.metric-loading {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ====== BOTÃO DE TOGGLE DE TEMA ====== */
.theme-toggle-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

.theme-toggle-btn i {
    transition: all 0.3s ease;
}

.theme-toggle-btn .dark-icon {
    display: inline-block;
}

.theme-toggle-btn .light-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .dark-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .light-icon {
    display: inline-block;
}

/* ====== ADAPTAÇÕES PARA TEMA ESCURO ====== */
[data-theme="dark"] .priority-badge.urgent {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .priority-badge.high {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .priority-badge.normal {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .priority-badge.low {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

[data-theme="dark"] .tag {
    border-color: var(--border-primary);
}

[data-theme="dark"] .tag.work {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .tag.personal {
    background-color: rgba(2, 132, 199, 0.15);
    color: #7dd3fc;
    border-color: rgba(2, 132, 199, 0.3);
}

[data-theme="dark"] .tag.study {
    background-color: rgba(22, 163, 74, 0.15);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.3);
}

[data-theme="dark"] .tag.health {
    background-color: rgba(202, 138, 4, 0.15);
    color: #fde047;
    border-color: rgba(202, 138, 4, 0.3);
}

[data-theme="dark"] .tag.urgent {
    background-color: rgba(190, 24, 93, 0.15);
    color: #f9a8d4;
    border-color: rgba(190, 24, 93, 0.3);
}

[data-theme="dark"] .tag.meeting {
    background-color: rgba(55, 65, 81, 0.15);
    color: #d1d5db;
    border-color: rgba(55, 65, 81, 0.3);
}

[data-theme="dark"] .tag.project {
    background-color: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
    border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .calendar-day.activity-0 { 
    background-color: var(--bg-tertiary); 
    color: var(--text-muted); 
}

[data-theme="dark"] .calendar-day.activity-1 { 
    background-color: rgba(251, 191, 36, 0.2); 
    color: #fbbf24; 
}

[data-theme="dark"] .calendar-day.activity-2 { 
    background-color: rgba(52, 211, 153, 0.2); 
    color: #34d399; 
}

[data-theme="dark"] .calendar-day.activity-3 { 
    background-color: var(--accent-blue); 
    color: var(--text-inverse); 
}

/* ====== ADAPTAÇÕES COMPLETAS PARA TEMA ESCURO ====== */

/* Modais e elementos overlay */
[data-theme="dark"] .fixed.inset-0 .bg-white,
[data-theme="dark"] .bg-white {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .fixed.inset-0 .bg-white h3,
[data-theme="dark"] .fixed.inset-0 .bg-white .text-lg,
[data-theme="dark"] .bg-white h3,
[data-theme="dark"] .bg-white .text-lg {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .fixed.inset-0 .bg-white p,
[data-theme="dark"] .fixed.inset-0 .bg-white label,
[data-theme="dark"] .fixed.inset-0 .bg-white .text-sm,
[data-theme="dark"] .bg-white p,
[data-theme="dark"] .bg-white label,
[data-theme="dark"] .bg-white .text-sm {
    color: var(--text-secondary) !important;
}

/* Gradientes */
[data-theme="dark"] .bg-gradient-to-br {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* Tabelas */
[data-theme="dark"] .report-table tbody tr:nth-child(even) {
    background-color: var(--bg-hover);
}

[data-theme="dark"] .report-table th,
[data-theme="dark"] .report-table td {
    color: var(--text-primary);
}

[data-theme="dark"] .report-table tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Abas */
[data-theme="dark"] .tab-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .tab-btn.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

[data-theme="dark"] .tabs-container {
    background-color: var(--bg-secondary);
}

/* Filtros */
[data-theme="dark"] .filter-section {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-tag {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

[data-theme="dark"] .filter-tag:hover {
    background-color: var(--accent-blue);
    color: var(--text-inverse);
}

[data-theme="dark"] .filter-tag.active {
    background-color: var(--accent-blue);
    color: var(--text-inverse);
}

/* Inputs e formulários */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"], 
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

/* Botões */
[data-theme="dark"] .bg-blue-500 {
    background-color: var(--accent-blue) !important;
}

[data-theme="dark"] .bg-blue-600 {
    background-color: var(--accent-blue-hover) !important;
}

[data-theme="dark"] .bg-green-500 {
    background-color: var(--accent-green) !important;
}

[data-theme="dark"] .bg-red-500 {
    background-color: var(--accent-red) !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-hover) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

/* Text colors */
[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-700 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
    color: var(--text-muted) !important;
}

/* Bordas */
[data-theme="dark"] .border-gray-300 {
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-secondary) !important;
}

/* Dark theme - Tarefas Recorrentes */
[data-theme="dark"] .task.is-recurring .task-surface {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

/* Dark theme - Diária - Roxo/Indigo */
[data-theme="dark"] .task.is-recurring[data-frequency="daily"] .task-surface {
    background-color: rgba(99, 102, 241, 0.1); /* indigo com transparência para dark */
    border-left-color: #818cf8; /* indigo-400 */
}
[data-theme="dark"] .task.is-recurring[data-frequency="daily"] .task-frequency {
    background-color: #6366f1; /* indigo-500 */
}

/* Dark theme - Semanal - Azul */
[data-theme="dark"] .task.is-recurring[data-frequency="weekly"] .task-surface {
    background-color: rgba(59, 130, 246, 0.1); /* blue com transparência para dark */
    border-left-color: #60a5fa; /* blue-400 */
}
[data-theme="dark"] .task.is-recurring[data-frequency="weekly"] .task-frequency {
    background-color: #3b82f6; /* blue-500 */
}

/* Dark theme - Mensal - Laranja */
[data-theme="dark"] .task.is-recurring[data-frequency="monthly"] .task-surface {
    background-color: rgba(234, 88, 12, 0.1); /* orange com transparência para dark */
    border-left-color: #fb923c; /* orange-400 */
}
[data-theme="dark"] .task.is-recurring[data-frequency="monthly"] .task-frequency {
    background-color: #ea580c; /* orange-600 */
}

/* Dark theme - Recurring task items */
[data-theme="dark"] .recurring-task-item {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .recurring-task-item[data-frequency="daily"] {
    border-left-color: #818cf8; /* indigo-400 */
    background-color: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .recurring-task-item[data-frequency="weekly"] {
    border-left-color: #60a5fa; /* blue-400 */
    background-color: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .recurring-task-item[data-frequency="monthly"] {
    border-left-color: #fb923c; /* orange-400 */
    background-color: rgba(234, 88, 12, 0.1);
}

/* Dark theme - Frequency badges */
[data-theme="dark"] .recurring-frequency-badge.daily {
    background-color: #6366f1; /* indigo-500 */
}

[data-theme="dark"] .recurring-frequency-badge.weekly {
    background-color: #3b82f6; /* blue-500 */
}

[data-theme="dark"] .recurring-frequency-badge.monthly {
    background-color: #ea580c; /* orange-600 */
}

/* Elementos específicos do app */
[data-theme="dark"] .column[data-status="todo"] .column-title i {
    background-color: var(--accent-red-light);
    color: var(--accent-red);
}

[data-theme="dark"] .column[data-status="inprogress"] .column-title i {
    background-color: var(--accent-yellow-light);
    color: var(--accent-yellow);
}

[data-theme="dark"] .column[data-status="done"] .column-title i {
    background-color: var(--accent-green-light);
    color: var(--accent-green);
}

/* Estimate accuracy modal - tema escuro */
[data-theme="dark"] .estimate-accuracy-modal {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .stat-card {
    background-color: var(--bg-tertiary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .metric-card {
    background-color: var(--bg-tertiary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .recent-task-item {
    background-color: var(--bg-hover);
    border-color: var(--border-primary);
}

/* Tips section */
[data-theme="dark"] .tips-section {
    background-color: var(--accent-yellow-light);
    color: var(--accent-yellow);
}

/* Analytics cards e dashboard */
[data-theme="dark"] .analytics-card,
[data-theme="dark"] .productivity-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

/* Utility backgrounds para tema escuro */
[data-theme="dark"] .bg-green-50 { background-color: var(--accent-green-light) !important; }
[data-theme="dark"] .bg-red-50 { background-color: var(--accent-red-light) !important; }
[data-theme="dark"] .bg-blue-50 { background-color: var(--accent-blue-light) !important; }
[data-theme="dark"] .bg-yellow-50 { background-color: var(--accent-yellow-light) !important; }

/* ====== BODY E ELEMENTOS PRINCIPAIS ====== */
[data-theme="dark"] body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Classes Tailwind específicas - cores de texto */
[data-theme="dark"] .text-gray-400 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-300 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-200 { color: var(--text-primary) !important; }

/* Headers e títulos */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, 
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

/* Paragrafos e labels */
[data-theme="dark"] p, [data-theme="dark"] label {
    color: var(--text-secondary) !important;
}

/* Bordas específicas */
[data-theme="dark"] .border-gray-100 { border-color: var(--border-light) !important; }
[data-theme="dark"] .divide-gray-100 > * + * { border-color: var(--border-light) !important; }
[data-theme="dark"] .divide-gray-200 > * + * { border-color: var(--border-primary) !important; }

/* Hover states */
[data-theme="dark"] .hover\\:bg-gray-50:hover { background-color: var(--bg-hover) !important; }
[data-theme="dark"] .hover\\:bg-gray-100:hover { background-color: var(--bg-hover) !important; }

/* Shadows */
[data-theme="dark"] .shadow-sm { box-shadow: 0 1px 2px 0 var(--shadow-primary) !important; }
[data-theme="dark"] .shadow-md { box-shadow: 0 4px 6px -1px var(--shadow-primary), 0 2px 4px -1px var(--shadow-primary) !important; }
[data-theme="dark"] .shadow-lg { box-shadow: 0 10px 15px -3px var(--shadow-hover), 0 4px 6px -2px var(--shadow-primary) !important; }
[data-theme="dark"] .shadow-xl { box-shadow: 0 20px 25px -5px var(--shadow-hover), 0 10px 10px -5px var(--shadow-primary) !important; }
[data-theme="dark"] .shadow-2xl { box-shadow: 0 25px 50px -12px var(--shadow-modal) !important; }

/* Elementos específicos do dashboard */
[data-theme="dark"] .calendar-grid {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .calendar-day {
    background-color: var(--bg-tertiary);
    border-color: var(--border-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .calendar-day:hover {
    background-color: var(--bg-hover);
}

/* Analytics específicos */
[data-theme="dark"] .metric-card,
[data-theme="dark"] .analytics-card {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .metric-title {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .metric-value {
    color: var(--text-primary) !important;
}

/* Chart.js adaptations */
[data-theme="dark"] canvas {
    filter: brightness(0.9);
}

/* Section titles */
[data-theme="dark"] .section-title {
    color: var(--text-primary) !important;
}

/* Specific dashboard elements */
[data-theme="dark"] #dashboard-subtitle,
[data-theme="dark"] #board-subtitle {
    color: var(--text-secondary) !important;
}

/* Loading states */
[data-theme="dark"] .metric-loading {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-tertiary) 50%, var(--bg-hover) 75%);
}

/* Specific utility classes for theme */
[data-theme="dark"] .theme-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .theme-text-primary {
    color: var(--text-primary);
}

[data-theme="dark"] .theme-text-secondary {
    color: var(--text-secondary);
}

[data-theme="dark"] .theme-text-muted {
    color: var(--text-muted);
}

/* ====== CORREÇÕES DE HOVER PARA TEMA ESCURO ====== */

/* Tab buttons hover fix */
[data-theme="dark"] .tab-btn:hover {
    color: var(--text-primary) !important;
    background-color: var(--bg-hover) !important;
}

[data-theme="dark"] .tab-btn.active {
    color: var(--accent-blue) !important;
    background-color: var(--accent-blue-light) !important;
}

/* Task hover fix */
[data-theme="dark"] .task:hover .task-surface {
    background-color: var(--bg-hover) !important;
    box-shadow: 0 6px 15px var(--shadow-hover) !important;
}

/* Subtask elements hover fix */
[data-theme="dark"] .subtask-text-input:hover {
    background-color: var(--bg-hover) !important;
    border-color: var(--border-hover) !important;
}

[data-theme="dark"] .subtask-modal-item:hover {
    background-color: var(--bg-hover) !important;
}

[data-theme="dark"] .remove-subtask:hover {
    background-color: var(--accent-red) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .remove-subtask-modal:hover {
    background-color: var(--accent-red) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .add-subtask-btn:hover {
    background-color: var(--accent-blue-hover) !important;
}

/* Edit buttons hover fix */
[data-theme="dark"] .edit-save-btn:hover {
    background-color: var(--accent-blue-hover) !important;
}

[data-theme="dark"] .edit-cancel-btn:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Recurring task items hover fix */
[data-theme="dark"] .recurring-task-item:hover {
    background-color: var(--bg-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover) !important;
}

[data-theme="dark"] .recurring-task-item .drag-handle:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Form submit button hover fix */
[data-theme="dark"] #add-recurring-task-form button[type="submit"]:hover {
    background-color: var(--accent-blue-hover) !important;
}

/* Time estimation hover fix */
[data-theme="dark"] .time-estimation:hover {
    background-color: var(--bg-hover) !important;
    border-color: var(--border-hover) !important;
}

[data-theme="dark"] .time-spent-display:hover {
    background-color: var(--bg-hover) !important;
}

/* Pomodoro buttons hover fix */
[data-theme="dark"] .pomodoro-option-btn:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .pomodoro-option-btn.work-btn:hover {
    background-color: var(--accent-green) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .pomodoro-option-btn.break-btn:hover {
    background-color: var(--accent-yellow) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .pomodoro-option-btn.long-break-btn:hover {
    background-color: var(--accent-blue) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .task .pomodoro-btn:hover,
[data-theme="dark"] .recurring-task-item .pomodoro-btn:hover {
    background-color: var(--accent-red) !important;
}

/* Date info hover fix */
[data-theme="dark"] .date-info:hover {
    background-color: var(--bg-hover) !important;
}

/* Time estimate comparison hover fix */
[data-theme="dark"] .time-estimate-comparison:hover {
    background-color: var(--bg-hover) !important;
}

/* Alert close button hover fix */
[data-theme="dark"] .estimate-alert-close:hover {
    background-color: var(--accent-red) !important;
    color: var(--text-inverse) !important;
}

/* Stat cards hover fix */
[data-theme="dark"] .stat-card:hover {
    background-color: var(--bg-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-hover) !important;
}

[data-theme="dark"] .metric-card:hover {
    background-color: var(--bg-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-hover) !important;
}

[data-theme="dark"] .recent-task-item:hover {
    background-color: var(--bg-hover) !important;
    border-color: var(--border-hover) !important;
}

/* Action buttons hover fix - melhorado */
[data-theme="dark"] .task .action-btn:hover,
[data-theme="dark"] .recurring-task-item .action-btn:hover {
    background-color: rgba(75, 85, 99, 0.8) !important; /* gray-600 com transparência */
    color: #ffffff !important;
    border-color: rgba(107, 114, 128, 0.8) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .task .delete-btn:hover,
[data-theme="dark"] .recurring-task-item .delete-btn:hover {
    background-color: #dc2626 !important; /* red-600 */
    color: #ffffff !important;
    border-color: #b91c1c !important; /* red-700 */
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4) !important;
}

[data-theme="dark"] .task .edit-btn:hover,
[data-theme="dark"] .recurring-task-item .edit-btn:hover {
    background-color: #2563eb !important; /* blue-600 */
    color: #ffffff !important;
    border-color: #1d4ed8 !important; /* blue-700 */
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4) !important;
}

[data-theme="dark"] .task .planning-btn:hover,
[data-theme="dark"] .recurring-task-item .planning-btn:hover {
    background-color: #7c3aed !important; /* violet-600 */
    color: #ffffff !important;
    border-color: #6d28d9 !important; /* violet-700 */
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.4) !important;
}

[data-theme="dark"] .task .pomodoro-btn:hover,
[data-theme="dark"] .recurring-task-item .pomodoro-btn:hover {
    background-color: #059669 !important; /* emerald-600 */
    color: #ffffff !important;
    border-color: #047857 !important; /* emerald-700 */
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.4) !important;
}

/* Clear completed button hover fix */
[data-theme="dark"] .clear-completed-btn:hover {
    background-color: var(--accent-red-light) !important;
    color: var(--accent-red) !important;
}

/* Column hover fix */
[data-theme="dark"] .column:hover {
    box-shadow: 0 6px 16px var(--shadow-hover) !important;
}

/* Clear filters hover fix */
[data-theme="dark"] .clear-filters:hover {
    background-color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
}

/* ====== CLASSES TAILWIND HOVER FIXES ====== */

/* Hover text colors */
[data-theme="dark"] .hover\:text-gray-700:hover { color: var(--text-primary) !important; }
[data-theme="dark"] .hover\:text-gray-800:hover { color: var(--text-primary) !important; }
[data-theme="dark"] .hover\:text-blue-700:hover { color: var(--accent-blue) !important; }
[data-theme="dark"] .hover\:text-red-700:hover { color: var(--accent-red) !important; }

/* Hover background colors */
[data-theme="dark"] .hover\:bg-white:hover { background-color: var(--bg-hover) !important; }
[data-theme="dark"] .hover\:bg-gray-300:hover { background-color: var(--bg-hover) !important; }
[data-theme="dark"] .hover\:bg-blue-600:hover { background-color: var(--accent-blue-hover) !important; }
[data-theme="dark"] .hover\:bg-red-600:hover { background-color: var(--accent-red) !important; }
[data-theme="dark"] .hover\:bg-green-600:hover { background-color: var(--accent-green) !important; }

/* Hover border colors */
[data-theme="dark"] .hover\:border-gray-400:hover { border-color: var(--border-hover) !important; }
[data-theme="dark"] .hover\:border-blue-500:hover { border-color: var(--accent-blue) !important; }

/* Removed generic button:hover - too broad and causing issues */

/* Removed generic *:hover rule that was causing unwanted hover effects */

[data-theme="dark"] *[style*="background-color: white"]:hover,
[data-theme="dark"] *[style*="background: white"]:hover,
[data-theme="dark"] *[style*="background-color: #fff"]:hover,
[data-theme="dark"] *[style*="background: #fff"]:hover {
    background-color: var(--bg-hover) !important;
}

/* Calendar navigation hover fix */
[data-theme="dark"] #calendar-prev-month:hover,
[data-theme="dark"] #calendar-next-month:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* User table actions hover fix */
[data-theme="dark"] .user-actions button:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Members list hover fix */
[data-theme="dark"] .member-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Dashboard cards hover improvements */
[data-theme="dark"] .analytics-card:hover,
[data-theme="dark"] .productivity-card:hover {
    background-color: var(--bg-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-hover) !important;
}

/* Export button hover fix */
[data-theme="dark"] #export-csv:hover {
    background-color: var(--accent-blue-hover) !important;
}

/* View toggle buttons hover fix */
[data-theme="dark"] .view-toggle-btn:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* User selection buttons hover fix */
[data-theme="dark"] .user-btn:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
}

/* ====== MELHORIAS FINAIS DE HOVER PARA TEMA ESCURO ====== */

/* Removed generic modal/form button hover - too broad */

/* Dropdown and select hover fixes */
[data-theme="dark"] select:hover,
[data-theme="dark"] .select-wrapper:hover {
    background-color: var(--bg-hover) !important;
    border-color: var(--border-hover) !important;
}

/* Link hover fixes */
[data-theme="dark"] a:hover {
    color: var(--accent-blue) !important;
}

/* Removed generic .card and .panel hover - too broad */

/* Removed generic input:hover - causing issues with specific inputs */

/* Removed generic nav hover - too broad */

/* Removed generic li:hover rule - too broad */

/* Icon buttons hover */
[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .btn-icon:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Tooltip elements */
[data-theme="dark"] .tooltip:hover,
[data-theme="dark"] [title]:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Table row hover comprehensive fix */
[data-theme="dark"] tr:hover,
[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] table tr:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] tr:hover td,
[data-theme="dark"] tbody tr:hover td,
[data-theme="dark"] table tr:hover td {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Progress and status elements */
[data-theme="dark"] .progress:hover,
[data-theme="dark"] .status:hover {
    background-color: var(--bg-hover) !important;
}

/* Removed generic *:hover rule that was causing unwanted hover effects */

/* Fix for inherited white backgrounds that slip through */
[data-theme="dark"] .bg-white:hover,
[data-theme="dark"] .bg-gray-50:hover,
[data-theme="dark"] .bg-gray-100:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Focus states for better accessibility */
[data-theme="dark"] *:focus {
    outline-color: var(--accent-blue) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] button:focus {
    box-shadow: 0 0 0 3px var(--accent-blue-light) !important;
}

/* ====== DARK THEME HEADER STYLES ====== */

[data-theme="dark"] header {
    background-color: var(--bg-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] header h1 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] header p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] header .bg-gray-50 {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] header .bg-blue-50 {
    background-color: var(--accent-blue-light) !important;
}

[data-theme="dark"] header .bg-red-50 {
    background-color: var(--accent-red-light) !important;
}

[data-theme="dark"] header #username-display {
    color: var(--text-primary) !important;
}

[data-theme="dark"] header #role-badge {
    background-color: var(--accent-blue-light) !important;
    color: var(--accent-blue) !important;
}
