:root {
    --white: #ffffff;
    --black: #000000;
    --check: #f7f7f7;
    --check-text: #333;
    --window-background: rgba(255, 255, 255, 0.9);
    --group-head-background: #f5f5f5;
    --group-header-hover: #e9e9e9;
    --select-item-hover: #0a0a0a;
}

[data-theme="dark"] {
    --white: #000000;
    --black: #ffffff;
    --check: #080808;
    --check-text: #cccccc;
    --window-background: rgba(0, 0, 0, 0.9);
    --group-head-background: #0a0a0a;
    --group-header-hover: #0c0c0c;
    --select-item-hover: #f0f0f0;
}

.leaflet-control-zoom {
    top: 10px;
    left: 5px;
}

.container {
    width: 100%;
    padding: 0 0 0 0;
    box-sizing: border-box;
}

.leaflet-left .leaflet-control {
    margin-left: 0;
}

.new-button {
    position: absolute;
    bottom: 15px;
    right: 10px;
    width: 43px;
    height: 43px;
    background-color: var(--black);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
}

.custom-select {
    position: absolute;
    bottom: 15px;
    left: 50px;
    z-index: 1000;
    width: calc(100% - 105px);
}

.select-selected {
    background-color: var(--black);
    color: var(--white);
    padding: 12px 16px;
    border-radius: 8px;
    user-select: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.select-selected:hover {
    background-color: var(--black);
}

.select-arrow {
    border-color: var(--white) transparent transparent transparent;
    border-style: solid;
    border-width: 6px 6px 0 6px;
    transition: transform 0.3s ease;
}

.select-items {
    position: absolute;
    background-color: var(--white);
    bottom: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    user-select: none;
    opacity: 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 0;
    position: fixed;
    top: 0;
    left: 0;
}

.select-items.show {
    max-height: 50vh;
    opacity: 1;
}

.select-items-scroll {
    max-height: 50vh;
    overflow-y: auto;
}

.select-item {
    background-color: var(--black);
    color: var(--white);
    padding: 10px 16px;
    cursor: pointer;
    z-index: 999;
    transition: background-color 0.2s ease;
}

.select-selected.active .select-arrow {
    transform: rotate(180deg);
}



.warning {
    margin-top: 10px;
    z-index: 998;
    text-align: center;
    color: red;
    font-weight: bold;
    border-radius: 9px;
    background: #ffffff;
    padding: 10px;
    width: fit-content;
    white-space: nowrap;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    display: none;
}
.warning.show {
    display: block;
    opacity: 1;
    max-height: 200px;
}

.hiddenInfo {
    visibility: hidden;
}

.select-items-scroll::-webkit-scrollbar {
    width: 8px;
}

.select-items-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.select-items-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.select-items-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.location-button {
    position: absolute;
    background-color: #0078ff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    bottom: 67px;
    right: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.location-button img {
    width: 35px;
    height: 35px;
}

.focus-stop-button {
    position: fixed;
    background-color: #00000000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    left: 3px;
    bottom: 67px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-stop-button,
.location-button {
    z-index: 10;
    pointer-events: auto;
}


.focus-stop-button img {
    width: 40px;
    height: 40px;
}

.focus-stop-button i {
    font-size: 20px;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 45vh;
    overflow: hidden;
    z-index: 1000;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.bottom-sheet-content {
    max-height: calc(45vh - 100px);
    overflow-y: auto;
}

.bus-list {
    background-color: var(--white);
    color: var(--black);
    list-style: none;
    padding: 0;
    margin: 0;
}

.bottom-sheet-header {
    background-color: var(--white);
    color: var(--black);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bus-item {
    padding: 15px;
}

.map-icon {
    cursor: pointer;
}

.close-icon {
    color: var(--black);
    cursor: pointer;
}

.window {
    position: fixed;
    background-color: var(--window-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80vw;
    max-width: 600px;
    box-sizing: border-box;
    z-index: 1001;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.title {
    color: var(--black);
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.search {
    margin-bottom: 15px;
}

.search input {
    background-color: var(--white);
    color: var(--black);
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.items {
    list-style: none;
    padding: 0 5px 0 0;
    margin: 0 0 10px;
    height: 50vh;
    overflow-y: auto;
}

.items::-webkit-scrollbar {
    width: 6px;
}

.items::-webkit-scrollbar-track {
    background: rgba(240, 240, 240, 0.8);
    border-radius: 6px;
}

.items::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 255, 0.8);
    border-radius: 6px;
}

.items::-webkit-scrollbar-thumb:hover {
    background: rgba(80, 80, 200, 0.8);
}

.items li {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: center;
    background-color: rgba(240, 240, 240, 0.8);
    transition: background-color 0.3s, transform 0.2s;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}



@media (hover: hover) {
    .items li:hover {
        background-color: rgba(200, 200, 255, 0.8);
    }
    .select-item:hover {
        background-color: var(--select-item-hover);
    }
}

@media (hover: none) {
    .items li:active {
        background-color: rgba(200, 200, 255, 0.8);
    }
}

.items li.selected {
    background-color: rgba(100, 100, 255, 0.8);
    color: white;
}

.buttons {
    display: flex;
    justify-content: space-between;
}

.buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.buttons button:hover {
    background-color: #0056b3;
}

.info-button {
    position: absolute;
    bottom: 120px;
    right: 14px;
    width: 33px;
    height: 33px;
    background-color: #0078ff;
    background-image: url('../icons/info.svg');
    background-size: 50px 50px;
    background-repeat: no-repeat;
    background-position: center;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
}

.info-window {
    background-color: var(--white);
    color: var(--black);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1002;
    display: none;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.info-close {
    position: sticky;
    float: right;
    top: 1px;
    background: none;
    border: none;
    font-size: 34px;
    cursor: pointer;
    color: #666;
}

.info-content {
    line-height: 1.6;
}

.info-stats {
    margin-top: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.info-stats-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.info-stats-item {
    margin-bottom: 5px;
}

.info-update {
    display: block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.3s;
}

.info-update:hover {
    background-color: #0056b3;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
}

.loading {
    text-align: center;
    padding: 20px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #0078ff;
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-window::-webkit-scrollbar {
    width: 8px;
}

.info-window::-webkit-scrollbar-thumb {
    background: #b4b4b4;
    border-radius: 15px;
}

.info-window::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 15px;
    margin-bottom: 6px;
    margin-top: 6px;
}

.group-container {
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.group-header {
    padding: 10px;
    background-color: var(--group-head-background);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}
.group-header:hover {
    background-color: var(--group-header-hover);
}
.group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.group-content.expanded {
    max-height: 30vh;
    overflow-y: auto;
    padding: 5px;
}
.group-indicator {
    color: var(--black);
    margin-left: 10px;
    transition: transform 0.3s;
}
.group-header.expanded .group-indicator {
    transform: rotate(180deg);
}
.group-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.group-content li {
    color: var(--black);
    padding: 10px;
    border-bottom: 1px solid var(--group-head-background);
    cursor: pointer;
    border-radius: 7px;
}

.header-name {
    color: var(--black);
}
.group-content li:last-child {
    border-bottom: none;
}
.group-content li.selected {
    background-color: #007BFF;
    color: #fff;
    border-radius: 7px;
}
@media (hover: hover) {
    .group-content li:hover {
        background-color: #8ec7ff;
    }
}
.count-badge {
    background-color: #1890ff;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 5px;
}

.theme-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.theme-label {
    font-size: 14px;
    color: var(--text);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--black);
    border-radius: 25px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: #2980b9;
}

/* Контейнер по центру */
#cf-container {
    position: fixed;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1002;
    pointer-events: none;
}

/* Плашка */
#cf-check {
    background-color: var(--check);
    color: var(--check-text);
    padding: 16px 32px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0);
    transform-origin: center top;
    transition: transform 0.6s ease, opacity 0.6s ease;
    pointer-events: auto;
}

#cf-check.show {
    opacity: 1;
    transform: scale(1);
}

#cf-check.shrink {
    opacity: 0;
    transform: scale(0);
}

#turnstile-hidden {
    margin-top: 8px;
}


.bus-marker {
    background: none !important;
    border: none !important;
    cursor: pointer;
    width: 42px !important;
    height: 42px !important;
}

.maplibregl-marker {
    background: none !important;
}

/* If you're specifically targeting bus markers */
.maplibregl-marker .bus-marker {
    background-image: none !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.error-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
}

.modal {
    display: flex;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-content {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    min-width: 250px;
}
.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
}
.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
}
#openGoogle { background: #4285F4; color: white; }
#openApple { background: #007AFF; color: white; }