/**
 * MisRecuerdos.life - Estilos de modales
 * Tema: iOS Crystal Design
 * Fecha: Julio 2025
 */

/* ===== MODAL BASE ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: all var(--transition-normal);
}

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

.modal-content {
    background: white;
    padding: 0;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    transform: scale(0.7);
    transition: all var(--transition-normal);
    border: 1px solid var(--surface-secondary);
}

.modal.show .modal-content {
    transform: scale(1);
}

/* ===== MODAL HEADER ===== */
.modal-header {
    background: var(--surface);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--surface-secondary);
    position: relative;
}

.modal-header h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== MODAL BODY ===== */
.modal-body {
    padding: 2rem;
}

/* ===== CLOSE BUTTON ===== */
.close {
    color: var(--text-secondary);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
}

.close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

/* ===== MODAL SECTIONS ===== */
.modal-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-secondary);
}

.modal-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.modal-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ===== MODAL FORMS ===== */
.modal .form-group {
    margin-bottom: 1.5rem;
}

.modal .form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    padding: 1rem;
    border: 2px solid var(--surface-secondary);
    border-radius: 10px;
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: white;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* ===== MODAL BUTTONS ===== */
.modal .btn {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
}

.modal .btn:last-child {
    margin-bottom: 0;
}

/* ===== VALIDATION MESSAGES ===== */
.validation-message {
    color: var(--accent-color);
    font-size: 0.8rem;
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.validation-message.show {
    display: block;
}

/* ===== LOADING STATES ===== */
.modal .btn.loading {
    position: relative;
    color: transparent;
}

.modal .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== WHATSAPP FLOAT BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    transition: all var(--transition-normal);
    text-decoration: none;
    z-index: 999;
    border: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 30px;
    height: 30px;
}

/* ===== MODAL ANIMATIONS ===== */
.modal-enter {
    animation: modalEnter var(--transition-normal) ease-out;
}

.modal-exit {
    animation: modalExit var(--transition-normal) ease-in;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 1.5rem;
    }

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

    .modal-body {
        padding: 1.5rem;
    }

    .close {
        top: 10px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 0.5rem;
        border-radius: var(--border-radius);
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}
