/* заголовок карти */
.ships_header {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.ships_header h2 {
    font-family: 'Merriweather', serif;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    text-align: center;
}

.ships_description {
    font-family: 'Fira Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #6c757d;
    text-align: center;
    margin: 0 auto;
}

.ships_container.wide-content {
    width: 100% !important;
    max-width: 1200px !important;
    transform: none !important;
    left: auto !important;
    position: relative;
    height: 90vh;
    margin: 40px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.ships_container {
    position: relative;
    width: 100%;
    height: 90vh;
    margin: 40px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

#map_ships { 
    position: absolute;
    top: 0; 
    bottom: 0; 
    width: 100%; 
    font-family: 'Fira Sans';
}

.ships_sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    font-family: 'Fira Sans';
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.ships_controls {
    padding: 20px;
}

.ships_control_group {
    margin-bottom: 20px;
}

.ships_control_group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.ships_controls select, .ships_controls input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.ships_controls select:focus, .ships_controls input:focus {
    outline: none;
    border-color: #435656;
}

.ship_stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.ship_stat_item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.ship_stat_label {
    color: #6c757d;
}

.ship_stat_value {
    font-weight: 600;
    color: #2c3e50;
}

.ship_route_details {
    margin-top: 20px;
    padding: 15px;
    background: #ECEBF3;
    border-radius: 8px;
    border-left: 4px solid #435656;
}

.ship_route_details h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.voyage_item {
    background: white;
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 13px;
}

.voyage_ship {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.voyage_details {
    color: #6c757d;
    line-height: 1.4;
}

.mapbox-ctrl-group button {
    background: rgba(255, 255, 255, 0.9) !important;
}

.hidden {
    display: none;
}

.mapboxgl-popup {
    z-index: 10000 !important;
}

.mapboxgl-popup-content {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
}

.voyage-popup {
    font-family: 'Fira Sans', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.voyage-popup h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.voyage-popup .detail-item {
    margin-bottom: 8px;
}

.voyage-popup .detail-label {
    font-weight: 600;
    color: #495057;
}

.voyage-popup .detail-value {
    color: #6c757d;
}

.voyage-popup .ship-doc-link {
    margin: 0 2px;
}

.voyage-popup .ship-doc-icon {
    width: 14px;
    height: 18px;
}

.voyage-popup .detail-value .ship-doc-link:hover {
    transform: scale(1.15);
}

.mobile_filter_toggle {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    z-index: 1001;
}

#ship-image-modal.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#ship-image-modal.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

#ship-image-modal .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

#ship-m_image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.ship-doc-link {
    display: inline-block;
    text-decoration: none;
    margin: 0 3px;
    vertical-align: middle;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.ship-doc-link:hover {
    transform: scale(1.1);
}

.ship-doc-icon {
    display: inline-block;
    width: 12px;
    height: 16px;
    background-image: url('../media/doc.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
    cursor: pointer;
}

.ship-doc-link:hover .ship-doc-icon {
    background-image: url('../media/doc2.svg');
}

/* fullscreen режим */
.ships-fullscreen .ships_sidebar {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 999998 !important;
}

.ships-fullscreen #ship-image-modal {
    z-index: 999999 !important;
}

@media (max-width: 768px) {
    .ships-fullscreen .ships_sidebar {
        width: calc(100% - 40px) !important;
        max-width: 320px !important;
    }
}

/* різні екрани */
@media (max-width: 768px) {
    .ships_header { padding: 0 15px; margin-bottom: 15px; }
    .ships_header h2 { font-size: 24px; }
    .ships_description { font-size: 15px; text-align: left; }
    .ships_container { height: 70vh; margin: 20px auto; }
    .mobile_filter_toggle { display: block; }
    .ships_sidebar { width: calc(100% - 20px); max-width: 320px; top: 60px; left: 10px; max-height: calc(70vh - 80px); transform: translateX(-110%); transition: transform 0.3s ease; }
    .ships_sidebar.open { transform: translateX(0); }
    .ships_controls { padding: 15px; }
    .voyage_item { padding: 10px; font-size: 12px; }
    .ship_stat_item { font-size: 13px; }
    .ships_controls select { padding: 8px 10px; font-size: 13px; }
    #ship-image-modal .modal-content { max-width: 95%; max-height: 85%; }
    #ship-m_image { max-height: 70vh; }
    .mapboxgl-popup-content { font-size: 13px !important; max-width: 280px !important; }
    .voyage-popup h3 { font-size: 14px; }
    .voyage-popup .detail-item { margin-bottom: 6px; }
    .voyage-popup img { max-height: 120px; object-fit: cover; }
    .voyage-popup .ship-doc-icon { width: 14px; height: 18px; }
}

@media (max-width: 480px) {
    .ships_header { padding: 0 10px; margin-bottom: 10px; }
    .ships_header h2 { font-size: 22px; }
    .ships_description { font-size: 14px; }
    .ships_container { height: 60vh; }
    .ships_sidebar { width: calc(100% - 10px); left: 5px; top: 55px; max-height: calc(60vh - 70px); }
    .mobile_filter_toggle { left: 10px; top: 10px; padding: 10px; font-size: 14px; }
    .ships_controls { padding: 12px; }
    .ship_route_details h4 { font-size: 14px; }
    .voyage_item { padding: 8px; margin: 6px 0; }
}