/* Toy Box Map Frontend Styles */

.tbc-map-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 20px 0;
}

/* Search Controls */
.tbc-map-controls {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tbc-search-panel h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.tbc-search-row {
    margin-bottom: 15px;
}

.tbc-search-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tbc-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.tbc-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.tbc-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tbc-btn-primary {
    background: #c1272d;
    color: #fff;
}

.tbc-btn-primary:hover {
    background: #a01f24;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(193, 39, 45, 0.3);
}

.tbc-btn-secondary {
    background: #2c8fdf;
    color: #fff;
}

.tbc-btn-secondary:hover {
    background: #1f6fb8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 143, 223, 0.3);
}

.tbc-btn-link {
    background: transparent;
    color: #2271b1;
    border: 1px solid #2271b1;
}

.tbc-btn-link:hover {
    background: #2271b1;
    color: #fff;
}

.tbc-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Filter Controls */
.tbc-filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.tbc-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tbc-filter-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.tbc-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.tbc-slider:hover {
    opacity: 1;
}

.tbc-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c1272d;
    cursor: pointer;
}

.tbc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c1272d;
    cursor: pointer;
    border: none;
}

.tbc-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.tbc-select:focus {
    outline: none;
    border-color: #2271b1;
}

#tbc-radius-value {
    font-weight: 700;
    color: #c1272d;
}

.tbc-toggle-view {
    margin-left: auto;
}

/* Map Layout */
.tbc-map-layout {
    position: relative;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    display: flex;
}

.tbc-map {
    flex: 1;
    min-width: 0;
}

/* Locations List Sidebar */
.tbc-locations-list {
    width: 350px;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 10;
    height: 600px; /* Default height, will be overridden by inline style */
    max-height: 600px;
}

.tbc-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.tbc-list-header h4 {
    margin: 0;
    font-size: 18px;
}

.tbc-btn-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.3s;
}

.tbc-btn-close:hover {
    color: #c1272d;
}

.tbc-list-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}

/* Scrollbar styling for webkit browsers */
.tbc-list-content::-webkit-scrollbar {
    width: 8px;
}

.tbc-list-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tbc-list-content::-webkit-scrollbar-thumb {
    background: #c1272d;
    border-radius: 4px;
}

.tbc-list-content::-webkit-scrollbar-thumb:hover {
    background: #a01f24;
}

.tbc-list-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.tbc-list-item:hover {
    border-color: #c1272d;
    box-shadow: 0 2px 8px rgba(193, 39, 45, 0.2);
    transform: translateX(-2px);
}

.tbc-list-details {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.tbc-list-details h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

.tbc-list-address {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.tbc-list-distance {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #2c8fdf;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

.tbc-list-distance .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.tbc-list-directions {
    margin: 0;
}

.tbc-list-directions a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #c1272d;
    text-decoration: none;
    font-weight: 500;
}

.tbc-list-directions a:hover {
    text-decoration: underline;
}

.tbc-list-directions .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.tbc-list-logo {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    order: 2; /* Put logo on right */
}

.tbc-list-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tbc-no-results-text {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* Info Window Styles */
.tbc-info-window {
    padding: 10px;
    min-width: 250px;
    max-width: 350px;
}

.tbc-info-logo {
    text-align: center;
    margin-bottom: 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbc-info-logo img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.tbc-info-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tbc-info-address {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.5;
}

.tbc-info-address p {
    margin: 0 0 3px 0;
}

.tbc-info-website,
.tbc-info-directions {
    margin-top: 10px;
}

.tbc-info-website a,
.tbc-info-directions a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.tbc-info-website a:hover {
    background: #2c8fdf;
    color: #fff;
}

.tbc-info-directions a:hover {
    background: #c1272d;
    color: #fff;
}

.tbc-info-window .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* No Results Message */
.tbc-no-results {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
    text-align: center;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 968px) {
    /* Stack map and list vertically on smaller screens */
    .tbc-map-layout {
        flex-direction: column;
    }

    .tbc-locations-list {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .tbc-search-input-group {
        flex-direction: column;
    }

    .tbc-search-input {
        width: 100%;
        min-width: 100%;
    }

    .tbc-btn {
        width: 100%;
        justify-content: center;
    }

    .tbc-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tbc-filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .tbc-slider {
        width: 100%;
    }

    .tbc-list-item {
        flex-wrap: wrap;
    }

    .tbc-list-logo {
        width: 100%;
        height: 80px;
        order: 0;
        margin-bottom: 8px;
    }

    .tbc-list-details {
        order: 1;
    }
}

@media (max-width: 480px) {
    .tbc-map-controls {
        padding: 15px;
    }

    .tbc-search-panel h3 {
        font-size: 18px;
    }

    .tbc-info-window {
        max-width: 250px;
    }
}
