/* --- Global Poppins & Transitions --- */
.ucm-modal-overlay,
.ee-coupon-ribbon,
.ucm-course-coupon-tag,
.ucm-floating-coupon {
    font-family: 'Poppins', sans-serif !important;
    box-sizing: border-box;
}

/* --- FIX: Celebration Animation Layering --- */
#ucm-confetti-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    /* Forces confetti above everything */
    pointer-events: none !important;
    /* Allows clicking the modal through the confetti */
    display: block !important;
}

/* --- Listing Card Ribbons --- */
.ee-coupon-ribbon {
    position: absolute;
    top: 15px;
    right: -8px;
    background: #0369a1;
    color: #ffffff;
    padding: 6px 15px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 4px 0 0 4px;
    z-index: 10;
    box-shadow: -2px 4px 10px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
}

/* --- Hero Section Badge --- */
.ucm-course-coupon-tag {
    background: #0369a1;
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(3, 105, 161, 0.4);
}

/* --- FIX: Body Lock to prevent Screen Shifting/Gaps --- */
body.ee-locked {
    overflow: hidden !important;
    width: 100% !important;
    position: relative;
}

/* --- Lead Capture Modal Overlay --- */
.ucm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto !important;
    height: auto !important;
    background: rgba(15, 23, 42, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    /* Absolute top priority */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    overflow-y: auto;
    margin: 0;
}

.ucm-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    /* Prevents overflow on short screens */
    border-radius: 28px;
    position: relative;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: ucmModalSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    /* Adds internal scrollbar if needed */
    display: flex;
    flex-direction: column;
}

@keyframes ucmModalSlide {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ucm-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #64748b;
}

/* --- Form Row & Input Group Hierarchy --- */
.ucm-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.ucm-form-row.single {
    display: block;
}

.ucm-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ucm-input-group label {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 2px;
}

/* --- Uniform Form Elements --- */
.ucm-modal-content input,
.ucm-modal-content select {
    width: 100%;
    height: 48px;
    /* Standardized height */
    padding: 0 15px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    color: #1e293b;
}

.ucm-modal-content input:focus {
    border-color: #0369a1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(3, 105, 161, 0.1);
}

/* --- Input with Icon Wrapper --- */
.ucm-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.ucm-input-with-icon .dashicons {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

.ucm-input-with-icon input {
    padding-left: 45px !important;
    /* Make room for icon */
}

/* --- NEW: Mobile Number Split & Flag UI --- */
.ucm-phone-split {
    display: flex;
    gap: 8px;
    align-items: center;
}

#ucm_country_code.ucm-flag-select {
    width: 110px !important;
    /* Wider for flag visibility */
    flex-shrink: 0;
    padding-left: 8px !important;
    cursor: pointer;
    font-size: 13px !important;
    background-color: #f8fafc !important;
}

/* Adjusting the mobile input width when paired with flag select */
.ucm-phone-split input[type="tel"] {
    flex-grow: 1;
}

/* --- Course Search Suggestions Dropdown --- */
.ucm-suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.ucm-course-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    transition: 0.2s;
}

.ucm-course-item:hover {
    background: #f0f9ff;
    color: #0369a1;
    padding-left: 20px;
}

/* --- Dynamic Claim Button --- */
.ucm-btn-claim {
    width: 100%;
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(3, 105, 161, 0.3);
}

.ucm-btn-claim:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(3, 105, 161, 0.4);
    background: linear-gradient(135deg, #075985 0%, #0369a1 100%);
}

.ucm-btn-claim:active {
    transform: translateY(0);
}

/* --- Reveal Step Styles --- */
.ucm-code-box {
    margin: 25px 0;
    border: 2px dashed #0369a1;
    background: #f0f9ff;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#ucm-final-code {
    font-size: 36px;
    font-weight: 900;
    color: #0369a1;
    letter-spacing: 4px;
    animation: ucmCodePulse 1.5s ease-in-out infinite;
}

@keyframes ucmCodePulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* --- Loading Spinner --- */
.ucm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ucmSpin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes ucmSpin {
    to {
        transform: rotate(360deg);
    }
}

#ucm-step-reveal {
    animation: ucmRevealZoom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ucmRevealZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.ucm-btn-copy {
    background: #0f172a;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.ucm-btn-copy.copied {
    background: #059669 !important;
}

.ucm-status-tag {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
}

/* --- Mobile Compatibility --- */
@media (max-width: 600px) {
    .ucm-modal-overlay {
        padding: 10px;
        align-items: flex-start;
        /* Better for tall forms on mobile */
    }

    .ucm-modal-content {
        padding: 0;
        /* Remove extra padding, respect sections */
        width: 100%;
        max-height: 95vh;
        border-radius: 20px;
    }

    .ucm-form-row {
        flex-direction: column;
        gap: 15px;
    }

    #ucm_country_code.ucm-flag-select {
        width: 95px !important;
    }
}

/* --- MSG91 OTP UI Enhancements --- */
#ucm_otp_input {
    letter-spacing: 8px;
    text-indent: 8px;
    font-family: 'Poppins', sans-serif;
    background: #ffffff;
}

#ucm-otp-section {
    animation: ucmFadeIn 0.3s ease-in;
}

@keyframes ucmFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#ucm-timer-count {
    font-weight: 800;
    color: #ff7a1a;
}

.ucm-secure-note {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 15px;
    text-align: center;
}

/* Force Flags to be visible */
#ucm_country_code.ucm-flag-select {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Poppins", sans-serif !important;
    width: 125px !important;
    /* Slightly wider to prevent text wrapping */
    font-size: 16px !important;
    /* Larger size makes flags easier to see */
    appearance: none;
    /* Removes default browser styling for a cleaner look */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

/* --- Floating Glowing Button --- */
.ucm-floating-coupon {
    position: fixed;
    right: 25px;
    top: 65%;
    transform: translateY(-50%);
    z-index: 99999;
    background: rgba(3, 105, 161, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(3, 105, 161, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ucm-floating-coupon:hover {
    background: #ff7a1a;
    transform: translateY(-50%) scale(1.15) rotate(5deg);
    box-shadow: 0 25px 50px rgba(255, 122, 26, 0.4);
}

.ucm-float-text {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    letter-spacing: 1px;
}

.ucm-glow-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50px;
    border: 2px solid #0369a1;
    animation: ucmPulseGlow 2s infinite;
}

@keyframes ucmPulseGlow {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* --- Mobile Bar Enhancements --- */
.ucm-mobile-coupon-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-mob-claim {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    animation: ucmPulseButton 2s infinite;
}

@keyframes ucmPulseButton {
    0% {
        box-shadow: 0 0 0 0 rgba(3, 105, 161, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(3, 105, 161, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(3, 105, 161, 0);
    }
}