/**
 * Ad Unlock Modal Styles
 * Mobile-first responsive design
 */

/* Modal Overlay */
.aiodl-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    animation: aiodl-fade-in 0.3s ease-out;
}

@keyframes aiodl-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.aiodl-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: aiodl-slide-up 0.3s ease-out;
}

@keyframes aiodl-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.aiodl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.aiodl-ad-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aiodl-ad-label svg {
    color: #ffc107;
}

.aiodl-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.aiodl-modal-close:hover {
    color: #343a40;
}

/* Modal Body - Ad Container */
.aiodl-modal-body {
    padding: 0;
    background: #f8f9fa;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiodl-ad-container {
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Placeholder Ad (when no ad script) */
.aiodl-ad-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.aiodl-ad-placeholder-icon {
    margin-bottom: 16px;
}

.aiodl-ad-placeholder p {
    margin: 0 0 8px;
    font-size: 16px;
}

.aiodl-ad-placeholder small {
    font-size: 12px;
    opacity: 0.7;
}

/* Modal Footer */
.aiodl-modal-footer {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Countdown */
.aiodl-countdown {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.aiodl-countdown-label {
    font-size: 13px;
    color: #6c757d;
}

.aiodl-countdown-timer {
    font-size: 28px;
    font-weight: 700;
    color: #343a40;
    min-width: 40px;
    text-align: center;
}

.aiodl-countdown-seconds {
    font-size: 13px;
    color: #6c757d;
}

/* Skip Button */
.aiodl-skip-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.aiodl-skip-btn:hover {
    background: #5a6268;
}

.aiodl-skip-btn:active {
    transform: scale(0.98);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aiodl-modal-content {
        background: #2d3436;
    }

    .aiodl-modal-header {
        background: #1e272e;
        border-bottom-color: #3d4852;
    }

    .aiodl-ad-label {
        color: #a0a0a0;
    }

    .aiodl-modal-close {
        color: #a0a0a0;
    }

    .aiodl-modal-close:hover {
        color: #fff;
    }

    .aiodl-modal-body {
        background: #1e272e;
    }

    .aiodl-ad-placeholder {
        color: #a0a0a0;
    }

    .aiodl-modal-footer {
        background: #2d3436;
        border-top-color: #3d4852;
    }

    .aiodl-countdown-label,
    .aiodl-countdown-seconds {
        color: #a0a0a0;
    }

    .aiodl-countdown-timer {
        color: #fff;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .aiodl-modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 8px;
    }

    .aiodl-modal-header {
        padding: 10px 12px;
    }

    .aiodl-ad-label {
        font-size: 11px;
    }

    .aiodl-modal-body {
        min-height: 200px;
    }

    .aiodl-ad-container {
        min-height: 200px;
    }

    .aiodl-modal-footer {
        padding: 12px;
        flex-direction: column;
        gap: 12px;
    }

    .aiodl-countdown {
        width: 100%;
        justify-content: center;
    }

    .aiodl-countdown-timer {
        font-size: 24px;
    }

    .aiodl-skip-btn {
        width: 100%;
        padding: 12px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .aiodl-modal-content {
        max-height: 95vh;
        flex-direction: row;
    }

    .aiodl-modal-header {
        width: 100%;
        order: -1;
    }

    .aiodl-modal-body {
        flex: 1;
        min-height: 150px;
    }

    .aiodl-ad-container {
        min-height: 150px;
    }

    .aiodl-modal-footer {
        width: 120px;
        flex-direction: column;
        justify-content: center;
    }
}

/* Loading Animation */
.aiodl-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: aiodl-spin 1s linear infinite;
}

@keyframes aiodl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.aiodl-modal:focus {
    outline: none;
}

.aiodl-skip-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .aiodl-modal,
    .aiodl-modal-content {
        animation: none;
    }

    .aiodl-skip-btn:active {
        transform: none;
    }
}
