/* Основные стили контейнера */
.yma-container {
    display: flex;
    width: 100%;
    gap: 20px;
    margin-bottom: 30px;
}

.yma-map-container {
    flex: 60%;
    position: relative;
    height: 500px;
}

.yma-table-container {
    flex: 40%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.yma-table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Стили карты */
#yma-map {
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    width: 100%;
}

.yma-map-notice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    font-weight: bold;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.yma-map-notice.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Стили таблицы */
.yma-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed;
}

.yma-table thead {
    display: table;
    width: 100%;
}

.yma-table tbody {
    display: block;
    overflow-y: auto;
    height: 400px;
}

.yma-table tr {
    display: table;
    width: 100%;
}

.yma-table th, 
.yma-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
    box-sizing: border-box;
}

.yma-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.yma-table td.yma-location {
    width: 60%;
}

.yma-table td.yma-led, 
.yma-table td.yma-stop {
    width: 20%;
    text-align: center;
}

.yma-table tr:hover td {
    background-color: #f8f9fa;
    cursor: pointer;
}

.yma-table img {
    width: 25px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Стили пагинации */
.yma-pagination {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    margin-top: auto;
    background: #fff;
    border-top: 1px solid #eee;
}

.yma-pagination a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
}

.yma-pagination a:hover {
    background-color: #f0f0f0;
}

.yma-pagination a.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Стили всплывающего окна */
.yma-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.yma-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.yma-popup {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 75vh;
    overflow-y: auto;
    padding: 15px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.yma-popup-close {
    position: absolute;
    top: 3px;
    right: 6px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #a10f15;
}

.yma-popup-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yma-popup-image {
    width: 100%;
    min-height: 300px;
    height: auto;
    background-size: contain;
    background-position: center;
    border-radius: 5px;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
}

.yma-popup-title {
    margin: 0;
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
}

.yma-popup-description {
    color: #555;
    line-height: 1.5;
    font-size: 1em;
}

.yma-popup-description p {
    margin: 0 0 10px 0;
}

.yma-popup-description strong,
.yma-popup-description b {
    font-weight: bold !important;
    color: inherit;
}

.yma-popup-description em,
.yma-popup-description i {
    font-style: italic !important;
}

.yma-popup-description u {
    text-decoration: underline !important;
}

.yma-popup-type {
    font-weight: bold;
    color: #0073aa;
    font-size: 1.1em;
}

.yma-popup-whatsapp {
    display: inline-block;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.yma-popup-whatsapp:hover {
    background-color: #128C7E;
}

/* Сообщения */
.yma-loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px !important;
}

.yma-error {
    text-align: center;
    color: #d63638;
    padding: 20px !important;
}

.yma-no-data {
    text-align: center;
    color: #666;
    padding: 20px !important;
}

.yma-page-dots {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    color: #666;
}

/* Адаптивные стили */
@media (max-width: 1030px) {
    .yma-container {
        flex-direction: column;
    }
    
    .yma-map-container,
    .yma-table-container {
        flex: 100%;
        height: 500px;
    }
    
    .yma-table-container {
        margin-top: 20px;
    }

    .yma-popup {
        max-width: 500px;
    }
}

@media (max-width: 650px) {
    .yma-map-container,
    .yma-table-container {
        height: 400px !important;
    }
    
    .yma-table {
        width: 100%;
    }
    
    .yma-table thead {
        display: table;
        width: 100%;
    }
    
    .yma-table tbody {
        display: block;
        overflow-y: auto;
        height: 300px;
    }
    
    .yma-table tr {
        display: table;
        width: 100%;
    }
    
    .yma-table th, 
    .yma-table td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .yma-table td.yma-location {
        width: 60%;
    }
    
    .yma-table td.yma-led, 
    .yma-table td.yma-stop {
        width: 20%;
    }
    
    .yma-popup {
        width: 85% !important;
        max-width: 85% !important;
        padding: 10px;
    }
    
    .yma-popup-image {
        height: 150px;
    }
    
    .yma-popup-title {
        font-size: 16px;
    }
    
    .yma-popup-description {
        font-size: 14px;
    }
    
    .yma-popup-type {
        font-size: 15px;
    }
    
    .yma-popup-whatsapp {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .yma-map-notice {
        padding: 12px 20px;
        font-size: 16px;
    }
}