/* * AVT US States Map - Stylesheet
 * * This file contains the styles for the interactive US map.
 */


.state-list-item {
    height: 60px;
}

div#avt-us-list-view {
    min-height: 850px;
}

.avt-cusm {
    font-family: 'Inter', sans-serif;
    margin: 1em 0;
    display: flex;
    flex-direction: column;
}

.avt-header-controls {
    order: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.avt-cusm .map-container {
    order: 2;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.zoom-controls-container {
    order: 3;
    margin-top: 15px;
}

/* Make the SVG responsive */
.avt-cusm #avt-us-map-svg {
    width: 100%;
    height: auto;
    cursor: grab;
}

.avt-cusm #avt-us-map-svg:active {
    cursor: grabbing;
}

.avt-cusm .states path {
    fill: #ccc;
    stroke: #fff;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: fill 0.3s ease-in-out;
}

.avt-cusm .states path:hover,
.avt-cusm .states path.hover {
    fill: #a2a2a2;
}

.avt-cusm .states path.dimmed {
    fill: #f0f0f0;
    pointer-events: none;
}


/* The tooltip is appended to the body, so it's not prefixed with .avt-cusm */
.avt-us-map-tooltip {
    position: absolute;
    width: auto;
    max-width: 300px;
    height: auto;
    padding: 8px;
    font: 12px sans-serif;
    background: lightsteelblue;
    border: 0px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    word-wrap: break-word;
    z-index: 9999;
    text-align: center;
}

.avt-cusm .state-labels {
    cursor: pointer;
}

.avt-cusm .large-state-label {
    font-size: 14px;
    fill: black;
    text-anchor: middle;
    alignment-baseline: central;
}

.avt-cusm .small-state-label {
    font-size: 14px;
}

.avt-cusm .small-state-label text {
    fill: #333;
    text-anchor: start;
    alignment-baseline: central;
}

.avt-cusm .state-pointer-line {
    stroke: #555;
    stroke-width: 1px;
}

.avt-cusm .state-labels image {
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 0.5px;
}

.avt-cusm .zoom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.avt-cusm .zoom-controls button {
    border: 1px solid #e7e7e7;
    border-radius: 0.5rem;
    background-color: white;
    color: #474747;
    width: 44px;
    height: 44px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease-in-out;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.avt-cusm .zoom-controls button:hover {
    border-color: #009966;
    background-color: #f0f0f0;
}

.avt-cusm .toggle-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.avt-cusm .filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e7e7e7;
    border-radius: 0.5rem;
    background-color: white;
    color: #474747;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    width: auto;
    height: 44px;
    display: inline-flex;
    align-items: center;
}

.avt-cusm .filter-btn:hover {
    border-color: #009966;
}

.avt-cusm .filter-btn.active {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.avt-cusm .filter-btn i {
    margin-right: 8px;
}

/* --- Search Autocomplete Styles --- */
.search-container {
    position: relative;
    width: 250px;
}

#autocomplete-suggestions {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; /* Hidden by default */
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* Make children same height */
    border-bottom: 1px solid #eee;
    font-size: 0.875rem;
    color: #474747;
}

.autocomplete-text {
    flex-grow: 1;
    padding: 10px;
    cursor: pointer;
}

.autocomplete-link {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #009966;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.autocomplete-item:hover .autocomplete-text {
    background-color: #f0f0f0;
}

.autocomplete-item:hover .autocomplete-link {
    background-color: #e6e6e6;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* --- List View Styles --- */
.list-view-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

#state-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #e7e7e7;
    border-radius: 0.5rem;
    background-color: white;
    color: #474747;
    font-weight: 500;
    font-size: 0.875rem;
    height: 44px;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

#state-search-input::placeholder {
    color: #9ca3af;
}

#state-search-input:focus {
    outline: none;
    border-color: #009966;
    box-shadow: 0 0 0 2px rgba(0, 153, 102, 0.2);
}

#avt-us-list-view .list-view-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    padding: 10px;
    box-sizing: border-box;
}

.state-list-item {
    border: 1px solid #e7e7e7;
    border-radius: 0.5rem;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.state-list-item:hover {
    border-color: #009966;
    background-color: #faf7f5;
}

.state-list-item svg {
    width: 60px;
    height: 40px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.state-list-item .state-path {
    fill: #ccc;
    stroke: #666;
    stroke-width: 0.5px;
}

.state-list-item span {
    font-weight: 500;
    color: #474747;
    text-align: left;
    margin-right: auto;
    font-size: 0.95rem;
}

.state-list-item .state-list-flag {
    width: 30px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid #eee;
}

/* Desktop and tablet-specific adjustments */
@media (min-width: 769px) {
    .avt-header-controls {
        margin: 15px 0;
    }
   .avt-us-map-tooltip strong {
        font-size: 14px;
    }
    .avt-cusm .large-state-label {
        font-size: 12px;
    }
}

/* Mobile-specific adjustments for controls */
@media (max-width: 599px) {
    .avt-cusm .toggle-controls-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .avt-cusm .toggle-controls-container .search-container {
        grid-column: 1 / -1; /* Span full width */
        width: 100%;
    }

    .avt-cusm .toggle-controls-container .filter-btn {
        justify-content: center;
        width: 100%;
    }
}

