/**
 * Elementor Geo Popup - Geo Widget Styles
 *
 * @package ElementorGeoPopup
 * @since 1.0.0
 */

/* Geo Widget Content Styling */
.egp-geo-content {
    position: relative;
    width: 100%;
}

.egp-geo-content.egp-alternative-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
}

/* Template Placeholder Styling */
.egp-template-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-style: italic;
}

.egp-template-placeholder i {
    margin-right: 10px;
    font-size: 24px;
    color: #0073aa;
}

/* Debug Information Styling */
.egp-debug-info {
    background: #f0f0f0;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
}

.egp-debug-info strong {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .egp-geo-content {
        padding: 10px;
    }

    .egp-template-placeholder {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }

    .egp-template-placeholder i {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Animation for content transitions */
.egp-geo-content {
    transition: opacity 0.3s ease-in-out;
}

.egp-geo-content.fade-in {
    opacity: 1;
}

.egp-geo-content.fade-out {
    opacity: 0;
}

/* Loading state */
.egp-geo-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

.egp-geo-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: egp-spin 1s linear infinite;
}

@keyframes egp-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error state */
.egp-geo-content.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success state */
.egp-geo-content.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Country-specific styling (optional enhancement) */
.egp-geo-content[data-country="US"] {
    border-left: 3px solid #0073aa;
}

.egp-geo-content[data-country="CA"] {
    border-left: 3px solid #dc3545;
}

.egp-geo-content[data-country="GB"] {
    border-left: 3px solid #28a745;
}

/* Print styles */
@media print {

    .egp-debug-info,
    .egp-template-placeholder {
        display: none;
    }

    .egp-geo-content {
        border: none;
        background: none;
    }
}

/* Geo Widget CSS - Popup System Styles */

/* Popup Container */
.egp-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.egp-popup-container.egp-popup-active {
    display: block;
}

/* Popup Overlay */
.egp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

/* Popup Content */
.egp-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.egp-popup.egp-popup-active {
    opacity: 1;
    visibility: visible;
}

/* Popup Header */
.egp-popup-header {
    padding: 20px 20px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.egp-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.egp-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: #999;
    transition: color 0.2s ease;
}

.egp-popup-close:hover {
    color: #333;
}

.egp-popup-close::before {
    content: '×';
    display: block;
    line-height: 1;
}

/* Popup Body */
.egp-popup-body {
    padding: 20px;
}

/* Popup Footer */
.egp-popup-footer {
    padding: 0 20px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Popup Buttons */
.egp-popup-btn {
    display: inline-block;
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.egp-popup-btn-primary {
    background: #0073aa;
    color: #fff;
}

.egp-popup-btn-primary:hover {
    background: #005a87;
}

.egp-popup-btn-secondary {
    background: #f1f1f1;
    color: #333;
}

.egp-popup-btn-secondary:hover {
    background: #e1e1e1;
}

/* Body state when popup is open */
body.egp-popup-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .egp-popup {
        width: 95vw;
        margin: 20px;
        top: 20px;
        left: 20px;
        transform: none;
    }
    
    .egp-popup-header,
    .egp-popup-body,
    .egp-popup-footer {
        padding: 15px;
    }
}

/* Animation Classes */
.egp-popup-fade-in {
    animation: egpFadeIn 0.3s ease;
}

.egp-popup-fade-out {
    animation: egpFadeOut 0.3s ease;
}

@keyframes egpFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes egpFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}