/* Estilos para el modal de eventos */

/* Asegurar que el contenido del modal ocupe el ancho completo */
.modal-content {
    width: 100%;
    box-sizing: border-box;
}

.event-header {
    position: relative;
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 5px 5px 0 0;
    background-color: #f5f5f5;
    margin: -20px -20px 15px -20px;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.event-header h2 {
    margin: 0;
    padding: 0;
    color: #333;
}

.event-badge {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    opacity: 0.1;
    z-index: 0;
    border-radius: 5px 5px 0 0;
}

#event-title {
    position: relative;
    z-index: 1;
}

.event-id-container {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 5px;
    font-weight: bold;
    border-radius: 3px;
    background-color: #f0f0f0;
    font-size: 0.9em;
    color: #555;
}

.event-id {
    display: inline;
}

/* Mejoras para el modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 650px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 10;
}

.close:hover {
    color: #555;
}

/* Estilos para botones en modal */
.modal-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

.modal-actions button:hover {
    transform: translateY(-2px);
}

.modal-actions button:active {
    transform: translateY(0);
}

#edit-event {
    background-color: #2196f3;
    color: white;
}

#edit-event:hover {
    background-color: #0d8aee;
}

#delete-event {
    background-color: #f44336;
    color: white;
}

#delete-event:hover {
    background-color: #e53935;
}

/* Mejoras para tipos de eventos */
.event-type, .calendar-type {
    display: inline-block;
    padding: 3px 8px;
    margin-right: 5px;
    border-radius: 3px;
    background-color: #f0f0f0;
    font-size: 0.85em;
    color: #555;
}

/* Estilos para estado de tareas */
.task-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.task-status-badge i {
    margin-right: 5px;
}

.task-status-badge.completed {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.task-status-badge.pending {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.task-status-badge.expired {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Botón de completar tarea */
#complete-task {
    background-color: #4caf50;
    margin-left: 5px;
    display: inline-block !important; /* Forzar visualización */
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10;
}

#complete-task:hover {
    background-color: #388e3c;
}

/* Cuando la tarea está completada y queremos marcarla como pendiente */
.completed ~ .modal-actions #complete-task {
    background-color: #ffb74d;
}

.completed ~ .modal-actions #complete-task:hover {
    background-color: #ff9800;
}

/* Asegurar que los botones tengan el ancho adecuado */
.modal-actions button {
    min-width: 130px;
}

/* Espaciado para el contenedor de estado */
#task-status-container {
    margin-top: 5px;
}

/* Estilos específicos para garantizar visibilidad del botón */
#complete-task.visible {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    min-width: 180px !important;
}

/* Mejora visual de la disposición de botones */
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Estilos específicos para el modal de eventos recurrentes */
#recurring-delete-modal .modal-content {
    max-width: 500px;
}

.recurring-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.option-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

#delete-single {
    border-left: 4px solid #2196f3;
}

#delete-future {
    border-left: 4px solid #ff9800;
}

#delete-all {
    border-left: 4px solid #f44336;
}

/* Asegurarse de que el modal recurring se muestre correctamente */
#recurring-delete-modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .event-meta {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-actions {
        width: 100%;
        justify-content: space-between;
    }
}
