/* settings.css */

/* Ogólne style dla modala (settingsModal) */
#settingsModal.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Ciemniejsze, półprzezroczyste tło */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Powyżej topBar, ale poniżej purchase-modal */
    backdrop-filter: blur(5px); /* Rozmycie tła */
    animation: fadeIn 0.3s ease-out forwards; /* Animacja pojawiania się */
}

#settingsModal .modal-content.settings-modal-content {
    background-color: #0B1822; /* Dopasowane do tła strony */
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Ograniczenie wysokości */
    overflow-y: auto; /* Przewijanie, jeśli treść jest dłuższa */
    box-sizing: border-box; /* Ważne dla prawidłowego obliczania szerokości i paddingu */
}

#settingsModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

#settingsModal .modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: #007bff; /* Kolor nagłówka */
}

#settingsModal .close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

#settingsModal .close-modal:hover,
#settingsModal .close-modal:focus {
    color: white;
}

#settingsModal .modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px; /* Dodaje przestrzeń na scrollbar */
}

#settingsModal .setting-group {
    margin-bottom: 5px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

#settingsModal .setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#settingsModal .setting-group h3 {
    font-size: 1.2em;
    color: #17a2b8; /* Kolor nagłówków grup */
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

#settingsModal .setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Zapewnia rozłożenie elementów */
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: nowrap; /* Zapobiega zawijaniu, aby utrzymać elementy w jednej linii */
}

#settingsModal .setting-item:last-child {
    margin-bottom: 0;
}

/* Usunięto style dla .settings-button, ponieważ zostaną zastąpione przez switche */

/* Status display for GPS and Compass */
#settingsModal .gps-status,
#settingsModal .compass-display {
    display: flex;
    align-items: center;
    font-size: 1em;
    white-space: nowrap;
    min-width: 160px; /* Zwiększona minimalna szerokość dla statusu (tekstu + kropki/ikony) */
    flex-grow: 1; /* Pozwala na rozciągnięcie */
    justify-content: flex-start; /* Wyrównanie do lewej */
}

/* Naprawa rozciągniętej kropki GPS */
#settingsModal .gps-status .red-dot,
#settingsModal .gps-status .green-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0; /* Zapobiega rozciąganiu */
}

#settingsModal .gps-status .red-dot {
    background-color: red;
}

#settingsModal .gps-status .green-dot {
    background-color: green;
}

#settingsModal .compass-display .compass-icon {
    width: 25px;
    height: 25px;
    object-fit: contain;
    margin-right: 8px;
    transition: transform 0.1s ease-out;
    flex-shrink: 0;
}

#settingsModal .compass-display .compass-heading {
    font-weight: bold;
    color: white;
}

/* Language selector in settings */
#settingsModal #languageSelector {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #333;
    color: white;
    font-size: 1em;
    cursor: pointer;
    flex-grow: 1;
    min-width: 100px; /* Zapewnia minimalną szerokość */
}

#settingsModal #languageSelector option {
    background-color: #333;
    color: white;
}

/* Fullscreen status */
#settingsModal #fullscreenStatus {
    font-weight: bold;
    color: #28a745;
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

/* Animacja Fade In - dla settingsModal */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Styles for the new Switches --- */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0; /* Prevents stretching */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3; /* Blue for active */
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsywność dla setting-item na mniejszych ekranach */
@media (max-width: 450px) { /* Zmieniono punkt przerwania na 450px */
    #settingsModal .setting-item {
        flex-direction: column; /* Układanie w kolumnie */
        align-items: flex-start; /* Wyrównanie do lewej */
        gap: 8px;
    }

    #settingsModal .settings-button { /* Keep this for other potential buttons */
        width: 100%; /* Przyciski na całą szerokość */
        justify-content: center;
    }

    #settingsModal #fullscreenStatus,
    #settingsModal .gps-status,
    #settingsModal .compass-display {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 5px;
    }

    .switch {
        /* Ensure switch maintains its size and position */
        width: 60px;
        height: 34px;
        align-self: flex-end; /* Align switch to the right when in column layout */
    }
}

/* ADDED STYLES FOR HELP SECTION */
#settingsModal .help-text {
    font-size: 0.9em;
    color: #ddd;
    line-height: 1.5;
    text-align: left;
}

#settingsModal .help-text h4 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #17a2b8;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

#settingsModal .help-text ul {
    list-style-type: none;
    padding-left: 15px;
    margin-top: 5px;
}

#settingsModal .help-text li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 10px;
}

#settingsModal .help-text li::before {
    content: '▪';
    position: absolute;
    left: -10px;
    top: 0;
    color: #007bff;
}

#settingsModal .help-text p {
    margin-top: 10px;
    margin-bottom: 10px;
}

#settingsModal .help-text strong {
    color: #f0ad4e;
}

#settingsModal #location-help {
    border-bottom: none;
}