/* WP TargetWise Frontend Styles */

/* Trigger content wrapper - invisible, doesn't affect layout */
.wptw-trigger-content {
    display: contents;
}

/* Geo content wrapper - invisible, doesn't affect layout */
.wptw-geo-content {
    display: contents;
}

/* Popup styles */
.wptw-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wptw-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.wptw-popup-content {
    position: relative;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: wptwPopupIn 0.3s ease;
}

@keyframes wptwPopupIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wptw-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.wptw-popup-close:hover {
    color: #000;
}

/* AJAX loading state */
.wptw-ajax-loading {
    opacity: 0.5;
    pointer-events: none;
}

.wptw-ajax-placeholder {
    min-height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: wptwShimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes wptwShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive popup */
@media screen and (max-width: 600px) {
    .wptw-popup-content {
        margin: 20px;
        padding: 20px;
        max-width: calc(100% - 40px) !important;
    }
}

/* Countdown Timer Styles */
.wptw-countdown {
    display: inline-flex;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wptw-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.wptw-countdown-value {
    font-size: 2em;
    font-weight: bold;
    line-height: 1;
    color: #333;
}

.wptw-countdown-label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: #666;
    margin-top: 5px;
}

/* Dark style */
.wptw-countdown-dark .wptw-countdown-item {
    background: #333;
}

.wptw-countdown-dark .wptw-countdown-value {
    color: #fff;
}

.wptw-countdown-dark .wptw-countdown-label {
    color: #aaa;
}

/* Minimal style */
.wptw-countdown-minimal .wptw-countdown-item {
    background: transparent;
    padding: 5px;
    min-width: auto;
}

.wptw-countdown-minimal .wptw-countdown-value {
    font-size: 1.5em;
}

/* Compact format */
.wptw-countdown-compact {
    font-size: 1.5em;
    font-weight: bold;
    font-family: monospace;
}

/* Minimal format */
.wptw-countdown-minimal {
    font-size: 1.2em;
    font-weight: bold;
    font-family: monospace;
}

/* Expired state */
.wptw-countdown-expired {
    color: #999;
    font-style: italic;
}

/* Redirect message */
.wptw-redirect-message {
    padding: 20px;
    text-align: center;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    margin: 20px 0;
}

/* Location selector widget */
.wptw-location-selector {
    display: inline-block;
    position: relative;
}

.wptw-location-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.wptw-location-selector select:focus {
    outline: none;
    border-color: #0073aa;
}

.wptw-location-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Location selector buttons */
.wptw-location-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wptw-location-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.wptw-location-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Location selector flags */
.wptw-location-flag {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
}

.wptw-location-flag:hover {
    background: #e0e0e0;
}

.wptw-location-flag.active {
    border-color: #0073aa;
    background: #e7f3ff;
}

/* Location info display */
.wptw-location-value {
    font-weight: 500;
}

.wptw-location-change {
    font-size: 0.9em;
    color: #0073aa;
    text-decoration: underline;
    margin-left: 5px;
}

.wptw-manual-location {
    display: inline-block;
    padding: 2px 8px;
    background: #fff8e5;
    border: 1px solid #f0c36d;
    border-radius: 3px;
}

.wptw-manual-location::after {
    content: ' (manual)';
    font-size: 0.8em;
    color: #856404;
}

/* Mobile responsive countdown */
@media screen and (max-width: 480px) {
    .wptw-countdown {
        gap: 5px;
    }

    .wptw-countdown-item {
        min-width: 50px;
        padding: 8px;
    }

    .wptw-countdown-value {
        font-size: 1.5em;
    }

    .wptw-countdown-label {
        font-size: 0.65em;
    }
}
