* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.db-status,
.update-status {
    font-size: 8px;
    padding: 8px 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    text-align: center;
}

.update-status {
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c9c9c9;
}

.status-indicator,
.update-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.update-indicator.checking {
    background: #FF9800;
    animation: spin 1s linear infinite;
}

.update-indicator.connected {
    background: #2196F3;
    animation: none;
}

.update-indicator.updated {
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.update-indicator.error {
    background: #F44336;
    animation: none;
}

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

.db-status.conectado {
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.db-status.desconectado {
    background: rgba(244, 67, 54, 0.3);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.db-status small {
    display: block;
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.8;
}

.clock {
    font-size: 2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.tasks-grid {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    max-width: 100%;
    margin: 0 auto;
    min-height: 200px;
    width: 100%;
    gap: 15px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .status-info {
        align-items: center;
    }
    
    .clock {
        font-size: 1.5rem;
        padding: 10px 20px;
    }
    
    .tasks-grid {
        padding: 10px 0;
        gap: 10px;
    }
    
    .task-card {
        margin: 0;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        touch-action: pan-y;
        cursor: grab;
    }
    
    .task-card:active {
         cursor: grabbing;
         transform: scale(1.02);
         box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
     }
     
     /* Estilos de drag and drop removidos */
 }

.task-card {
    animation: slideInUp 0.4s ease-out;
}

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

@keyframes reorderPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.task-reordered {
    animation: reorderPulse 0.5s ease-in-out;
}

.task-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: grab;
    position: relative;
    display: block;
    padding: 25px;
    width: 100%;
    margin: 0 0 20px 0;
    min-height: 120px;
    clear: both;
    border-left: 6px solid;
    overflow: hidden;
    transform: translateZ(0);
}

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

/* Animações para atualizações fluidas */
.task-card-entering {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-card-entered {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.task-card-removing {
    opacity: 0;
    transform: translateX(-100%) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.6, 1);
    pointer-events: none;
}

.task-card-moving {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10;
    transition: all 0.2s ease;
}

.task-card-updated {
    animation: updatePulse 0.5s ease-out;
}

/* Transições suaves para elementos de texto */
.task-card h3,
.task-card .time-value {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Animação para indicar atualização */
@keyframes updatePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* Estilos de drag and drop removidos */

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 0 0 0 100px;
}

.task-info {
    margin: 15px 0;
}

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

.task-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.task-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.task-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.task-content {
    margin-bottom: 15px;
}

.task-observation {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #e9ecef;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.task-description {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
    max-width: 100%;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #95a5a6;
    padding: 8px 0;
    border-top: 1px solid #ecf0f1;
}

.task-created, .task-priority {
    font-weight: 500;
}

.task-countdown {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 15px;
    text-align: center;
    min-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    font-family: 'Courier New', monospace;
}

.task-countdown.warning {
    color: #f39c12;
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    animation: pulse 2s infinite;
}

.task-countdown.critical {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    animation: blink 1s infinite;
}

.task-countdown.expired {
    background: rgba(192, 57, 43, 0.9);
    color: white;
    border-color: #c0392b;
    font-weight: bold;
    animation: blink 1s infinite;
}

/* Estilos para urgências baseadas no banco de dados */
.urgencia-expirada {
    background: rgba(192, 57, 43, 0.9) !important;
    color: white !important;
    border-color: #c0392b !important;
    font-weight: bold !important;
    animation: blink 1s infinite !important;
}

.urgencia-critica {
    color: #e74c3c !important;
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.2) !important;
    animation: blink 1s infinite !important;
}

.urgencia-atencao {
    color: #f39c12 !important;
    border-color: #f39c12 !important;
    background: rgba(243, 156, 18, 0.1) !important;
    animation: pulse 2s infinite !important;
}

.urgencia-normal {
    color: #27ae60 !important;
    border-color: #27ae60 !important;
    background: rgba(39, 174, 96, 0.1) !important;
}

/* Aplicar estilo vermelho para toda a tarefa expirada */
.task-card .urgencia-expirada {
    border-left-color: #c0392b !important;
}

.task-card:has(.urgencia-expirada) {
    border-left-color: #c0392b !important;
    background: rgba(192, 57, 43, 0.05) !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.5rem;
}

/* Cores para os cards */
.task-card[data-color="red"] {
    border-left-color: #e74c3c;
}

.task-card[data-color="blue"] {
    border-left-color: #3498db;
}

.task-card[data-color="green"] {
    border-left-color: #2ecc71;
}

.task-card[data-color="yellow"] {
    border-left-color: #f1c40f;
}

.task-card[data-color="purple"] {
    border-left-color: #9b59b6;
}

.task-card[data-color="orange"] {
    border-left-color: #e67e22;
}

.task-card[data-color="gray"] {
    border-left-color: #95a5a6;
}

.task-card[data-color="black"] {
    border-left-color: #2c3e50;
}

.task-card[data-color="white"] {
    border-left-color: #ecf0f1;
}

.task-card[data-color="orange2"] {
    border-left-color: #ff6b35;
}

/* Responsividade para telas grandes */
@media (min-width: 1200px) {
    header h1 {
        font-size: 4rem;
    }
    
    .task-name {
        font-size: 1.8rem;
    }
    
    .task-countdown {
        font-size: 2rem;
        min-width: 200px;
    }
    
    .task-card {
        min-height: 140px;
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .task-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .task-name {
        font-size: 1.4rem;
    }
    
    .task-countdown {
        font-size: 1.6rem;
        padding: 12px;
    }
    
    .task-observation {
        font-size: 1rem;
    }
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.task-time {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 500;
}

.task-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.task-btn {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 13px;
    min-width: 90px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.complete-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-color: #27ae60;
}

.complete-btn:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.complete-btn:active {
    transform: translateY(0) scale(1.02);
}

.delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-color: #c0392b;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.delete-btn:active {
    transform: translateY(0) scale(1.02);
}

/* Efeito de brilho nos botões */
.task-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.task-btn:hover::before {
     left: 100%;
 }
 
 /* Modal de confirmação de exclusão */
 .delete-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.7);
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 10000;
     backdrop-filter: blur(5px);
     animation: fadeIn 0.3s ease;
 }
 
.delete-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

 .delete-modal-content {
     background: white;
     border-radius: 15px;
     padding: 0;
     max-width: 450px;
     width: 90%;
     box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
     animation: slideIn 0.3s ease;
     overflow: hidden;
 }
 
 .delete-modal-header {
     background: linear-gradient(135deg, #e74c3c, #c0392b);
     color: white;
     padding: 20px;
     text-align: center;
 }
 
 .delete-modal-header h3 {
     margin: 0;
     font-size: 1.4rem;
     font-weight: 600;
 }
 
 .delete-modal-body {
     padding: 25px;
     text-align: center;
     color: #333;
 }
 
 .delete-modal-body p {
     margin: 10px 0;
     font-size: 1rem;
     line-height: 1.5;
 }
 
 .delete-modal-body strong {
     color: #e74c3c;
     font-size: 1.1rem;
     display: block;
     margin: 15px 0;
     padding: 10px;
     background: rgba(231, 76, 60, 0.1);
     border-radius: 8px;
     border-left: 4px solid #e74c3c;
 }
 
 .warning-text {
     color: #e67e22 !important;
     font-weight: 600;
     font-size: 0.9rem !important;
 }
 
 .delete-modal-actions {
     padding: 20px 25px;
     display: flex;
     gap: 15px;
     justify-content: center;
     background: #f8f9fa;
 }
 
 .modal-btn {
     padding: 12px 24px;
     border: none;
     border-radius: 8px;
     cursor: pointer;
     font-weight: 600;
     font-size: 14px;
     min-width: 100px;
     transition: all 0.3s ease;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }
 
 .cancel-btn {
     background: #95a5a6;
     color: white;
 }
 
 .cancel-btn:hover {
     background: #7f8c8d;
     transform: translateY(-2px);
     box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
 }
 
 .confirm-btn {
     background: linear-gradient(135deg, #e74c3c, #c0392b);
     color: white;
 }
 
 .confirm-btn:hover {
     background: linear-gradient(135deg, #c0392b, #a93226);
     transform: translateY(-2px);
     box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
 }
 
 @keyframes fadeIn {
     from { opacity: 0; }
     to { opacity: 1; }
 }
 
 @keyframes slideIn {
     from {
         opacity: 0;
         transform: translateY(-50px) scale(0.9);
     }
     to {
         opacity: 1;
         transform: translateY(0) scale(1);
     }
 }
 
 /* Responsividade do modal */
@media (max-width: 768px) {
    .delete-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .delete-modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Animações para notificações de atualização */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.update-notification {
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 4px solid #20c997;
}

.update-notification::before {
    content: '🔄 ';
    margin-right: 5px;
}

/* Configurações de tamanho de fonte para TV */
:root.font-small {
    --base-font-size: 0.9;
}

:root.font-medium {
    --base-font-size: 1.0;
}

:root.font-large {
    --base-font-size: 1.3;
}

:root.font-xlarge {
    --base-font-size: 1.6;
}

/* Aplicar tamanhos de fonte escaláveis */
/* Configuração de fonte apenas para task-content e task-observation */
:root.font-small .task-content { font-size: calc(1rem * 0.9); }
:root.font-medium .task-content { font-size: 1rem; }
:root.font-large .task-content { font-size: calc(1rem * 1.3); }
:root.font-xlarge .task-content { font-size: calc(1rem * 1.6); }
:root.font-xxlarge .task-content { font-size: calc(1rem * 2.0); }

:root.font-small .task-observation { font-size: calc(1rem * 0.9); }
:root.font-medium .task-observation { font-size: 1rem; }
:root.font-large .task-observation { font-size: calc(1rem * 1.3); }
:root.font-xlarge .task-observation { font-size: calc(1rem * 1.6); }
:root.font-xxlarge .task-observation { font-size: calc(1rem * 2.0); }



/* Permitir quebra de linha nos textos */
.task-content, .task-observation {
    word-wrap: break-word;
}

:root.font-small .countdown-time { font-size: calc(1.1rem * 0.9); }
:root.font-medium .countdown-time { font-size: 1.1rem; }
:root.font-large .countdown-time { font-size: calc(1.1rem * 1.3); }
:root.font-xlarge .countdown-time { font-size: calc(1.1rem * 1.6); }
:root.font-xxlarge .countdown-time { font-size: calc(1.1rem * 2.0); }

:root.font-small .db-status,
:root.font-small .update-status { font-size: calc(1rem * 0.9); }
:root.font-medium .db-status,
:root.font-medium .update-status { font-size: 1rem; }
:root.font-large .db-status,
:root.font-large .update-status { font-size: calc(12px); }
:root.font-xlarge .db-status,
:root.font-xlarge .update-status { font-size: calc(12px); }
:root.font-xxlarge .db-status,
:root.font-xxlarge .update-status { font-size: calc(12px); }

:root.font-small .clock { font-size: calc(1.2rem * 0.9); }
:root.font-medium .clock { font-size: 1.2rem; }
:root.font-large .clock { font-size: calc(15px); }
:root.font-xlarge .clock { font-size: calc(15px); }
:root.font-xxlarge .clock { font-size: calc(15px); }

/* Footer */
.footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
}

.footer-logo {
    width: 120px;
    height: auto;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 0.9;
}

:root.font-small .empty-state h2 { font-size: calc(2rem * 0.9); }
:root.font-medium .empty-state h2 { font-size: 2rem; }
:root.font-large .empty-state h2 { font-size: calc(2rem * 1.3); }
:root.font-xlarge .empty-state h2 { font-size: calc(2rem * 1.6); }
:root.font-xxlarge .empty-state h2 { font-size: calc(2rem * 2.0); }

:root.font-small .empty-state p { font-size: calc(1.2rem * 0.9); }
:root.font-medium .empty-state p { font-size: 1.2rem; }
:root.font-large .empty-state p { font-size: calc(1.2rem * 1.3); }
:root.font-xlarge .empty-state p { font-size: calc(1.2rem * 1.6); }
:root.font-xxlarge .empty-state p { font-size: calc(1.2rem * 2.0); }