/* map.css */

/* Tools Panel */
.tools-panel {
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-box input {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s;
}

body.light-mode .search-box input {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.1);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
}

@media (max-width: 600px) {
    .search-box { flex-direction: column; }
}

/* Map Styling */
.map-wrapper {
    position: relative;
    width: 100%;
    /* Centers the map and prevents it from being too huge */
    max-width: 1200px; 
    margin: 0 auto;
}

.map-header {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.svg-container {
    width: 100%;
    /* Restrict height on larger screens by limiting width relative to container */
    max-width: 90%; 
    margin: 0 auto;
    
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    overflow: hidden;
    line-height: 0;
    position: relative;
}

body.light-mode .svg-container {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

#mySVG {
    width: 100%;
    height: auto;
    display: block;
}

/* --- IMAGE MAP STYLES --- */
.map-image {
    /* 
       NASA Visible Earth (JPG) Style:
       We convert the colored satellite photo to a sleek monochrome texture.
       
       Dark Mode: 
       - Grayscale 100% (remove color)
       - Opacity 0.4 (fade into dark background)
       - Contrast 1.2 (sharpen land vs sea)
    */
    filter: grayscale(100%) opacity(0.4) contrast(1.2);
    transition: filter 0.3s ease;
}

body.light-mode .map-image {
    /* 
       Light Mode:
       - Grayscale 100%
       - Opacity 0.5 (visible against light bg)
       - Invert (Make oceans light, land dark grey - fits light theme better)
    */
    filter: grayscale(100%) opacity(0.5);
}

/* INTERACTIVE DOTS (COLORBLIND FRIENDLY & FIXED POSITION) */
.interactive-dot {
    cursor: pointer;
    transition: all 0.2s ease-out;
    
    /* 
       Default (Inactive): GOLD/YELLOW (#FFD700)
       High contrast against dark map. 
       Safe for Daltonism (distinguishable from Cyan/Blue).
    */
    fill: #FFD700; 
    stroke: rgba(0,0,0,0.5);
    stroke-width: 1px;
    
    /* 
       FIX for "jumping" dots: 
       Removed transform: scale() animation. 
       Only animating opacity/stroke to prevent coordinate shifts.
    */
    animation: pulse-opacity 2s infinite;
}

.interactive-dot:hover {
    fill: #FFEA00; /* Brighter yellow on hover */
    stroke-width: 2px;
    stroke: #fff;
    opacity: 1;
    z-index: 9999;
}

/* Active State (Added to clock list) */
.interactive-dot.active-clock {
    /* 
       Active: CYAN/AQUA (#00FFFF)
       Distinct from Yellow for color blind users.
    */
    fill: #00FFFF; 
    stroke: #fff;
    stroke-width: 1.5px;
    animation: none; 
}

.interactive-dot.active-clock:hover {
    fill: #E0FFFF; /* Lighter Cyan */
}

/* Pulse Opacity - No Scale to avoid jumping */
@keyframes pulse-opacity {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.map-tooltip {
    position: fixed;
    background: rgba(0,0,0,0.95);
    border: 1px solid var(--accent-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    z-index: 10000;
    transform: translate(-50%, -150%);
    transition: opacity 0.1s;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.map-instruction {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

/* Clock Cards */
.clock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.clock-card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: var(--glass-card-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 1.5rem;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.clock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: 0.3s;
}

.remove-btn:hover { opacity: 1; color: var(--danger-color); }

.analog-clock { width: 80px; height: 80px; flex-shrink: 0; }
.clock-circle { fill: transparent; stroke: var(--text-secondary); stroke-opacity: 0.3; stroke-width: 2; }
.clock-mark { stroke: var(--text-secondary); stroke-opacity: 0.3; stroke-width: 1.5; }
.hand { transform-origin: 50% 50%; stroke-linecap: round; }
.hand-hour { stroke: var(--text-primary); stroke-width: 3; }
.hand-min { stroke: var(--text-secondary); stroke-width: 2; }
.hand-sec { stroke: var(--accent-color); stroke-width: 1; }
.clock-center { fill: var(--accent-color); }

.digital-info { flex: 1; }
.city-name { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px;}
.time-display { font-size: 1.8rem; font-weight: 300; line-height: 1.1; margin-bottom: 5px; color: var(--text-primary); }
.date-display { font-size: 0.85rem; color: var(--text-secondary); }
.status-badge { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.1); color: var(--text-secondary); margin-top: 5px; }
