/* ============================================================
   dialogs.css — Estilos para modales y diálogos
   Fulltrust Software
   ============================================================ */

/* ── Modal Base ─────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

.modal.activo {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ── Contenido del Modal ───────────────────────────────── */
.modal-contenido {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-pequeno {
    max-width: 400px;
}

.modal-grande {
    max-width: 80vw;
    width: 80%;
    max-height: 80vh;
}

.modal-adaptable {
    max-width: 560px;
    width: 92%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* ── Botón cerrar ──────────────────────────────────────── */
.cerrar {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.cerrar:hover {
    color: #333;
}

/* ── Títulos y texto ───────────────────────────────────── */
.modal-contenido h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.modal-contenido p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

/* ── Botones del Modal ─────────────────────────────────── */
.modal-botones {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-primary {
    background-color: #4a7dbb;
    color: white;
}

.btn-primary:hover {
    background-color: #1a4080;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-info {
    background-color: #06b6d4;
    color: white;
}

.btn-info:hover {
    background-color: #0891b2;
}

/* ── Alertas por tipo ──────────────────────────────────── */
.modal-alert h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-alert h2 i {
    font-size: 1.8rem;
}

.alert-success h2 {
    color: #10b981;
}

.alert-error h2 {
    color: #ef4444;
}

.alert-warning h2 {
    color: #f59e0b;
}

.alert-info h2 {
    color: #06b6d4;
}

/* ── Loading Spinner ───────────────────────────────────── */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    backdrop-filter: blur(4px);
}

.loading.show {
    display: flex !important;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4a7dbb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
    .modal-contenido {
        padding: 20px;
        width: 95%;
    }
    
    .modal-grande {
        width: 95%;
        max-width: 95vw;
        padding: 15px;
    }
    
    .modal-botones {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
