/**
 * Map Styles for The Journeyman
 * Interactive map styling for the hero section
 * Part of The Journeyman typography and visual system
 */

/* Map container - Perfect Square */
.map-container {
    position: relative;
    width: 400px; /* Base width */
    height: auto; /* Let height flow from aspect-ratio */
    aspect-ratio: 1 / 1; /* Keep perfect square */
    background: rgba(26, 47, 53, 0.4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin: 0 auto; /* Center the container */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    transition: width 0.3s ease; /* Avoid animating height; derived from width */
}

/* Topographical elevation layer */
.map-topography {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Elevation contours */
        radial-gradient(ellipse at 50% 50%, rgba(255, 183, 77, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 183, 77, 0.02) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 183, 77, 0.01) 0%, transparent 50%),
        /* Terrain features */
        radial-gradient(ellipse at 30% 40%, rgba(255, 183, 77, 0.07) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 183, 77, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 70%, rgba(255, 183, 77, 0.06) 0%, transparent 35%),
        radial-gradient(ellipse at 60% 30%, rgba(255, 183, 77, 0.08) 0%, transparent 45%),
        /* Ridge lines */
        linear-gradient(45deg, transparent 48%, rgba(255, 183, 77, 0.03) 49%, rgba(255, 183, 77, 0.03) 51%, transparent 52%),
        linear-gradient(135deg, transparent 48%, rgba(255, 183, 77, 0.03) 49%, rgba(255, 183, 77, 0.03) 51%, transparent 52%);
    background-size: 
        100% 100%,
        90% 90%,
        80% 80%,
        40% 40%,
        50% 50%,
        35% 35%,
        45% 45%,
        100px 100px,
        100px 100px;
    opacity: 1;
    z-index: 1;
}

/* Map grid lines */
.map-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
}

/* Map pins */
.map-pin {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB74D;
    font-size: 16px;
    z-index: 3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-pin:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Pin positions */
.pin-1 {
    top: 20%;
    left: 30%;
}

.pin-2 {
    top: 35%;
    left: 60%;
}

.pin-3 {
    top: 60%;
    left: 75%;
}

.pin-4 {
    top: 70%;
    left: 40%;
}

.pin-5 {
    top: 50%;
    left: 20%;
}

.pin-6 {
    top: 25%;
    left: 80%;
}

/* Pin pulse animation */
.pin-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 183, 77, 0.4);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    70% {
        transform: scale(2);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Pin labels */
.pin-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 47, 53, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: var(--font-secondary, 'Montserrat', sans-serif);
    font-weight: 500;
    pointer-events: none;
}

.map-pin:hover .pin-label {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Central icon */
.central-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 183, 77, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB74D;
    font-size: 24px;
    z-index: 2;
    border: 2px solid rgba(255, 183, 77, 0.5);
    box-shadow: 0 0 20px rgba(255, 183, 77, 0.4);
    transition: all 0.5s ease;
}

/* Central icon animations */
.central-icon.pulse-effect {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 183, 77, 0.6);
}

.central-icon.glow-effect {
    box-shadow: 0 0 40px rgba(255, 183, 77, 0.7);
    color: #FFC107;
}

/* Radar circles */
.radar-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 183, 77, 0.4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.8;
    box-shadow: 0 0 5px rgba(255, 183, 77, 0.2);
}

.radar-circle-1 {
    width: 30%;
    height: 30%;
    animation: radarPulse 4s infinite;
}

.radar-circle-2 {
    width: 50%;
    height: 50%;
    animation: radarPulse 4s infinite 1s;
}

.radar-circle-3 {
    width: 70%;
    height: 70%;
    animation: radarPulse 4s infinite 2s;
}

.radar-circle-4 {
    width: 90%;
    height: 90%;
    animation: radarPulse 4s infinite 3s;
}

@keyframes radarPulse {
    0% { opacity: 0.2; }
    50% { opacity: 0.5; }
    100% { opacity: 0.2; }
}

/* Radar scan effect - clock style */
.map-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45%; /* Length of the radar sweep */
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 183, 77, 0.8) 0%, 
        rgba(255, 183, 77, 0.4) 80%, 
        rgba(255, 183, 77, 0) 100%);
    transform-origin: 0 50%; /* Origin at the center point */
    animation: radarScan 15s linear infinite; /* Even slower animation (15s) */
    z-index: 3;
    box-shadow: 0 0 8px rgba(255, 183, 77, 0.4);
}

@keyframes radarScan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* SVG filters for map routes */
.map-svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    visibility: hidden;
}

/* Responsive adjustments for map */
@media (max-width: 1200px) {
    .map-container {
        width: min(70vw, 520px);
    }
    
    .map-pin {
        width: 18px;
        height: 18px;
    }
    
    .map-pin .pin-pulse {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 992px) {
    .map-container {
        width: min(80vw, 480px);
    }
    
    .map-center-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    /* On small mobile screens, hide visual to prioritize text */
    .hero-visual { display: none; }
    .map-container {
        width: 90vw;
    }
    
    .map-pin {
        width: 16px;
        height: 16px;
    }
    
    .radar-circle-4 {
        width: 85%;
        height: 85%;
    }
}

@media (max-width: 576px) {
    .map-container {
        width: 95vw;
    }
    
    .map-pin {
        width: 14px;
        height: 14px;
    }
    
    .map-pin .pin-pulse {
        width: 30px;
        height: 30px;
    }
}

/* Map notification */
.map-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 47, 53, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-secondary, 'Montserrat', sans-serif);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    border-left: 4px solid #FFB74D;
}

.map-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@keyframes routeFlow {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .hero-visual {
        display: block; /* Keep visible on laptops/tablets */
        margin-top: 20px;
    }
}

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
    .pin-pulse {
        animation: none;
    }
    
    .map-route::after {
        animation: none;
    }
}
