/* reference.css - стили для справочника стран и столиц */
#referenceMenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.reference-content {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
}

.reference-content h2 {
    color: #2c3e50;
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    padding: 0 10px;
}

.reference-list {
    width: 100%;
    margin: 10px 0;
}

.reference-main-container {
    display: flex;
    width: 100%;
    gap: 20px;
}

.countries-list {
    flex: 1;
    min-width: 0;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    background-color: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.reference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    width: 100%;
}

.reference-item:last-child {
    border-bottom: none;
}

.reference-country {
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    flex: 1;
    font-size: 0.95rem;
}

.reference-capital {
    color: #2980b9;
    font-weight: 600;
    text-align: left;
    flex: 1;
    font-size: 0.95rem;
}

.reference-region {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-left: 5px;
}

.region-filters-container {
    width: 260px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    position: sticky;
    top: 15px;
}

.region-filters-container h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    text-align: center;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #34495e;
    padding: 5px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-options label:hover {
    background-color: #e9ecef;
}

.filter-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.back-to-region-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #6c7a89, #556270);
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.back-to-region-btn:hover {
    background: linear-gradient(135deg, #556270, #3d4a5a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    #referenceMenu {
        padding: 10px;
    }
    
    .reference-content h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .reference-main-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .region-filters-container {
        width: 100%;
        position: static;
        padding: 12px;
        margin-bottom: 0;
    }
    
    .countries-list {
        max-height: calc(100vh - 320px);
        padding: 10px;
    }
    
    .filter-options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 15px;
    }
    
    .filter-options label {
        font-size: 0.85rem;
        padding: 4px 8px;
        background-color: #e9ecef;
        border-radius: 15px;
    }
    
    .reference-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        gap: 5px;
    }
    
    .reference-capital {
        font-size: 0.9rem;
        color: #2980b9;
        order: 1;
    }
    
    .reference-country {
        font-size: 0.9rem;
        text-align: left;
        order: 2;
    }
    
    .reference-region {
        display: inline;
        font-size: 0.7rem;
        margin-left: 5px;
    }
    
    .back-to-region-btn {
        font-size: 0.95rem;
        padding: 10px;
        margin-top: 15px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .reference-content h2 {
        font-size: 1.2rem;
    }
    
    .filter-options {
        gap: 6px 12px;
    }
    
    .filter-options label {
        font-size: 0.8rem;
    }
    
    .countries-list {
        max-height: calc(100vh - 300px);
    }
}