/* ===================================
   MODALS - Modales, notificaciones, confirmación,
   gestión de personas y edición de descripciones
   (Réplica de style.css del proyecto real)
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Form Styles */
.add-persona-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.add-persona-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="color"]:hover {
    border-color: var(--accent-color);
}

.btn-add {
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* Personas List */
.personas-list h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

#personasListContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.persona-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.persona-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.persona-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
}

.persona-info {
    flex: 1;
}

.persona-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.persona-info .persona-id {
    font-size: 0.85rem;
    color: #666;
}

.persona-actions {
    display: flex;
    gap: 8px;
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger-color), #e53935);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Floating Button */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.floating-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* Botón para cerrar la aplicación (solo versión ejecutable) */
.shutdown-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    color: white;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 999;
}

.shutdown-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   MODALES DE NOTIFICACIÓN Y CONFIRMACIÓN
   =================================== */

/* Modal de Notificación */
.notification-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.notification-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.notification-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 0.6s ease;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.notification-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.notification-btn {
    background: linear-gradient(135deg, var(--accent-color), #1976d2);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.notification-btn:active {
    transform: translateY(0);
}

/* Modal de Confirmación */
.confirmation-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.confirmation-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.confirmation-header {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.confirmation-icon {
    font-size: 2rem;
}

.confirmation-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.confirmation-message {
    padding: 30px;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
    text-align: center;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    justify-content: flex-end;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--accent-color), #1976d2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

/* ===== ESTILOS PARA EDICIÓN DE DESCRIPCIONES ===== */

/* Celda de descripción con botón de edición */
.description-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.description-text {
    flex: 1;
    word-break: break-word;
}

.description-text.has-replacement {
    color: var(--primary-color);
    font-weight: 500;
    position: relative;
}

.description-text.has-replacement::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    margin-right: 4px;
}

/* Botón de editar descripción */
.btn-edit-description {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0.6;
}

.btn-edit-description:hover {
    opacity: 1;
    background: var(--bg-color);
    transform: scale(1.1);
}

/* Input readonly para descripción original */
.readonly-input {
    background-color: var(--bg-color) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Estilos adicionales para el modal de edición */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    #personasListContainer {
        grid-template-columns: 1fr;
    }

    .floating-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .notification-content,
    .confirmation-content {
        width: 95%;
    }

    .confirmation-buttons {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }

    .description-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-edit-description {
        align-self: flex-end;
        margin-top: 5px;
    }
}
