/* --- Ogólne Style --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 20px;
    background-color: #f8f9fa;
    color: #343a40;
}

h1, h2 {
    color: #343a40;
    margin-bottom: 20px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Przełącznik języków --- */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.language-switcher button {
    padding: 5px 10px;
    font-size: 0.9rem;
    margin-left: 5px;
    background-color: #f8f9fa;
    color: #343a40;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.language-switcher button:hover {
    background-color: #e9ecef;
}

.language-switcher button.active-lang {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* --- Kontener i Układ --- */
.container {
    text-align: center;
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 90%;
    margin: 20px auto;
}

.container-fluid {
    margin: 0 auto;
    max-width: 95%;
}

/* --- Przyciski --- */
.button-style {
    display: inline-block;
    margin: 10px 5px;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.button-style:hover {
    background-color: #5a6268;
    text-decoration: none;
}

.cancel-button {
    background-color: #dc3545;
}

.cancel-button:hover {
    background-color: #c82333;
}


/* --- Przyciski Akcji (w tabelach itp.) --- */
.delete-button, .edit-button, .change-password-btn, .delete-user-btn {
    display: inline-block;
    padding: 4px 10px; /* Zmniejszony padding dla mniejszej wysokości */
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    text-decoration: none !important; /* Ensure no underline on <a> buttons */
    margin: 2px;
}

.delete-button, .delete-user-btn {
    background-color: #dc3545; /* Czerwony */
    border-color: #dc3545;
    color: white !important;
}

.delete-button:hover, .delete-user-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.edit-button {
    background-color: #007bff; /* Niebieski */
    border-color: #007bff;
    color: white !important;
}

.edit-button:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.change-password-btn {
    background-color: #ffc107; /* Żółty */
    border-color: #ffc107;
    color: #212529 !important;
}

.change-password-btn:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}


/* --- Tabela --- */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    font-size: 14px;
}

#user-list-table {
    text-align: left;
    margin: 20px auto;
}

th, td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: middle;
}

thead th {
    background-color: #e9ecef;
    font-weight: 600;
}

tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

/* --- Formularze --- */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

#drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 60px;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    margin-top: 20px;
}

#drop-zone.dragover {
    border-color: #007bff;
    background-color: #e9ecef;
}

#file-input {
    display: none;
}

/* --- Komunikaty i Notyfikacje --- */
#message, .error-message {
    margin-top: 20px;
    font-weight: bold;
    min-height: 24px;
}

.message-uploading { color: #007bff; }
.message-success { color: #28a745; }
.message-error, .error-message { color: #dc3545; }
.message-info { color: #17a2b8; }


/* --- Modal (okno dialogowe) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* --- Przycisk do mobilnego filtrowania --- */
#toggle-filters-btn {
    display: none;
    width: 100%;
    margin-bottom: 15px;
    background-color: #007bff;
}

#toggle-filters-btn:hover {
    background-color: #0069d9;
}

/* --- Progress & Spinner --- */
#progress-container {
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* --- Style responsywne --- */
@media screen and (max-width: 992px) {
    #toggle-filters-btn {
        display: block;
    }
    table thead tr:not(.filter-row) {
        display: none;
    }
    table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #dee2e6;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        border-radius: 5px;
    }
    tr.filter-row {
        display: none;
        border: none;
        box-shadow: none;
        margin-bottom: 0;
    }
    tr.filter-row.active {
        display: block;
        margin-bottom: 20px;
    }
    tr.filter-row th {
        display: block;
        width: 100%;
        box-sizing: border-box;
        border: none;
        padding: 5px 0;
    }
    table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }
    table td:last-child {
        border-bottom: none;
    }
    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
    }
    table td input[type="date"],
    table td input[type="checkbox"] {
        width: auto;
        display: inline-block;
    }
    table td a,
    table td button {
        display: inline-block;
        width: auto;
        padding: 5px 10px;
    }
}
