/* =======================================================
   1. Základní proměnné a reset
   ======================================================= */
:root {
    --color-bg-dark: #001230;
    --color-primary: #1e3a8a;
    --color-secondary: #0f1c3f;
    --color-text-light: #ffffff;
    --color-text-muted: #a3b3cc;
    --color-accent: #A88BFB;
    --blur-intensity: 15px;
    --card-bg-opacity: 0.2;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 8px 20px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* =======================================================
   2. Layout a kontejnery
   ======================================================= */

.container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 20px 0 0;
}

.header-logo {
    max-height: 80px;
    width: auto;     
    display: block;
    margin: 0 auto 30px;   
    transition: transform 0.2s;
}

.header-logo:hover {
    transform: scale(1.02);
}

.nav {
    display: flex; 
    justify-content: flex-end;
    align-items: center;
    padding: 10px 40px; 
    margin-bottom: 20px;
}

.nav a {
    color: var(--color-text-light);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--color-accent);
}

/* Styl pro logout tlačítko */

.logout-btn {
    margin: 0 !important; 
    padding: 8px 15px; 
    border-radius: 6px; 
    background-color: transparent; 
    border: 1px solid var(--color-text-muted); 
    color: var(--color-text-light);
    transition: background-color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1); 
    border-color: var(--color-accent);
}


/* =======================================================
   3. Glass karty
   ======================================================= */

.card {
    background-color: var(--color-primary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
    background-color: rgba(30, 58, 138, var(--card-bg-opacity)); 
    backdrop-filter: blur(var(--blur-intensity)); 
    border: 1px solid var(--border-color); 
}

.card-group {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    margin-bottom: 20px; 
    align-items: stretch;
}

.card-group .card {
    flex: 1 1 calc(50% - 10px); 
    min-width: 300px; 
    margin-bottom: 0; 
}

/* Pro hlavní panel (profilový) */

.profile-card {
    background-color: #6f42c1; 
    padding: 30px;
}

.profile-card p.dashboard-title {
    color: var(--color-text-light);
    font-weight: bold;
}

.profile-card hr {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3); 
    margin: 15px 0;
}

.profile-card .role-info {
    margin-top: 10px;
    color: #A88BFB;
    font-weight: bold;
    
}
.profile-card .role-info strong {
    color: var(--color-accent);
}

.profile-img {
    width: 125px;
    height: 125px;
    border-radius: 50%; 
    object-fit: cover;
    border: 2px solid var(--color-accent);
    box-shadow: var(--shadow-light);
}

/* Karta pro úpravu dovolené */

.centered-card {
    max-width: 500px !important;
    width: 100%;
    margin: 40px auto;
}

/* Karta pro oznámení/chyby */

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    font-weight: bold;
    backdrop-filter: blur(5px);
}
.alert.success {
    background-color: rgba(0, 150, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.2);
}
.alert.error {
    background-color: rgba(150, 0, 0, 0.3);
    border: 1px solid rgba(255, 0, 0, 0.2);
}


/* =======================================================
   4. Formuláře a tabulky
   ======================================================= */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    margin: 5px 0 15px 0;
    display: inline-block;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--color-secondary); 
    color: var(--color-text-light);
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Styly pro Choices.js */
.choices {
    margin: 5px 0 15px 0 !important;
}

.choices[data-type*="select-one"] {
    width: 100% !important;
}

