/**
 * Interactive Map Styles
 * Phase 13: Documentation Module - Batch 8
 */

/* ========== Variables ========== */
:root {
    --map-spacing: clamp(1rem, 2vw, 1.5rem);
}

/* ========== Main Container ========== */
.interactive-map {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 120px);
    animation: fadeIn 0.3s ease-out;
    overflow: hidden;
}

/* ========== Header ========== */
.map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--map-spacing);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.map-header-left h2 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-primary);
}

.map-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.map-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.map-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ========== Map Container ========== */
.map-container {
    flex: 1;
    position: relative;
    overflow: auto;
    min-height: 400px;
    max-height: calc(100vh - 200px);
    background: var(--surface);
    cursor: grab;
    touch-action: pan-x pan-y pinch-zoom;
}

.map-container:active {
    cursor: grabbing;
}

#map-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ========== Info Panel ========== */
.map-info-panel {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: min(350px, 90vw);
    max-height: 80vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.info-panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.info-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: color 0.2s ease;
}

.info-panel-close:hover {
    color: var(--text-primary);
}

.info-panel-content {
    padding: var(--spacing-md);
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.info-detail {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 100px;
}

.info-value {
    color: var(--text-primary);
}

.info-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.info-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.info-connections {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

/* ========== Legend ========== */
.map-legend {
    position: absolute;
    bottom: var(--spacing-md);
    left: var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    animation: slideInLeft 0.3s ease-out;
}

.map-legend h4 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* ========== Mobile Adaptivity ========== */
@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
    }
    
    .map-info-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 12px 12px 0 0;
    }
    
    .map-legend {
        bottom: auto;
        top: var(--spacing-md);
        left: var(--spacing-md);
        right: var(--spacing-md);
        width: auto;
    }
}

@media (max-width: 480px) {
    .map-header-left h2 {
        font-size: 1.25rem;
    }
    
    .map-controls .btn {
        min-width: 36px;
        min-height: 36px;
        padding: var(--spacing-xs);
    }
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

