/*
Theme Name: Mapbox Fullscreen
Description: A minimal theme designed to display full-screen maps using the Mapbox Pins plugin. No header, no footer, just maps.
Version: 1.0.0
Author: Your Name
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mapbox-fullscreen
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #f8f9fa;
    overflow: hidden; /* Prevent scrollbars */
}

body {
    margin: 0;
    padding: 0;
}

/* Main container */
.fullscreen-map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #f8f9fa;
}

/* Map styles */
.mapbox-pins-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

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

/* Error message */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dc3545;
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 1001;
}

/* Hide WordPress admin bar if present */
html {
    margin-top: 0 !important;
}

body.admin-bar {
    margin-top: 0 !important;
}

#wpadminbar {
    display: none !important;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .loading-text {
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .error-message {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Ensure map controls are accessible */
.mapboxgl-ctrl-group button {
    background: white !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
}

.mapboxgl-ctrl-group button:hover {
    background: #f0f0f0 !important;
}

.mapboxgl-ctrl-group button:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 1px !important;
}

/* Custom popup styles for fullscreen */
.mapboxgl-popup-content {
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .mapboxgl-popup-content {
        max-width: 95vw !important;
        font-size: 14px !important;
    }
    
    .mapbox-pin-modal {
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: 5px !important;
    }
}
