/**
 * Company Map Locator - Map Styles
 * 
 * Styles for the map, tabs, and location lists
 */

/* Container styles */
.company-map-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: relative;
}

/* City filter styles */
.city-filter-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    max-width: 280px;
    min-width: 200px;
    transition: all 0.3s ease;
}

.city-filter-wrapper:hover {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Стиль для стандартного селекта */
.city-filter {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.2s ease;
}

.city-filter:hover {
    border-color: #bbb;
}

.city-filter:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

/* Стили для кастомного селектбокса */
.selectbox {
    position: relative;
    width: 100%;
}

/* Стили для основного элемента селекта */
.selectbox .select {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.selectbox .select:hover {
    border-color: #bbb;
}

/* Стиль для текста в селекте */
.selectbox .select .text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Стиль для триггера (стрелки) */
.selectbox .trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.selectbox .arrow {
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #555;
    transition: transform 0.3s ease;
}

/* Стиль для выпадающего списка */
.selectbox .dropdown {
    position: absolute;
    top: 100% !important;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    border: 1px solid #eee;
}

/* Стили для списка опций */
.selectbox .dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.selectbox .dropdown li {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.selectbox .dropdown li:last-child {
    border-bottom: none;
}

.selectbox .dropdown li:hover {
    background-color: #f5f5f5;
}

.selectbox .dropdown li.selected,
.selectbox .dropdown li.sel {
    background-color: #e6f7ff;
    color: #0073aa;
    font-weight: 500;
}

/* Стилизация скроллбара для выпадающего списка */
.selectbox .dropdown::-webkit-scrollbar {
    width: 6px;
}

.selectbox .dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.selectbox .dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.selectbox .dropdown::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Анимация для открытого состояния */
.selectbox .dropdown.open {
    display: block;
    animation: dropdown-fade-in 0.2s ease;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Map canvas styles */
#company-map-canvas {
    width: 100%;
    height: 500px;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tabs navigation */
.tabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tabs-nav li {
    margin: 0;
    padding: 0;
}

.tabs-nav a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tabs-nav a:hover {
    background-color: #f5f5f5;
}

.tabs-nav a.active {
    border-color: #ddd;
    background-color: #fff;
    border-bottom-color: #fff;
    color: #0073aa;
}

/* Tab content */
.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

/* Locations list */
.locations-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.location-item {
    display: flex;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;
    position: relative;
    overflow: hidden;
    gap: 20px;
}

.location-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: #bbb;
    transform: translateY(-2px);
}

.location-content {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 25px;
}

.location-logo {
    flex: 0 0 100px;
    position: relative;
}

.location-logo img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.location-item:hover .location-logo img {
    transform: scale(1.05);
}

.location-details {
    flex: 1;
}

.location-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
    line-height: 1.3;
    color: #f0ad4e;
    font-weight: 600;
    transition: color 0.2s ease;
}

.location-item:hover .location-details h3 {
    color: #f0ad4e;
    text-shadow: 0 0 1px rgba(240, 173, 78, 0.3);
}

.location-details p {
    margin: 8px 0;
    color: #444;
    font-size: 16px;
    line-height: 1.6;
}

.location-details p i {
    margin-right: 8px;
    color: #f0ad4e;
    opacity: 0.9;
    font-size: 20px;
}

.location-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 160px;
}

.directions-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 12px 20px;
    background-color: #f0ad4e;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(240, 173, 78, 0.3);
    border: none;
    width: 100%;
    text-align: center;
}

.directions-link:hover {
    background-color: #ec971f;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(240, 173, 78, 0.4);
}

.view-details-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 15px;
    border: 1px solid #ddd;
    width: 100%;
    text-align: center;
}

.view-details-link:hover {
    background-color: #e9e9e9;
    color: #f0ad4e;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Info window styles */
.marker-info-window {
    padding: 5px;
}

.marker-info-window h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.marker-info-window p {
    margin: 5px 0;
    font-size: 14px;
}

/* No locations message */
.no-locations {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* Стиль для уведомления об отсутствии координат */
.no-coordinates-notice {
    display: inline-flex;
    align-items: center;
    color: #856404;
    background-color: #fff3cd;
    border-left: 3px solid #ffeeba;
    padding: 10px 15px;
    margin-top: 12px;
    font-size: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

.no-coordinates-notice:before {
    content: '\26A0'; /* Unicode для символа предупреждения */
    margin-right: 8px;
    font-size: 16px;
}

/* Дополнительные стили для элементов списка локаций */
.location-category {
    display: inline-block;
    padding: 5px 10px;
    background-color: rgba(240, 173, 78, 0.15);
    color: #f0ad4e;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 10px;
}

.location-meta {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 12px;
    align-items: center;
    gap: 15px;
}

.location-meta span {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #555;
    padding: 4px 0;
}

.location-meta span i {
    margin-right: 8px;
    color: #f0ad4e;
    font-size: 20px;
}

/* Анимация при наведении */
.location-item {
    position: relative;
    overflow: hidden;
}

.location-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #f0ad4e;
    transition: width 0.3s ease;
}

.location-item:hover::after {
    width: 100%;
}

/* Responsive styles */
@media (max-width: 768px) {
    .tabs-nav {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tabs-nav a {
        border: 1px solid #ddd;
        border-radius: 0;
        margin-bottom: -1px;
    }
    
    .tabs-nav a.active {
        border-bottom-color: #ddd;
    }
    
    .tabs-nav li:first-child a {
        border-radius: 4px 4px 0 0;
    }
    
    .tabs-nav li:last-child a {
        border-radius: 0 0 4px 4px;
        margin-bottom: 15px;
    }
    
    .location-item {
        flex-direction: column;
        padding: 15px;
    }
    
    .location-content {
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }
    
    .location-logo {
        margin-right: 0;
        margin-bottom: 15px;
        text-align: center;
        width: 100%;
        max-width: 150px;
        align-self: center;
        height: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .location-details {
        width: 100%;
        margin-bottom: 15px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .location-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
        gap: 10px;
    }
    
    .directions-link,
    .view-details-link {
        width: auto;
        min-width: 120px;
        margin-bottom: 0;
    }
    
    /* Улучшенные стили для изображений на мобильных устройствах */
    .location-logo img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: none;
        object-fit: contain;
    }
    
    /* Улучшенные стили для иконок на мобильных устройствах */
    .location-details p i {
        margin-right: 5px;
        display: inline-block;
        vertical-align: middle;
    }
    
    /* Каждый элемент на новой строке */
    .location-details p {
        display: block;
        width: 100%;
        text-align: center;
        margin: 8px 0;
    }
    
    /* Мета-информация на новых строках */
    .location-meta {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .location-meta span {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    /* Плавающая высота карточек */
    .location-item {
        height: auto;
        min-height: 0;
    }
}
