/* Overlay with glassmorphism backdrop */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: overlayFadeIn 0.8s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modern glassmorphism modal */
.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    max-width: 450px;
    width: 90%;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: modalSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffd93d);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal h2 {
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal p {
    color: #4a5568;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

.input-container {
    position: relative;
    margin-bottom: 2rem;
}

.modal input[type="email"] {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 2px solid transparent;
    background: rgba(247, 250, 252, 0.8);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: #2d3748;
}

.modal input[type="email"]:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.modal input[type="email"]::placeholder {
    color: #a0aec0;
}

.modal-subscribe-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-subscribe-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal-subscribe-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.modal-subscribe-btn:hover::before {
    left: 100%;
}

.modal-subscribe-btn:active {
    transform: translateY(-1px);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: #718096;
    transition: all 0.3s ease;
    border: none;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
    color: #4a5568;
}

.success-message {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
    animation: successSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.3);
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .modal {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .modal h2 {
        font-size: 1.8rem;
    }

    .modal p {
        font-size: 1rem;
    }
}