/**
 * Advertisement Modal Styles
 * Pop-up modal untuk menampilkan iklan
 */

/* Modal Overlay */
.ad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.ad-modal-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: modalEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.ad-modal-overlay.show .ad-modal-container {
    transform: scale(1);
    opacity: 1;
}

@keyframes modalEnter {
    0% {
        transform: scale(0.7) translateY(50px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.ad-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ad-modal-close:hover {
    background: white;
    border-color: #dc2626;
    transform: rotate(90deg) scale(1.1);
}

.ad-modal-close i {
    font-size: 24px;
    color: #dc2626;
    transition: color 0.3s ease;
}

/* Modal Content */
.ad-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.ad-modal-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
}

.ad-modal-clickable {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ad-modal-clickable:hover {
    transform: scale(1.02);
}

/* Ad Info Footer */
.ad-modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    text-align: center;
}

.ad-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.ad-modal-description {
    font-size: 1rem;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Don't Show Again */
.ad-modal-dont-show {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.ad-modal-dont-show:hover {
    background: white;
    transform: translateX(-5px);
}

.ad-modal-dont-show input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Loading State */
.ad-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.ad-modal-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .ad-modal-container {
        max-width: 95%;
        border-radius: 16px;
    }

    .ad-modal-title {
        font-size: 1.25rem;
    }

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

    .ad-modal-close {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
    }

    .ad-modal-close i {
        font-size: 20px;
    }
}

@media (max-width: 767.98px) {
    .ad-modal-container {
        max-width: 98%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .ad-modal-footer {
        padding: 16px;
    }

    .ad-modal-title {
        font-size: 1.1rem;
    }

    .ad-modal-description {
        font-size: 0.85rem;
    }

    .ad-modal-dont-show {
        bottom: 16px;
        left: 16px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .ad-modal-image {
        max-height: 80vh;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .ad-modal-overlay,
    .ad-modal-container,
    .ad-modal-close,
    .ad-modal-clickable {
        transition: none !important;
        animation: none !important;
    }
}

/* Print - Hide modal */
@media print {
    .ad-modal-overlay {
        display: none !important;
    }
}
