/* Styl dla kontenera logo */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px; /* dopasowana wysokość kontenera dla pionowego wyśrodkowania */
    margin-bottom: 20px;
    text-align: center;
}

/* Styl dla logo aplikacji */
.app-logo {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    display: block;
}

/* Ogólne style dla body */
body {
    font-family: Arial, sans-serif;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
    background-color: #001f3f;
    color: #ffffff;
}

/* Nagłówki */
h1 {
    text-align: center;
    color: #ffffff;
}

h2 {
    color: #ffffff;
}

/* Formularz */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #00274d;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

label {
    font-weight: bold;
    color: #ffffff;
}

textarea, select, input {
    padding: 10px;
    border: 1px solid #004080;
    border-radius: 5px;
    font-size: 16px;
    background-color: #003366;
    color: #ffffff;
}

textarea {
    height: 150px;
    resize: vertical;
}

.comment-input {
    width: 100%;
    min-height: 40px;
    resize: vertical;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 14px;
    border: 1px solid #004080;
    border-radius: 5px;
    padding: 8px;
    background-color: #003366;
    color: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
    cursor: text;
}

.comment-input:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.3);
}

.comment-input:hover {
    border-color: #ff66ff;
}

.comment-input:disabled, .comment-input[readonly] {
    background-color: #00274d;
    cursor: not-allowed;
    border-color: #004080;
}

/* Przyciski */
button {
    background: #ff66ff;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
}

button:hover {
    background: #cc00cc;
}

button:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

#exportGpxBtn {
    background: #ff66ff;
}

#exportGpxBtn:hover {
    background: #cc00cc;
}

#exportGpxBtn:focus {
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

#printButton {
    background: #ff66ff;
}

#printButton:hover {
    background: #cc00cc;
}

#printButton:focus {
    box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

/* Komunikaty o błędach */
#error {
    color: #ff66ff;
    font-weight: bold;
    margin-bottom: 15px;
}

#error ul {
    margin-top: 5px;
    padding-left: 20px;
}

/* Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #ff00ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    opacity: 1 !important;
    visibility: visible !important;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Pasek postępu */
#progressContainer {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    height: 30px;
    background: #00274d;
    border-radius: 5px;
    overflow: visible;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: relative;
    display: block !important;
    visibility: visible !important;
}

#progressBar {
    width: 0%;
    min-width: 100px;
    height: 100%;
    background-color: #ff00ff;
    transition: width 0.4s ease;
    position: relative;
}

#progressLabel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    white-space: normal;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mapa */
#map {
    height: 60vh;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

/* Lista tras */
#routeList {
    list-style: none;
    padding: 0;
}

#routeList li {
    background: #00274d;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #004080;
    border-radius: 5px;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

#routeList li.fixed {
    background: #003366;
    cursor: not-allowed;
}

/* Ikony na mapie */
.leaflet-div-icon.custom-number-icon {
    border: none;
    background: transparent;
}

/* Ukrywanie elementów */
.hidden {
    display: none !important;
}

/* Tabela do druku */
#printTableWrapper {
    min-height: 200px;
    margin-top: 20px;
}

#printTable {
    width: 100%;
    border-collapse: collapse;
    background-color: #00274d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

#printTable th,
#printTable td {
    border: 1px solid #004080;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    color: #ffffff;
}

#printTable th {
    background-color: #003366;
    font-weight: bold;
    text-align: center;
}

#printTable td {
    vertical-align: middle;
}

/* Statystyki trasy */
#routeStats {
    margin-top: 20px;
    padding: 15px;
    background-color: #00274d;
    border: 1px solid #004080;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

#routeStats h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #ffffff;
}

#routeStats p {
    margin: 5px 0;
    font-size: 14px;
    color: #ffffff;
}

#routeStats p strong {
    font-weight: bold;
}

/* Stylizacja dla druku */
@media print {
    body *:not(#printTableWrapper):not(#printTableWrapper *):not(#routeStats):not(#routeStats *) {
        display: none !important;
    }
    #printTableWrapper, #routeStats {
        display: block !important;
    }
    #printTable {
        box-shadow: none;
        border-radius: 0;
    }
    #printTable th,
    #printTable td {
        border: 1px solid #000;
        padding: 8px;
        font-size: 12px;
        color: #000;
    }
    #printTable th {
        background-color: #e0e0e0;
    }
    .comment-input {
        border: none !important;
        background: transparent !important;
        resize: none !important;
        height: auto !important;
        padding: 0 !important;
        line-height: 1.2 !important;
        color: #000 !important;
        font-size: 12px !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    #routeStats {
        box-shadow: none;
        border: 1px solid #000;
        padding: 10px;
        color: #000;
    }
    #routeStats h3 {
        font-size: 16px;
    }
    #routeStats p {
        font-size: 12px;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .logo-container {
        min-height: 120px;
    }
    .app-logo {
        max-height: 150px;
        width: auto;
        height: auto;
    }
    #map {
        height: 50vh;
    }
    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    #exportGpxBtn, #printButton {
        width: 100%;
        max-width: 300px;
    }
    #printTable th,
    #printTable td {
        font-size: 12px;
        padding: 8px;
    }
    #printTable td:nth-child(2),
    #printTable td:nth-child(5) {
        width: 30%;
    }
    .comment-input {
        font-size: 12px;
    }
    #routeStats {
        padding: 10px;
    }
    #routeStats h3 {
        font-size: 16px;
    }
    #routeStats p {
        font-size: 12px;
    }
}