.choices[data-type*="select-one"] .choices__inner {
    background-color: var(--color-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    padding: 10px !important;
    color: var(--color-text-light) !important;
    font-size: 14px !important;
    min-height: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.choices[data-type*="select-one"].is-focused .choices__inner,
.choices__inner:focus-within {
    border-color: var(--color-accent) !important;
    outline: none !important;
}

.choices__list--single {
    padding: 0 !important;
}

.choices__item--selectable {
    color: var(--color-text-light) !important;
    padding: 8px !important;
}

.choices__item--selectable:hover {
    background-color: rgba(168, 139, 251, 0.3) !important;
    color: var(--color-text-light) !important;
}

.choices__item--selected {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--color-text-light) !important;
}

.choices__button {
    background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22%3E%3Cpath fill=%22%23A88BFB%22 d=%22M11.354 11.354L.646.646m10.708 0L.646 11.354%22/%3E%3C/svg%3E') !important;
}

.choices__placeholder {
    color: var(--color-text-muted) !important;
}

.choices__list--dropdown {
    background-color: var(--color-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    color: var(--color-text-light) !important;
    z-index: 10 !important;
    min-width: 100% !important;
}

.choices__list--dropdown .choices__item {
    color: var(--color-text-light) !important;
    padding: 10px !important;
    background-color: var(--color-secondary) !important;
}

.choices__list--dropdown .choices__item--selectable:hover {
    background-color: rgba(168, 139, 251, 0.5) !important;
    color: var(--color-text-light) !important;
}

.choices__input {
    background-color: transparent !important;
    color: var(--color-text-light) !important;
}

.choices[data-type*="select-one"] .choices__input {
    display: none !important;
}

button, .btn {
    background-color: var(--color-accent);
    color: var(--color-text-light);
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none; 
    display: inline-flex;  
    align-items: center;   
    justify-content: center; 
    text-align: center;
}

button:hover, .btn:hover {
    background-color: #8C73E4;
    transform: translateY(-1px);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: rgba(30, 58, 138, 0.1); 
    border-radius: var(--border-radius);
    overflow: hidden; 
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Barvy stavů v tabulkách */

.status-pending { color: orange; font-weight: bold; }
.status-approved { color: limegreen; font-weight: bold; }
.status-rejected { color: tomato; font-weight: bold; }

/* =======================================================
   5. Responzivní a specifické styly
   ======================================================= */

.card-group, .card, .table-card {
    max-width: 100%; 
}

.card table, .table-card table {
    min-width: 700px; 
}

.table-responsive {
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
}

/* Styly pro login stránku*/

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-container {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    background-color: rgba(30, 58, 138, 0.2); 
    backdrop-filter: blur(var(--blur-intensity)); 
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
    text-align: center;
}

/* Přesahy nadpisy a text */

h1, h2, h3 {
    margin-bottom: 15px;
    font-weight: 300;
}

h2 {
    font-size: 2em;
}

h3 {
    font-weight: bold;
}

p {
    margin-bottom: 10px;
}

/* =======================================================
   6. Toast Notifikace (Vyskakovací okna)
   ======================================================= */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    background: rgba(30, 58, 138, 0.9);
    backdrop-filter: blur(var(--blur-intensity));
    color: var(--color-text-light);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    transform: translateX(150%); /* Schované vpravo */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease-out; /* Mírný "bouncy" efekt */
    opacity: 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dynamické barevné proužky podle typu zprávy */
.toast-success {
    border-left: 5px solid limegreen;
}

.toast-error {
    border-left: 5px solid tomato;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* =======================================================
   7. Skleněná modální okna
   ======================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(30, 58, 138, 0.5);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-heavy);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    transition: transform 0.2s;
}

.modal-btn:hover { transform: scale(1.05); }
.modal-confirm { background: #cd5c5c; color: white; } /* Červená pro smazání/zamítnutí */
.modal-cancel { background: transparent; border: 1px solid var(--border-color); color: white; }

/* =======================================================
   8. Media queries
   ======================================================= */

@media (max-width: 768px) {
    .toast-container {
        /* Místo držení se vpravo ukotvíme kontejner i zleva, aby se roztáhl */
        right: 20px;
        left: 20px;
        bottom: 20px;
    }

    .toast {
        /* Notifikace teď zabere 100 % šířky svého kontejneru */
        width: 100%; 
        box-sizing: border-box; /* Zajistí, aby padding nerozbil šířku */
        padding: 12px 20px; /* Na mobilu můžeme trošku zmenšit vnitřní okraje */
        font-size: 14px; /* O něco menší písmo pro menší displeje */
    }

    .modal-content {
        padding: 20px; /* Menší vnitřní okraje, aby zbylo víc místa na text */
        width: 95%;    /* Na úplně malých mobilech využijeme plochu na maximum */
    }

    .modal-buttons {
        flex-direction: column; /* Tlačítka pod sebou, aby se na ně lépe klikalo palcem */
        gap: 10px;
    }

    .modal-btn {
        width: 100%; /* Tlačítka přes celou šířku jsou na mobilu pohodlnější */
    }
}