/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Container */
.popup-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(48, 156, 206, 0.3);
    border: 1px solid rgba(48, 156, 206, 0.1);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-close:hover {
    background: #309CCE;
    color: white;
    transform: rotate(90deg);
}

/* Popup Image */
.popup-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Popup Body */
.popup-body {
    padding: 25px;
}

.popup-title {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.popup-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Offer Details */
.offer-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #309CCE;
}

.offer-code-box, .validity-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.offer-code-box:last-child, .validity-box:last-child {
    margin-bottom: 0;
}

.offer-code-box i, .validity-box i {
    color: #309CCE;
    font-size: 18px;
    width: 24px;
}

.offer-label, .validity-label {
    display: block;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.offer-code-value {
    color: #2c3e50;
    font-weight: 700;
    font-size: 16px;
    background: white;
    padding: 4px 12px;
    border-radius: 6px;
    border: 2px dashed #309CCE;
    display: inline-block;
}

.validity-date {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
}

/* Popup Footer */
.popup-footer {
    padding: 20px 25px 25px;
    border-top: 1px solid rgba(48, 156, 206, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dont-show-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dont-show-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #309CCE;
}

.dont-show-option label {
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dont-show-option label i {
    font-size: 12px;
}

.popup-button {
    background: linear-gradient(135deg, #309CCE 0%, #1a7bb9 100%);
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-align: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 4px 15px rgba(48, 156, 206, 0.3);
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 156, 206, 0.4);
    color: white;
    text-decoration: none;
}

.popup-button:active {
    transform: translateY(0);
}

/* Popup Dots */
.popup-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px 0 20px;
}

.popup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-dot.active {
    background: #309CCE;
    transform: scale(1.2);
}

.popup-dot:hover {
    background: #1a7bb9;
}

/* Responsive Design */
@media (max-width: 576px) {
    .popup-container {
        max-width: 95%;
    }
    
    .popup-image {
        height: 160px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 1.3rem;
    }
    
    .popup-footer {
        padding: 15px 20px 20px;
    }
    
    .popup-button {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .popup-container {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }
    
    .popup-title {
        color: #e2e8f0;
    }
    
    .popup-description {
        color: #a0aec0;
    }
    
    .offer-details {
        background: #2d3748;
        border-left-color: #309CCE;
    }
    
    .offer-label, .validity-label {
        color: #a0aec0;
    }
    
    .offer-code-value {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #309CCE;
    }
    
    .validity-date {
        color: #e2e8f0;
    }
    
    .dont-show-option label {
        color: #a0aec0;
    }
    
    .popup-close {
        background: #4a5568;
        color: #e2e8f0;
    }
}

/* Animation for multiple popups */
@keyframes fadeSlide {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.popup-content {
    animation: fadeSlide 0.4s ease-out;
}

/* Loading animation */
.popup-container.loading {
    position: relative;
}

.popup-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* For your existing theme compatibility */
.btnsrch, .filled_btn_m {
    /* Match your existing button styles */
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
}

.greentxt {
    color: #309CCE;
}

/* Custom scrollbar for popup */
.popup-container::-webkit-scrollbar {
    width: 6px;
}

.popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-container::-webkit-scrollbar-thumb {
    background: #309CCE;
    border-radius: 10px;
}

.popup-container::-webkit-scrollbar-thumb:hover {
    background: #1a7bb9;
}