@import url('https://cdnjs.cloudflare.com/ajax/libs/dashicons/0.9.0/css/dashicons.min.css');

.task-manager-container {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.task-manager-title {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 5px;
    color: #333;
}

.task-manager-subtitle {
    text-align: center;
    color: #666;
    margin-top: 0;
    margin-bottom: 30px;
}

.task-manager-button {
    background-color: #ff5b9d;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    display: block;
    margin: 0 auto 30px;
    transition: background-color 0.3s;
}

.task-manager-button:hover {
    background-color: #e94c8a;
}

.task-categories {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Permite que os cards quebrem em telas menores */
    gap: 15px; /* Espaçamento entre os cards quando quebram */
}

.category-card {
    flex: 1;
    min-width: 200px; /* Largura mínima para evitar cards muito estreitos */
    margin: 0 10px;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.category-work {
    background-color: #e7f1ff;
}

.category-family {
    background-color: #e7ffe7;
}

.category-selfcare {
    background-color: #f5e7ff;
}

.category-card .category-icon {
    font-size: 24px;
    margin-bottom: 0;
    margin-right: 15px;
    flex-shrink: 0; /* Impede o ícone de encolher */
}

.category-card .category-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: block;
}

.category-card .card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.category-card h3 {
    margin: 0;
    font-size: 18px;
    text-align: left;
    /* Não mover para longe do ícone */
    padding-right: 10px;
}

.task-count {
    font-size: 32px;
    font-weight: bold;
    margin-top: 0;
    margin-left: auto;
    padding-left: 15px; /* Adiciona espaço entre o número e o texto */
}

.task-list {
    margin-top: 30px;
}

.task-item {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 5px solid #ddd;
}

.task-work {
    border-left-color: #4a89dc;
}

.task-family {
    border-left-color: #37bc9b;
}

.task-selfcare {
    border-left-color: #967adc;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-title {
    margin: 0;
    font-size: 18px;
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    padding: 6px;
    margin: 0 1px;
    line-height: 1;
}

.task-actions .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: block;
}

.task-actions button:hover {
    color: #333;
}

.task-description {
    margin: 10px 0;
    color: #666;
}

.task-meta {
    display: flex;
    color: #888;
    font-size: 14px;
}

.task-date, .task-time {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.task-meta .dashicons {
    margin-right: 5px;
}

/* Modal */
.task-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.task-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-sizing: border-box;
}

