<!-- im-map.css -->

/* Map container and controls */
#map-container {
    background-color: var(--surface);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

#map-container svg {
    display: block; /* Prevent extra space below SVG */
    width: 100%;
    height: auto; /* Allow aspect-ratio to control height */
    /* --- Choose ONE aspect-ratio --- */
    /* aspect-ratio: 1; */ /* Square */
    /* aspect-ratio: 4 / 3; */ /* Standard Def */
    aspect-ratio: 16 / 9; /* Wide Screen */
    /* Or a specific ratio based on your map data, e.g., 1.8 */
    /* aspect-ratio: 1.8; */

    /* Optional: Add a max-height if needed */
     /* max-height: 70vh; */ /* Example: max 70% of viewport height */

    /* Updated background for visibility during loading */
     background-color: var(--surface-hover);
}

.states {
    pointer-events: none;
}

.selections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-top: 1rem;
    gap: 0.5rem;
}

.selections label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.selections label:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-color: var(--border-hover);
}

.selections input[type="checkbox"] {
    margin-right: 0.75rem;
    accent-color: var(--accent-1);
}

/* Map details section */
.map-details {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* Voronoi territory styles */
.voronoi {
    fill-opacity: 1.0;
    transition: fill-opacity 0.2s ease-in-out;
}

.voronoi-selected {
    fill-opacity: 0.7;
}

.svgBackground {
    fill: none;
    pointer-events: all;
}

.map-details ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.map-details li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.map-tooltip {
    padding: 0.5rem;
    border: 1px solid var(--territory-border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--surface);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-label {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-slider {
    width: 100%;
    max-width: 768px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
    margin: 10px auto;
    display: block;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent-1);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 0 4px rgba(190, 242, 100, 0.5);
    transition: all 0.15s ease-in-out;
}

.timeline-slider::-webkit-slider-thumb:hover {
    background: var(--link-color-hover);
    box-shadow: 0 0 8px rgba(190, 242, 100, 0.8);
    transform: scale(1.1);
}

.timeline-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--accent-1);
    border: 2px solid var(--background);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(190, 242, 100, 0.5);
    transition: all 0.15s ease-in-out;
}

.timeline-slider::-moz-range-thumb:hover {
    background: var(--link-color-hover);
    box-shadow: 0 0 8px rgba(190, 242, 100, 0.8);
    transform: scale(1.1);
}

/*
 * When the timeline is restricted, modify the slider's background
 * to show the selectable vs unselectable parts.
 */
.timeline-restricted .timeline-slider {
    /* 
     * Create a gradient with a hard stop.
     * Using theme colors for consistency
    */
    background: linear-gradient(to right, 
        var(--electric-purple), /* Color for the selectable part */
        var(--electric-purple) var(--selectable-percentage), 
        var(--border), /* Color for the unselectable part */
        var(--border) var(--selectable-percentage)
    );
}

.team-color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    border-width: 4px !important;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

#team-territories-table td {
    background-color: transparent;
    color: var(--text-primary);
}

#team-territories-table th {
    color: var(--text-primary);
    background-color: var(--surface-hover);
    border-color: var(--border);
}

#team-territories-table tbody tr:hover {
    background-color: var(--surface-hover);
}
