/* ========================================
 * TIGSI AD POPUP - MODERN DESIGN
 * ========================================
 */

#adPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#adPopup .modal-container {
    width: 100%;
    max-width: 650px;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    animation: slideUp 0.4s ease;
    transform-origin: center;
}

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

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

#adPopup .modal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #6dc6d4 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

#adPopup .modal-header > span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#adPopup .modal-header > span i {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

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

#adPopup .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #6dc6d4, #667eea);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

#adPopup .modal-header button {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#adPopup .modal-header button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

#adPopup .modal-header button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#adPopup .modal-body {
    padding: 2rem 1.5rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fb 100%);
    overflow-y: auto;
    max-height: 60vh;
}

#adPopup .modal-body::-webkit-scrollbar {
    width: 8px;
}

#adPopup .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#adPopup .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #6dc6d4 100%);
    border-radius: 10px;
}

#adPopup .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #5ab0bd 100%);
}

#adPopup .modal-body img,
#adPopup .modal-body video {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

#adPopup .modal-body img:hover {
    transform: scale(1.02);
}

#adPopup .modal-footer {
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Description */
#adPopup .modal-body .ad-description {
    font-size: 1rem;
    color: #2d3748;
    line-height: 1.7;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-align: center;
}

#adPopup .modal-body .ad-description ul {
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: left;
}

#adPopup .modal-body .ad-description li {
    margin-bottom: 0.5rem;
    position: relative;
}

#adPopup .modal-body .ad-description li::marker {
    color: #667eea;
}

#adPopup .modal-body .ad-description strong {
    font-weight: 700;
    color: #667eea;
}

#adPopup .modal-body .ad-description em {
    font-style: italic;
    color: #6dc6d4;
}

/* CTA button */
#adPopup .ad-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #6dc6d4 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

#adPopup .ad-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #5ab0bd 100%);
}

#adPopup .ad-action-btn:active {
    transform: translateY(0);
}

/* Footer countdown text */
#countdownText {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#countdownText::before {
    content: '⏱️';
    font-size: 1.1rem;
}

/* Countdown bar */
#adPopup .countdown-bar {
    height: 8px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#adPopup .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #6dc6d4, #667eea);
    background-size: 200% 100%;
    width: 0%;
    transition: width 1s linear;
    animation: progressShimmer 2s infinite;
    border-radius: 10px;
}

@keyframes progressShimmer {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Bouton de fermeture (footer) */
#closeAdButton {
    background: linear-gradient(135deg, #667eea 0%, #6dc6d4 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

#closeAdButton i {
    font-size: 1.1rem;
}

#closeAdButton:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #5ab0bd 100%);
}

#closeAdButton:active:not(:disabled) {
    transform: translateY(0);
}

#closeAdButton:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    #adPopup {
        padding: 0.5rem;
    }

    #adPopup .modal-container {
        max-width: 100%;
        border-radius: 16px;
    }

    #adPopup .modal-header {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    #adPopup .modal-header button {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    #adPopup .modal-body {
        padding: 1.5rem 1.25rem;
        max-height: 65vh;
    }

    #adPopup .modal-body .ad-description {
        font-size: 0.95rem;
    }

    #adPopup .ad-action-btn,
    #closeAdButton {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    #adPopup .modal-footer {
        padding: 1rem 1.25rem;
    }

    #countdownText {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    #adPopup .modal-header {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    #adPopup .modal-body {
        padding: 1.25rem 1rem;
    }

    #adPopup .modal-body .ad-description {
        font-size: 0.9rem;
    }

    #adPopup .ad-action-btn,
    #closeAdButton {
        font-size: 0.85rem;
        padding: 0.7rem 1.25rem;
    }
}
