/* Enhanced Map & Location System */
/* Version: 2.0 - Contemporary Redesign Map System */

/* ===== ENHANCED MAP SECTION ===== */

.map-section-enhanced {
    background: linear-gradient(135deg, var(--color-porcelain) 0%, var(--color-white) 100%);
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
}

.map-section-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e5e7eb" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
    pointer-events: none;
}

.map-header-enhanced {
    text-align: center;
    margin-bottom: var(--space-12);
    position: relative;
    z-index: 2;
}

.map-title-enhanced {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-navy);
    margin: 0 0 var(--space-4) 0;
    line-height: 1.2;
}

.map-subtitle-enhanced {
    font-size: var(--text-lg);
    color: var(--color-slate);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== ENHANCED MAP CONTAINER ===== */

.map-container-enhanced {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    height: 500px;
    margin-bottom: var(--space-12);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-ash);
}

.map-container-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-ash) 0%, var(--color-pewter) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-slate);
    font-size: var(--text-xl);
    font-weight: 500;
}

.map-container-enhanced.loaded::before {
    display: none;
}

/* ===== ENHANCED LOCATION PERMISSION ===== */

.location-permission-enhanced {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: var(--space-12);
    border: 2px solid var(--color-ash);
    transition: all var(--transition-normal);
}

.location-permission-enhanced:hover {
    border-color: var(--color-teal);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.permission-content-enhanced {
    max-width: 500px;
    margin: 0 auto;
}

.permission-title-enhanced {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-navy);
    margin: 0 0 var(--space-4) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.permission-description-enhanced {
    font-size: var(--text-base);
    color: var(--color-slate);
    line-height: 1.7;
    margin: 0 0 var(--space-6) 0;
}

.permission-button-enhanced {
    background: var(--color-teal);
    color: var(--color-white);
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-pill);
    font-family: var(--font-family);
    font-size: var(--text-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    min-height: 56px;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.permission-button-enhanced:hover {
    background: var(--color-navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.permission-button-enhanced:active {
    transform: translateY(0);
}

.permission-button-enhanced:disabled {
    background: var(--color-ash);
    color: var(--color-slate);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.permission-note-enhanced {
    font-size: var(--text-sm);
    color: var(--color-gray-new);
    margin: var(--space-4) 0 0 0;
    font-style: italic;
}

/* ===== ENHANCED NEARBY CLOCKS ===== */

.nearby-clocks-enhanced {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-12);
    border: 1px solid var(--color-ash);
}

.nearby-clocks-enhanced.hidden {
    display: none;
}

.nearby-clocks-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-navy);
    margin: 0 0 var(--space-6) 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.nearby-clocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

/* ===== MAP CONTROLS ===== */

.map-controls {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 10;
}

.map-control-button {
    background: var(--color-white);
    color: var(--color-navy);
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    font-size: var(--text-lg);
}

.map-control-button:hover {
    background: var(--color-navy);
    color: var(--color-white);
    border-color: var(--color-navy);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.map-control-button.active {
    background: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}



/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .map-section-enhanced {
        padding: var(--space-12) 0;
    }
    
    .map-title-enhanced {
        font-size: var(--text-3xl);
    }
    
    .map-container-enhanced {
        height: 400px;
        margin-bottom: var(--space-8);
    }
    
    .location-permission-enhanced {
        padding: var(--space-6);
        margin-bottom: var(--space-8);
    }
    
    .permission-title-enhanced {
        font-size: var(--text-xl);
    }
    
    .nearby-clocks-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .map-controls {
        top: var(--space-2);
        right: var(--space-2);
    }
    

}

@media (min-width: 1200px) {
    .map-container-enhanced {
        height: 600px;
    }
    
    .nearby-clocks-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ===== ANIMATION UTILITIES ===== */

@keyframes mapFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-section-enhanced {
    animation: mapFadeIn 0.8s ease-out;
}

.location-permission-enhanced {
    animation: mapFadeIn 0.8s ease-out 0.2s both;
}

.nearby-clocks-enhanced {
    animation: mapFadeIn 0.8s ease-out 0.4s both;
}

/* ===== INTERACTIVE STATES ===== */

.map-container-enhanced:focus-within {
    outline: 3px solid var(--color-navy);
    outline-offset: 2px;
}

.location-permission-enhanced:focus-within {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

@media (prefers-reduced-motion: reduce) {
    .map-section-enhanced,
    .location-permission-enhanced,
    .nearby-clocks-enhanced {
        animation: none;
    }
    
    .permission-button-enhanced:hover,
    .map-control-button:hover {
        transform: none;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .map-section-enhanced {
        background: var(--color-white);
        padding: var(--space-8) 0;
    }
    
    .map-container-enhanced {
        height: 300px;
        box-shadow: none;
        border: 1px solid var(--color-ash);
    }
    
    .map-controls,
    .map-legend {
        display: none;
    }
}

/* ==========================================================================
   CSS Overrides to Ensure New Map System Styles Take Precedence
   ========================================================================== */

/* Force new map system styles to override old styles */
.map-section-enhanced {
    padding: var(--space-12) 0 !important;
    background: var(--color-background) !important;
}

.map-container-enhanced {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 var(--space-6) !important;
}

.map-controls {
    display: flex !important;
    gap: var(--space-4) !important;
    margin-bottom: var(--space-6) !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.map-controls button {
    padding: var(--space-3) var(--space-4) !important;
    background: var(--color-white) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    transition: all var(--transition-normal) !important;
    font-weight: 500 !important;
}

.map-controls button:hover {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border-color: var(--color-primary) !important;
}

.map-controls button.active {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border-color: var(--color-primary) !important;
}

.location-permission-enhanced {
    text-align: center !important;
    padding: var(--space-8) !important;
    background: var(--color-white) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: var(--space-6) !important;
}

.location-permission-enhanced h3 {
    font-size: var(--text-xl) !important;
    font-weight: 600 !important;
    color: var(--color-primary) !important;
    margin-bottom: var(--space-3) !important;
}

.location-permission-enhanced p {
    color: var(--color-text) !important;
    margin-bottom: var(--space-4) !important;
    line-height: 1.6 !important;
}

.location-permission-enhanced button {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: var(--space-3) var(--space-6) !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: all var(--transition-normal) !important;
}

.location-permission-enhanced button:hover {
    background: var(--color-primary-dark) !important;
    transform: translateY(-1px) !important;
}

.nearby-clocks-section-enhanced {
    margin-top: var(--space-8) !important;
}

.nearby-clocks-section-enhanced h3 {
    font-size: var(--text-xl) !important;
    font-weight: 600 !important;
    color: var(--color-primary) !important;
    margin-bottom: var(--space-4) !important;
    text-align: center !important;
}

/* Responsive overrides */
@media (max-width: 768px) {
    .map-section-enhanced {
        padding: var(--space-8) 0 !important;
    }
    
    .map-container-enhanced {
        padding: 0 var(--space-4) !important;
    }
    
    .map-controls {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .map-controls button {
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .location-permission-enhanced {
        padding: var(--space-6) !important;
        margin: 0 var(--space-4) var(--space-6) var(--space-4) !important;
    }
}