/* ===== VISUAL TRAIL MAP OVERLAY ===== */

.visual-map-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.visual-map-modal {
    background: #3d2817;
    border: 4px solid #6b4423;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 100px rgba(139, 105, 20, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.visual-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(180deg, #4d3420 0%, #3d2817 100%);
    border-bottom: 2px solid #6b4423;
}

.visual-map-header h2 {
    color: #ffd700;
    font-family: 'Cinzel', 'Courier New', monospace;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.visual-map-subtitle {
    color: #b8a88a;
    font-size: 0.9em;
    font-style: italic;
}

.visual-map-close {
    background: #6b4423;
    color: #f4e8d0;
    border: 2px solid #8b5a3c;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.visual-map-close:hover {
    background: #8b5a3c;
    transform: scale(1.1);
}

.visual-map-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    background: 
        radial-gradient(ellipse at center, rgba(61, 40, 23, 0.8) 0%, rgba(26, 15, 8, 1) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(107, 68, 35, 0.1) 2px,
            rgba(107, 68, 35, 0.1) 4px
        );
    position: relative;
    overflow: auto;
    max-height: 70vh;
}

.visual-map-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.visual-map-container::-webkit-scrollbar-track {
    background: #2a1810;
    border-radius: 6px;
}

.visual-map-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b6914, #6b4423);
    border-radius: 6px;
    border: 2px solid #2a1810;
}

.visual-map-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a07a18, #8b5a3c);
}

/* Decorative corner pieces */
.visual-map-container::before,
.visual-map-container::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.visual-map-container::before {
    top: 0;
    left: 0;
    background: 
        linear-gradient(135deg, rgba(45, 90, 31, 0.4) 0%, transparent 50%),
        linear-gradient(45deg, rgba(45, 90, 31, 0.3) 0%, transparent 40%);
}

.visual-map-container::after {
    bottom: 0;
    right: 0;
    background: 
        linear-gradient(-45deg, rgba(45, 90, 31, 0.4) 0%, transparent 50%),
        linear-gradient(-135deg, rgba(45, 90, 31, 0.3) 0%, transparent 40%);
}

#trailMapCanvas {
    border-radius: 8px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.visual-map-footer {
    padding: 12px 20px;
    background: #2a1810;
    border-top: 2px solid #6b4423;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-footer-info {
    color: #b8a88a;
    font-size: 0.85em;
}

.map-footer-actions {
    display: flex;
    gap: 10px;
}

.map-btn {
    background: linear-gradient(135deg, #6b4423, #8b5a3c);
    color: #f4e8d0;
    border: 2px solid #8b5a3c;
    padding: 8px 16px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.map-btn:hover {
    background: linear-gradient(135deg, #8b5a3c, #a06a4c);
    transform: translateY(-2px);
}

.map-btn-primary {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #2a1810;
    border-color: #b8941f;
}

.map-btn-primary:hover {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

/* Main Menu button style matching the reference image */
.map-main-menu-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-family: 'IM Fell English', 'Courier New', serif;
    font-size: 1.1em;
    color: #d4c4a0;
    background: none;
    border: none;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: color 0.2s;
}

.map-main-menu-btn:hover {
    color: #ffd700;
}

/* Progress section with inline map button */
.progress-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.progress-section .progress-bar {
    flex: 1;
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .visual-map-modal {
        max-height: 95vh;
    }
    
    .visual-map-header h2 {
        font-size: 1.2em;
    }
    
    #trailMapCanvas {
        width: 100% !important;
        height: auto !important;
    }
    
    .visual-map-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animation for node selection */
@keyframes nodeSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Sparkle effect for destination */
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}