/* WhatsApp Modal - Temática Espacial */

/* Modal Container */
.whatsapp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    pointer-events: none;
}

.whatsapp-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

/* Backdrop */
.whatsapp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1;
}

/* Space Background for Modal */
.space-bg-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

/* Stars */
.stars-modal {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 50%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: twinkle 8s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Planets */
.planets-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.planet {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
    filter: blur(1px);
}

.planet-1 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #8b5cf6, #6366f1);
    top: 10%;
    left: 5%;
    animation: float 20s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
}

.planet-2 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #f472b6, #ec4899);
    bottom: 15%;
    right: 10%;
    animation: float 15s ease-in-out infinite reverse;
    box-shadow: 0 0 30px rgba(244, 114, 182, 0.5);
}

.planet-3 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #06b6d4, #3b82f6);
    top: 60%;
    left: 80%;
    animation: float 25s ease-in-out infinite;
    box-shadow: 0 0 50px rgba(6, 182, 212, 0.5);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(5deg);
    }
    50% {
        transform: translateY(-40px) translateX(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-20px) translateX(10px) rotate(3deg);
    }
}

/* Shooting Stars - Sofisticadas */
.shooting-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shooting-star {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0) 100%);
    filter: blur(0.5px);
    opacity: 0;
    transform-origin: right center;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: -2.5px;
    right: 0;
    width: 5px;
    height: 5px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.5) 40%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

.shooting-star:nth-child(1) {
    width: 120px;
    top: 12%;
    left: -150px;
}

.shooting-star:nth-child(2) {
    width: 100px;
    top: 58%;
    left: -150px;
}

.shooting-star:nth-child(3) {
    width: 140px;
    top: 83%;
    left: -150px;
}

/* Modal Content */
.whatsapp-modal-content {
    position: relative;
    z-index: 3;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    padding: 40px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(139, 92, 246, 0.2),
        0 0 100px rgba(139, 92, 246, 0.3);
    transform: scale(0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Close Button */
.whatsapp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.whatsapp-modal-close:hover {
    background: var(--secondary);
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Modal Header */
.whatsapp-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.whatsapp-icon-large {
    display: inline-block;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow:
        0 10px 30px rgba(37, 211, 102, 0.3),
        0 0 0 8px rgba(37, 211, 102, 0.1);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 10px 30px rgba(37, 211, 102, 0.3),
            0 0 0 8px rgba(37, 211, 102, 0.1);
    }
    50% {
        box-shadow:
            0 10px 40px rgba(37, 211, 102, 0.5),
            0 0 0 12px rgba(37, 211, 102, 0.2);
    }
}

.whatsapp-icon-large svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.whatsapp-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.whatsapp-modal-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Modal Body */
.whatsapp-modal-body {
    margin-top: 24px;
}

.form-group-modal {
    margin-bottom: 24px;
}

.form-group-modal label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.form-group-modal textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.5);
    color: #fff;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group-modal textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 0 20px rgba(139, 92, 246, 0.2);
}

.form-group-modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Send Button */
.btn-whatsapp-send {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-whatsapp-send::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-whatsapp-send:hover::before {
    width: 300px;
    height: 300px;
}

.btn-whatsapp-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

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

.btn-whatsapp-send svg {
    position: relative;
    z-index: 1;
}

/* WhatsApp Float Button Styles */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    opacity: 1;
    visibility: visible;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    pointer-events: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-modal-content {
        padding: 32px 24px;
        max-width: 95%;
    }

    .whatsapp-modal-header h3 {
        font-size: 20px;
    }

    .whatsapp-icon-large {
        width: 60px;
        height: 60px;
    }

    .whatsapp-icon-large svg {
        width: 40px;
        height: 40px;
    }

    .planet-1 {
        width: 50px;
        height: 50px;
    }

    .planet-2 {
        width: 40px;
        height: 40px;
    }

    .planet-3 {
        width: 60px;
        height: 60px;
    }

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

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

/* Extra small devices */
@media (max-width: 480px) {
    .whatsapp-float {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        bottom: 20px;
        right: 20px;
    }

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

    .whatsapp-modal-content {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .whatsapp-modal-header h3 {
        font-size: 18px;
    }

    .whatsapp-modal-header p {
        font-size: 13px;
    }

    .form-group-modal textarea {
        font-size: 13px;
        padding: 14px;
    }

    .btn-whatsapp-send {
        font-size: 14px;
        padding: 14px 20px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .whatsapp-modal-content {
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }

    .whatsapp-icon-large {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

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

    .whatsapp-modal-header h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .whatsapp-modal-header p {
        font-size: 12px;
    }

    .form-group-modal textarea {
        rows: 3;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

html.modal-open {
    overflow: hidden !important;
}

/* ========================================
   SELECTOR DE REGIÓN
   ======================================== */

.region-selector {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.region-selector-header {
    text-align: center;
    margin-bottom: 20px;
}

.region-selector-header svg {
    color: #8b5cf6;
    margin-bottom: 8px;
}

.region-selector-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.region-selector-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.region-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.region-btn {
    background: rgba(17, 24, 39, 0.6);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.region-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.region-btn:hover::before {
    opacity: 1;
}

.region-btn:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.region-btn.selected {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

.region-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.region-flag {
    font-size: 32px;
    line-height: 1;
}

.region-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    position: relative;
    z-index: 1;
}

.region-phone {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .region-buttons {
        grid-template-columns: 1fr;
    }

    .region-btn {
        padding: 14px;
    }

    .region-flag {
        font-size: 28px;
    }
}