/* Ajustes específicos para mobile */
@media screen and (max-width: 768px) {
    .task-modal-content {
        margin: 5% auto;
        padding: 20px 15px;
        width: 92%;
        max-height: none; /* Remover altura máxima que poderia causar rolagem */
        overflow: visible; /* Remover overflow que pode estar causando problemas */
    }
    
    /* Ajustar o formulário para layout mobile */
    #task-form {
        overflow: visible; /* Remover rolagem interna do formulário */
        max-height: none; /* Remover limite de altura */
    }
    
    .form-row {
        flex-direction: column;
        margin-bottom: 0;
    }
    
    .form-row .form-group {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Campos de entrada mais legíveis em telas pequenas */
    input[type="text"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px; /* Tamanho de fonte que evita zoom automático em iOS */
        padding: 10px;
        box-sizing: border-box;
        width: 100%;
    }
    
    /* Ajustar os botões no modal */
    .form-buttons {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 20px;
        position: static; /* Remover posicionamento sticky que pode estar causando problemas */
    }
    
    .cancel-button, 
    .save-button {
        padding: 12px;
        flex: 1;
        margin: 0 5px;
        font-size: 16px;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

.form-group {
    margin-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

textarea {
    height: 100px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cancel-button {
    background-color: #f7f7f7;
    color: #555;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.save-button {
    background-color: #ff5b9d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.save-button:hover {
    background-color: #e94c8a;
}

.no-tasks {
    text-align: center;
    color: #888;
    padding: 30px;
}

.loading {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* Correções para o layout do formulário e seletor de data */

/* Melhorar layout da linha do formulário */
.form-row {
    display: flex;
    flex-wrap: wrap; /* Permite quebra em telas menores */
    gap: 15px;
}

.form-row .form-group {
    flex: 1 1 45%; /* Melhor distribuição de espaço */
    min-width: 120px; /* Largura mínima garantida */
}

/* Estilos para o jQuery UI DatePicker */
.ui-datepicker {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    padding: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px !important;
    width: auto !important;
    min-width: 250px !important;
    z-index: 1100 !important; /* Garantir que fique acima de outros elementos */
}

.ui-datepicker .ui-datepicker-header {
    background: #f7f7f7 !important;
    border-radius: 4px 4px 0 0 !important;
    padding: 8px !important;
    margin: -10px -10px 5px -10px !important;
    border-bottom: 1px solid #eee !important;
}

.ui-datepicker .ui-datepicker-title {
    text-align: center !important;
    font-weight: bold !important;
    margin: 0 25px !important;
}

.ui-datepicker table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-top: 5px !important;
}

.ui-datepicker th {
    text-align: center !important;
    padding: 5px !important;
    color: #555 !important;
    font-weight: normal !important;
}

.ui-datepicker td {
    padding: 2px !important;
    text-align: center !important;
}

.ui-datepicker td a {
    display: block !important;
    padding: 5px !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
}

.ui-datepicker td a.ui-state-default {
    background-color: #f9f9f9 !important;
    color: #333 !important;
    border: 1px solid #f1f1f1 !important;
}

.ui-datepicker td a.ui-state-highlight {
    border: 1px solid #ddd !important;
    background-color: #e9e9e9 !important;
}

.ui-datepicker td a.ui-state-active {
    background-color: #ff5b9d !important;
    color: white !important;
    border: 1px solid #ff5b9d !important;
}

/* Adaptação para telas pequenas */
@media screen and (max-width: 480px) {
    .ui-datepicker {
        width: 260px !important;
        min-width: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .form-row {
        flex-direction: column !important;
    }
    
    .form-row .form-group {
        width: 100% !important;
    }
}

/* Responsividade para dispositivos móveis */
@media screen and (max-width: 768px) {
    .task-categories {
        flex-direction: column;
        margin: 0;
        padding: 0 10px;
    }
    
    .category-card {
        width: 100%;
        margin: 5px 0;
        min-width: 0; /* Remove a largura mínima em telas pequenas */
        flex-basis: auto; /* Garante que cada card tenha seu tamanho natural */
        box-sizing: border-box;
        padding: 15px;
    }

    /* Ajustar o layout interno do card para mobile */
    .category-card .card-content {
        width: 100%;
    }
    
    /* Certifique-se de que o ícone não seja espremido */
    .category-card .category-icon {
        margin-right: 10px;
    }
    
    .stats-categories {
        flex-direction: column;
        margin: 0;
        padding: 0 10px;
    }
    
    .stats-categories .category-card {
        width: 100%;
        margin: 5px 0;
        box-sizing: border-box;
    }
    
    /* Ajustar a margem do container principal para evitar overflow */
    .task-manager-container {
        padding: 0 5px;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .task-stats-cards {
        flex-direction: column;
    }
    
    .stats-card {
        width: 100%;
    }

    .task-categories {
        flex-direction: column;
    }
    
    .category-card {
        width: 100%;
        margin: 5px 0;
    }

    .stats-categories {
        flex-direction: column;
    }
    
    .stats-categories .category-card {
        width: 100%;
        margin: 5px 0;
    }
}

.task-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    font-size: 1.1em;
}

.task-pagination button {
    background-color: #ff5b9d;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    opacity: 1;
}

.task-pagination button:disabled,
.task-pagination button[disabled] {
    background: #eee;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
}

.task-pagination span {
    margin: 0 8px;
    color: #333;
    font-weight: 500;
}

.stats-categories .category-card {
    position: relative;
    padding-bottom: 40px; /* Aumentado para dar mais espaço para a barra de progresso */
}

.stats-categories .progress-bar-container {
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: 20px;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0;
    z-index: 1; /* Garantir que a barra fique visível */
}

.stats-categories .progress-bar {
    height: 100%;
    background: linear-gradient(to right, #37bc9b, #37bc9b);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stats-section-title,
.stats-section-subtitle {
    text-align: center;
}

/* Estilos para tarefas concluídas */
.task-completed {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.task-completed .task-title,
.task-completed .task-description {
    text-decoration: line-through;
}

.task-completed:hover {
    opacity: 0.9;
}

/* Botão de concluir tarefa */
.complete-task {
    margin-right: 5px;
}

.complete-task .dashicons-yes-alt {
    color: #37bc9b;
}

.task-completed .complete-task .dashicons-yes-alt {
    color: #999;
}

.complete-task:hover .dashicons-yes-alt {
    color: #2a9d8f;
}