/**
 * TalentTrack Google Maps Widget Styles
 * Enhanced styling for job search map widget with improved editor mode experience
 * 
 * @group TalentTrack Maps
 * Last Updated: 2025-01-16
 */

/* Map Container Styles */
.job-search-map-widget {
    position: relative;
    width: 100%;
}

.job-search-map-container {
    width: 100%;
    min-height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.job-search-map-container:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

/* Loading States */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Area Loading Indicator */
.map-area-loading {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    backdrop-filter: blur(10px);
}

/* Error States */
.map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    text-align: center;
    max-width: 300px;
    backdrop-filter: blur(10px);
}

.map-error p {
    margin: 0;
    color: #d32f2f;
    font-weight: 500;
}

/* Load More Button */
.map-load-more-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.map-load-more-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.map-load-more-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
    transform: translateY(-2px);
}

.map-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Popup Styles */
.job-popup-content {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.job-popup-content .job-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.job-popup-content .job-company {
    margin: 0 0 8px 0;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.job-popup-content .job-location,
.job-popup-content .job-salary {
    margin: 0 0 8px 0;
    color: #888;
    font-size: 13px;
    line-height: 1.4;
}

.job-popup-content .job-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.job-popup-content .view-details-button,
.job-popup-content .apply-button {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}

.job-popup-content .view-details-button {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.job-popup-content .view-details-button:hover {
    background: #0073aa;
    color: white;
    transform: translateY(-1px);
}

.job-popup-content .apply-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: 1px solid #0073aa;
}

.job-popup-content .apply-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Carousel Popup Styles */
.carousel-popup {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.carousel-popup .carousel-indicators {
    position: relative;
    display: flex;
    gap: 5px;
    margin-top: 1rem;
}

.carousel-popup .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-popup .carousel-indicators button.active {
    background: #0073aa;
    transform: scale(1.2);
}

.carousel-popup .carousel-control-prev,
.carousel-popup .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-popup .carousel-control-prev {
    left: 10px;
}

.carousel-popup .carousel-control-next {
    right: 10px;
}

.carousel-popup .carousel-control-prev:hover,
.carousel-popup .carousel-control-next:hover {
    background: #0073aa;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

/* Editor Mode Enhancements */
.elementor-editor-active .job-search-map-widget {
    position: relative;
}

.elementor-editor-active .map-preview-placeholder {
    position: relative;
    overflow: hidden;
}

.elementor-editor-active .map-preview-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.elementor-editor-active .job-popup-preview {
    position: relative;
    transition: all 0.3s ease;
}

.elementor-editor-active .job-popup-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.elementor-editor-active .advanced-settings-summary {
    transition: all 0.3s ease;
}

.elementor-editor-active .advanced-settings-summary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .job-popup-content .job-actions {
        flex-direction: column;
    }
    
    .job-popup-content .view-details-button,
    .job-popup-content .apply-button {
        width: 100%;
        min-width: auto;
    }
    
    .map-load-more-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .map-area-loading {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .job-popup-content {
        padding: 12px !important;
    }
    
    .job-popup-content .job-title {
        font-size: 15px;
    }
    
    .job-popup-content .job-company {
        font-size: 13px;
    }
    
    .job-popup-content .job-location,
    .job-popup-content .job-salary {
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .job-popup-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .job-popup-content .job-title {
        color: #f7fafc;
    }
    
    .job-popup-content .job-company {
        color: #cbd5e0;
    }
    
    .job-popup-content .job-location,
    .job-popup-content .job-salary {
        color: #a0aec0;
    }
    
    .map-loading,
    .map-error,
    .map-area-loading {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
}

/* Accessibility Improvements */
.job-popup-content .apply-button:focus,
.job-popup-content .view-details-button:focus,
.map-load-more-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.job-popup-content .apply-button:focus-visible,
.job-popup-content .view-details-button:focus-visible,
.map-load-more-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .job-popup-content {
        border: 2px solid #000;
    }
    
    .job-popup-content .apply-button {
        border: 2px solid #000;
    }
    
    .job-popup-content .view-details-button {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .job-search-map-container {
        display: none;
    }
    
    .map-loading,
    .map-error,
    .map-area-loading,
    .map-load-more-container {
        display: none;
    }
} 