/* ========================================
   IMPROVED MODAL CSS
   Modern, Clean & Responsive Design
   ======================================== */

/* Overlay - Full screen backdrop */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 30, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal Container - Main wrapper */
.popup-container {
    position: relative;
    background: linear-gradient(135deg, #0c1f3c 0%, #1e3c72 100%);
    border-radius: 24px;
    max-width: 900px;
    width: 92%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(0, 255, 85, 0.15);
    border: 1px solid rgba(0, 255, 85, 0.2);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: modalSlideIn 0.4s ease-out;
}

.popup-overlay.hidden .popup-container {
    transform: scale(0.9);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button - Enhanced visibility */
.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 85, 0.3);
    color: #00ff55;
    font-size: 28px;
    font-weight: 300;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-button:hover {
    background: rgba(0, 255, 85, 0.2);
    border-color: #00ff55;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 85, 0.4);
}

.close-button:active {
    transform: rotate(90deg) scale(0.95);
}

/* Content Layout - Two column design */
.popup-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    min-height: 500px;
    gap: 0;
}

/* Left Side - Visual Impact */
.popup-left {
    background: linear-gradient(135deg, #1a2f4d 0%, #0a1628 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.popup-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 85, 0.05) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.cyber-bg {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Lightning Icon */
.lightning-bolt {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    color: #00ff55;
    animation: iconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 255, 85, 0.6));
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lightning-bolt svg {
    width: 100%;
    height: 100%;
}

/* Badge Styling */
.limited-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00ff55 0%, #00dd44 100%);
    color: #0a1628;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 255, 85, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 255, 85, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(0, 255, 85, 0.5); }
}

.flash-text {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 0 20px rgba(0, 255, 85, 0.4);
    margin-top: 10px;
}

/* Right Side - Information */
.popup-right {
    background: rgba(255, 255, 255, 0.02);
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.popup-header {
    margin-bottom: 30px;
}

.flash-heading {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 15px 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Offer Content */
.offer-content {
    text-align: center;
}

.discount-text {
    font-size: 82px;
    font-weight: 900;
    color: #00ff55;
    line-height: 1;
    margin: 20px 0;
    text-shadow: 0 0 30px rgba(0, 255, 85, 0.5),
                 0 5px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: -2px;
}

.course-text {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.limited-text {
    color: #00ff55;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 10px 0 30px;
    letter-spacing: 1.5px;
}

/* Countdown Timer */
.countdown-container {
    margin: 35px 0;
}

.countdown-timer {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.time-box {
    background: rgba(0, 255, 85, 0.08);
    border: 2px solid rgba(0, 255, 85, 0.3);
    border-radius: 12px;
    padding: 15px 10px;
    min-width: 75px;
    text-align: center;
    transition: all 0.3s ease;
}

.time-box:hover {
    background: rgba(0, 255, 85, 0.12);
    border-color: rgba(0, 255, 85, 0.5);
    transform: translateY(-2px);
}

.time-box span {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #00ff55;
    text-shadow: 0 0 15px rgba(0, 255, 85, 0.4);
    line-height: 1;
    margin-bottom: 8px;
}

.time-box label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.time-separator {
    color: #00ff55;
    font-size: 28px;
    font-weight: 700;
    opacity: 0.6;
    margin: 0 -5px;
}

/* Form Styling */
.coupon-form {
    margin-top: 35px;
}

.input-container {
    margin-bottom: 20px;
    position: relative;
}

input[type="email"] {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 255, 85, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input[type="email"]:focus {
    border-color: #00ff55;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(0, 255, 85, 0.2);
}

.error-message {
    color: #ff4444;
    font-size: 13px;
    margin-top: 8px;
    display: block;
}

.error-message.hidden {
    display: none;
}

/* CTA Button */
.cta-button {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #00ff55 0%, #00dd44 100%);
    border: none;
    border-radius: 12px;
    color: #0a1628;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(0, 255, 85, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 255, 85, 0.4);
}

.cta-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 255, 85, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-content {
        grid-template-columns: 1fr;
    }

    .popup-left {
        padding: 40px 30px;
        min-height: auto;
    }

    .popup-right {
        padding: 40px 30px;
    }

    .flash-heading {
        font-size: 28px;
    }

    .discount-text {
        font-size: 64px;
    }

    .course-text {
        font-size: 16px;
    }

    .countdown-timer {
        gap: 8px;
    }

    .time-box {
        min-width: 60px;
        padding: 12px 8px;
    }

    .time-box span {
        font-size: 24px;
    }

    .time-box label {
        font-size: 9px;
    }

    .time-separator {
        font-size: 20px;
        margin: 0 -3px;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 96%;
        border-radius: 16px;
    }

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

    .lightning-bolt {
        width: 60px;
        height: 60px;
    }

    .flash-text {
        font-size: 24px;
    }

    .discount-text {
        font-size: 52px;
    }

    .time-box {
        min-width: 50px;
        padding: 10px 6px;
    }

    .time-box span {
        font-size: 20px;
    }

    .cta-button {
        font-size: 15px;
        padding: 16px 25px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .popup-container,
    .close-button,
    .cta-button,
    .lightning-bolt,
    .limited-badge {
        animation: none;
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: light) {
    .popup-container {
        background: linear-gradient(135deg, #2a4a6f 0%, #3d5f8f 100%);
    }
}
