/* 
 * OMG Wildfires V11 Homepage Styles
 * Based on fullscreen/v11/style.css
 * 
 * TODO: Future optimization - consider bundling external CDN dependencies locally
 * to reduce external dependencies and improve performance/reliability
 */

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
    background: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fullscreen Map */
#map {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Prominent Search Bar Container */
.search-bar-container {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    pointer-events: none;
}

.search-bar {
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    height: 48px;
    margin: 0 56px 0 56px; /* Space for hamburger and potential other controls */
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-bar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-content {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 100%;
}

.search-icon {
    color: #9aa0a6;
    margin-right: 12px;
    font-size: 20px;
}

.search-text {
    flex: 1;
    color: #333;
    font-size: 16px;
    font-weight: 400;
}

.info-icon {
    color: #9aa0a6;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.info-icon:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Hamburger Menu FAB */
.hamburger-fab {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: white;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hamburger-fab:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.hamburger-fab:active {
    transform: translateY(0);
}

.hamburger-fab .material-icons {
    font-size: 20px;
    color: #5f6368;
}

/* Base Layer Switcher Button */
.layer-switcher-fab {
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.layer-switcher-fab:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.layer-switcher-fab .switcher-icon {
    font-size: 24px;
    line-height: 1;
}

/* Left Slide-out Drawer */
.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.drawer.open {
    transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
    background: white;
    min-height: 72px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 28px;
    line-height: 1;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 30px;
    font-weight: 300;
    color: #202124;
    margin: 0;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 13px;
    color: #5f6368;
    margin: 0;
    line-height: 1.2;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.close-btn .material-icons {
    font-size: 20px;
    color: #5f6368;
}

/* Drawer Content */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 24px 0;
}

/* Social Sharing Section */
.social-sharing-section {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    background: white;
    color: #202124;
    border: 2px solid;
    transition: all 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

.social-btn.whatsapp {
    border-color: #084D44;
    color: #084D44;
}

.social-btn.whatsapp:hover {
    background: #084D44;
    color: white;
}

.social-btn.facebook {
    border-color: #1877F2;
    color: #1877F2;
}

.social-btn.facebook:hover {
    background: #1877F2;
    color: white;
}

.social-btn.twitter {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.social-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
}

.social-btn.linkedin {
    border-color: #0A66C2;
    color: #0A66C2;
}

.social-btn.linkedin:hover {
    background: #0A66C2;
    color: white;
}

/* Climate Statement */
.climate-statement {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
}

.climate-text {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #5f6368;
    text-align: left;
}

/* Section Titles */
.section-title {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    margin: 0 0 16px 0;
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Layer Controls Section */
.layer-controls-section {
    padding: 16px 0;
    border-bottom: 1px solid #e8eaed;
}

.layer-control {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.layer-control:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.layer-icon {
    font-size: 20px;
    line-height: 1;
    width: 24px;
    text-align: center;
}

.layer-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layer-name {
    font-size: 14px;
    font-weight: 400;
    color: #202124;
    line-height: 1.2;
}

.layer-description {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.2;
}

.layer-count {
    font-size: 12px;
    color: #5f6368;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Material Design Switches */
.material-switch {
    position: relative;
    width: 32px;
    height: 20px;
    margin: 0 8px;
}

.material-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.material-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #9aa0a6;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.material-switch label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.material-switch input:checked + label {
    background: #1a73e8;
}

.material-switch input:checked + label:before {
    transform: translateX(12px);
}

.material-switch:hover label {
    box-shadow: 0 0 0 8px rgba(26, 115, 232, 0.1);
}

/* About Section */
.about-section {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
}

.about-item {
    margin-bottom: 16px;
}

.about-item:last-child {
    margin-bottom: 0;
}

.about-item h3 {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.about-item p {
    font-size: 15px;
    color: #5f6368;
    line-height: 1.4;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
}

.faq-item {
    margin-bottom: 16px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.faq-item p {
    font-size: 15px;
    color: #5f6368;
    line-height: 1.4;
    margin: 0;
}

/* Twitter Section */
.twitter-section {
    padding: 16px;
}

.twitter-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.twitter-link:hover {
    background: #f1f3f4;
    text-decoration: none;
    color: #1557b0;
}

.twitter-link .material-icons {
    font-size: 18px;
}

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Info Modal */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.info-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8eaed;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #202124;
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.4;
    margin: 0 0 20px 0;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: white;
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.action-button.secondary {
    color: #5f6368;
    border-color: #dadce0;
}

.action-button .material-icons {
    font-size: 16px;
}

.action-button.twitter {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.action-button.twitter:hover {
    background: #1DA1F2;
    color: white;
}

.action-button.linkedin {
    border-color: #0A66C2;
    color: #0A66C2;
}

.action-button.linkedin:hover {
    background: #0A66C2;
    color: white;
}

.action-button.whatsapp {
    border-color: #084D44;
    color: #084D44;
}

.action-button.whatsapp:hover {
    background: #084D44;
    color: white;
}

/* Responsive Design */
@media (min-width: 768px) {
    .search-bar-container {
        left: 296px; /* 280px drawer + 16px padding */
        right: auto;
        width: 400px;
    }
    
    .search-bar {
        margin: 0;
    }
    
    .hamburger-fab {
        display: none;
    }
    
    .drawer {
        transform: translateX(0);
        position: fixed;
        box-shadow: none;
        border-right: 1px solid #e8eaed;
    }
    
    .drawer-overlay {
        display: none;
    }
    
    /* Hide close button on desktop since drawer should always be open */
    .close-btn {
        display: none;
    }
    
    #map {
        left: 280px;
        width: calc(100vw - 280px);
    }
    
    .layer-switcher-fab {
        right: 24px;
    }
}

@media (min-width: 1200px) {
    .search-bar-container {
        left: 336px; /* 320px drawer + 16px padding */
        width: 500px;
    }
    
    .drawer {
        width: 320px;
    }
    
    #map {
        left: 320px;
        width: calc(100vw - 320px);
    }
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
    .search-bar {
        height: 44px;
        margin: 0 48px 0 48px;
    }
    
    .hamburger-fab {
        width: 36px;
        height: 36px;
        border-radius: 18px;
    }
    
    .hamburger-fab .material-icons {
        font-size: 18px;
    }
    
    .layer-switcher-fab {
        bottom: 20px;
        right: 12px;
        width: 44px;
        height: 44px;
        border-radius: 22px;
    }
    
    .layer-switcher-fab .switcher-icon {
        font-size: 22px;
    }
    
    .drawer {
        width: 280px;
    }
}

/* Accessibility */
.hamburger-fab:focus,
.layer-switcher-fab:focus,
.close-btn:focus,
.action-button:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .drawer,
    .drawer-overlay,
    .info-modal,
    .hamburger-fab,
    .layer-switcher-fab,
    .material-switch label,
    .material-switch label:before {
        transition: none;
    }
}

/* Feature Popup Styles */
.ol-popup {
    position: absolute;
    background-color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 0;
    bottom: 12px;
    left: -50px;
    min-width: 280px;
    max-width: 320px;
}

.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.ol-popup:after {
    border-color: rgba(255, 255, 255, 0);
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}

.ol-popup:before {
    border-color: rgba(224, 224, 224, 0);
    border-top-color: #e0e0e0;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 8px;
    right: 12px;
    color: #999;
    font-size: 20px;
    line-height: 1;
    z-index: 1;
    transition: color 0.2s ease;
}

.ol-popup-closer:after {
    content: "✕";
}

.ol-popup-closer:hover {
    color: #666;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 12px 12px 0 0;
}

.popup-icon {
    font-size: 24px;
    line-height: 1;
}

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

.popup-details {
    padding: 12px 16px 16px;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.popup-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popup-row .label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.popup-row .value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-align: right;
}

/* Mobile popup adjustments */
@media (max-width: 768px) {
    .ol-popup {
        min-width: 260px;
        max-width: 280px;
        left: -130px;
    }
    
    .ol-popup:after {
        left: 138px;
    }
    
    .ol-popup:before {
        left: 138px;
    }
    
    .popup-header h3 {
        font-size: 16px;
    }
    
    .popup-row .label,
    .popup-row .value {
        font-size: 13px;
    }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.loading-content p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
}

.loading-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    min-width: 35px;
}

/* Mobile loading adjustments */
@media (max-width: 768px) {
    .loading-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .loading-content h3 {
        font-size: 18px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 16px;
    }
}

/* Error Notification Styles */
.error-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    overflow: hidden;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.error-content {
    padding: 16px 20px;
}

.error-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.error-icon {
    font-size: 20px;
    margin-right: 8px;
}

.error-header h4 {
    color: #dc3545;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.error-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.error-close:hover {
    color: #333;
}

.error-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.retry-btn:hover {
    background: #c82333;
}

/* Mobile error notification adjustments */
@media (max-width: 768px) {
    .error-notification {
        top: 70px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    
    .error-content {
        padding: 14px 16px;
    }
    
    .error-header h4 {
        font-size: 15px;
    }
    
    .error-content p {
        font-size: 13px;
    }
} 