/* style_gro.css - Стили для ГРО с единым дизайном */
@import url('/style.css');

/* Дополнительные стили для ГРО */
.controls-container {
    background: var(--button-background-color);
    border-radius: 15px;
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    gap: calc(var(--spacing-unit) * 1.5);
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label {
    min-width: 140px;
    font-weight: 500;
    opacity: 0.8;
}

/* Радио-переключатели */
.coord-toggle,
.search-mode-toggle,
.ignore-chars-toggle {
    display: flex;
    gap: var(--spacing-unit);
    background: var(--background-color);
    padding: calc(var(--spacing-unit) * 0.5);
    border-radius: 10px;
}

.coord-toggle label,
.search-mode-toggle label,
.ignore-chars-toggle label {
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
}

input[type="radio"]:checked + label {
    background: var(--button-background-color);
    font-weight: 600;
}

/* Строка поиска - всегда в одну линию */
.search-row {
    display: flex;
    gap: var(--spacing-unit);
    align-items: center;
    width: 100%;
}

.search-input {
    flex: 1;
    min-width: 0; /* Позволяет сжиматься */
    padding: calc(var(--spacing-unit) * 1.2) calc(var(--spacing-unit) * 2);
    border: none;
    border-radius: 20px;
    font-size: 1.1rem;
    background: var(--background-color);
    color: var(--text-color);
}

.search-input:focus {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

/* Кнопка геолокации - менее контрастная */
.geolocate-button {
    width: 45px;
    height: 45px;
    min-width: 45px;
    padding: 0;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Используем полупрозрачный темный фон для меньшего контраста */
    background-color: rgba(0, 0, 0, 0.2) !important;
    color: var(--text-color) !important;
}

/* Темная тема - инвертируем */
@media (prefers-color-scheme: dark) {
    .geolocate-button {
        background-color: rgba(255, 255, 255, 0.2) !important;
        color: var(--text-color) !important;
    }
}

.geolocate-button:hover {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

@media (prefers-color-scheme: dark) {
    .geolocate-button:hover {
        background-color: rgba(255, 255, 255, 0.3) !important;
    }
}

/* Контейнер данных */
.data-container {
    min-height: 150px;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.message-state {
    text-align: center;
    padding: calc(var(--spacing-unit) * 4);
    opacity: 0.7;
    font-size: 1.1rem;
}

.message-state.error {
    color: #e74c3c;
}

/* Список результатов */
.output-list {
    max-height: 600px;
    overflow-y: auto;
    padding: var(--spacing-unit);
}

.output-line {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.2);
    padding: calc(var(--spacing-unit) * 1.2);
    margin-bottom: calc(var(--spacing-unit) * 0.8);
    background: var(--button-background-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.output-line:hover {
    background-color: var(--button-hover-background-color);
    transform: translateY(-1px);
}

.output-line:active {
    transform: translateY(0);
}

.point-name {
    font-weight: 600;
    flex-shrink: 0;
}

.point-info {
    opacity: 0.7;
    font-size: 0.95rem;
    flex: 1;
}

.map-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 0.5);
    flex-shrink: 0;
}

/* Кнопки карт - менее контрастные */
.map-link {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    /* Полупрозрачный фон для меньшего контраста */
    background-color: rgba(0, 0, 0, 0.15) !important;
    color: var(--text-color) !important;
    text-decoration: none;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .map-link {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
}

.map-link:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.25) !important;
}

@media (prefers-color-scheme: dark) {
    .map-link:hover {
        background-color: rgba(255, 255, 255, 0.25) !important;
    }
}

/* Кнопки в секции данных */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-unit);
}

.action-buttons .b {
    /* Оставляем стандартный стиль кнопок */
}

/* Попап */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: var(--background-color);
    border-radius: 20px;
    padding: calc(var(--spacing-unit) * 3);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.popup-header {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.popup-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.popup-subtitle {
    font-size: 1rem;
    opacity: 0.6;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.popup-coordinates {
    font-family: var(--mono-font);
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    line-height: 1.8;
}

.popup-map-links {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.popup-map-links .map-link {
    /* В попапе кнопки могут быть с обычным фоном */
    background-color: var(--button-background-color) !important;
    color: var(--text-color) !important;
}

.popup-map-links .map-link:hover {
    background-color: var(--button-hover-background-color) !important;
}

.popup-close-btn,
.popup-back-btn {
    position: absolute;
    top: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    background: var(--button-background-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.popup-back-btn {
    right: calc(var(--spacing-unit) * 2 + 50px);
    font-size: 1.2rem;
}

.popup-close-btn:hover,
.popup-back-btn:hover {
    background-color: var(--button-hover-background-color);
}

/* Список ближайших точек */
.nearby-section {
    margin-top: calc(var(--spacing-unit) * 3);
}

.nearby-title {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    opacity: 0.8;
}

.nearby-list .output-line {
    padding: calc(var(--spacing-unit) * 1);
}

.nearby-distance {
    font-weight: 600;
    opacity: 0.7;
    min-width: 50px;
    flex-shrink: 0;
}

.no-results {
    opacity: 0.7;
    text-align: center;
    padding: calc(var(--spacing-unit) * 2);
}

/* Конвертер координат */
.manual-coord-input {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    border: none;
    border-radius: 10px;
    background: var(--background-color);
    color: var(--text-color);
    font-family: var(--mono-font);
    width: 200px;
}

.manual-coord-input:focus {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

.conversion-result {
    font-family: var(--mono-font);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Адаптивность */
@media (max-width: 425px) {
    .control-row:not(.search-row) {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-label {
        min-width: auto;
        margin-bottom: calc(var(--spacing-unit) * 0.5);
    }
    
    .coord-toggle,
    .search-mode-toggle,
    .ignore-chars-toggle {
        width: 100%;
        justify-content: stretch;
    }
    
    .coord-toggle label,
    .search-mode-toggle label,
    .ignore-chars-toggle label {
        flex: 1;
        text-align: center;
    }
    
    .popup-content {
        margin: var(--spacing-unit);
        padding: calc(var(--spacing-unit) * 2);
    }
    
    .manual-coord-input {
        width: 100%;
    }
    
    /* Строка поиска остается горизонтальной */
    .search-row {
        flex-direction: row !important;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-line {
    animation: slideIn 0.3s ease-out;
}

/* Скроллбар */
.output-list::-webkit-scrollbar,
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.output-list::-webkit-scrollbar-track,
.popup-content::-webkit-scrollbar-track {
    background: var(--button-background-color);
    border-radius: 4px;
}

.output-list::-webkit-scrollbar-thumb,
.popup-content::-webkit-scrollbar-thumb {
    background: var(--text-color);
    opacity: 0.3;
    border-radius: 4px;
}

/* Состояние загрузки */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--button-background-color);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
