:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --upload: #33cc99;
    --danger: #e74c3c;
    --bg: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    line-height: 1.6;
    font-size: 17px; /* Základní velikost fontu */
}

header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Umožní zalamování na menších obrazovkách */
    gap: 1rem; /* Mezera mezi prvky poi zalamování */
}

h1 {
    margin: 0;
    font-size: clamp(1.2rem, 4vw, 1.5rem); /* Responzivní velikost fontu */
}

.header-subtext {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* Umožní zalamování na menších obrazovkách */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Responzivní tabulky */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
    
}

.class-card, .class-prot {
    list-style: none; 
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    cursor: pointer;
    width: 100%;
}

.class-card a, .class-prot a {
    word-break: break-word; /* Zabrání poeteeení dlouhých URL */
    text-decoration: none;
}

.odkaz {
  font-size: 0.7em;
}

.actions {
    margin-top: 2rem;
    display: flex;
    gap: 50rem;
    flex-wrap: wrap; /* Umožní zalamování tlaeítek */
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: opacity 0.2s;
    text-align: center;
    min-width: 120px; /* Minimální šíoka pro lepší použitelnost na dotykových zaoízeních */
}


.protokol-nazev {
    color: rgba(229, 0, 0, 1.0);
    font-weight: bold; /* tuené písmo */
    font-size: 20px; /* velikost písma */
}

.upload-form {
    margin: 1rem auto;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: var(--accent);
}

.btn-add_stud {
    background: rgb(0,204,102); /* Zelené tlaeítko */
}

.btn-edit_stud {
    background: rgb(230,135,50); /* Oranžové tlaeítko */
    margin-left: auto;
    display: block;
    text-align: right;
}

.btn-upload {
    background: var(--upload);
}

.btn-danger {
    background: var(--danger);
    
}

.btn-smaz {
    background: var(--danger);
    
    min-width: unset;  /* Zruší minimální šíoku */
    width: 10px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.btn-edit {
   background: rgb(230,135,50); /* Oranžové tlaeítko */
    margin-left: auto;
    display: block;
    /* text-align: right;  */
}

.btn-edit_prot {
   background: rgb(230,135,50); /* Oranžové tlaeítko */
    margin-left: auto;
    margin: 50px 00px 10px 0px;
    text-align: left;
}


.delete-wrapper {
    display: inline-block;  /* Zajistí správné chování tlaeítka */
    margin-left: 10px;      /* Posune tlaeítko doprava */
    vertical-align: middle; /* Zarovná ho se souborem */
    float: right;
}

.alert {
   background: rgb(230,135,50); /* Oranžové */
   color: white;
   padding: 10px;
   margin-bottom: 15px;
   border-radius: 5px;
}

.alert-success {
   font-size: 12px;
   background-color: #d4edda;
   color: #155724;
   border: 1px solid #c3e6cb;
}

.alert-danger {
   background-color: #f8d7da;
   color: #721c24;
   border: 1px solid #f5c6cb;
}

/* Styly pro protokol_evaluation.php */
.protokol-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.table {
    margin-top: 20px;
}

.actions {
    margin-top: 20px;
    margin-bottom: 30px;
}

.btn-secondary {
    margin-left: 10px;
}

.total-row {
    background-color: #f0f0f0;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

/* Styly pro updated_protokol_manag.php */
.manage-protocols {
    width: 100%;
    
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 50%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group small {
    display: block;
    color: #6c757d;
    margin-top: 0.25rem;
}

.existing-protocols {          // existujici protokoly
    margin-top: 2rem;
    max-width: 100%;
}

.protocol-year {
    margin-bottom: 2rem;
}

/* Hlavička roku – klikací prvek pro rozbalení / sbalení */
.protocol-year-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #eef2ff;          /* světle modrá, dobrý kontrast s tmavým textem */
    color: #1f2937;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
}

/* Label uvnitř hlavičky roku – zabírá prostor a ořezává dlouhý text */
.protocol-year-label {
    flex: 1;                              /* zabere dostupný prostor mezi šipkou a okrajem */
    display: inline-block;
    align-items: center;
    font-size: 1rem;
    color: inherit;                       /* dědí barvu z rodiče */
    white-space: nowrap;                  /* zabrání zalomení */
    overflow: hidden;                     /* ořízne přetékající text */
    text-overflow: ellipsis;              /* přidá „…“ */
    padding-right: 0.5rem;                /* prostor mezi textem a akcemi/šipkou */
}

/* Šipka před textem roku */
.protocol-year-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #1f2937;
    transition: transform 0.2s ease;
    margin-right: 0.25rem;
}

/* Otevřený stav – šipka otočená dolů */
.protocol-year-toggle.is-open .protocol-year-arrow {
    transform: rotate(180deg);
}

/* Fokus pro přístupnost – viditelný obrys při klávesové navigaci */
.protocol-year-toggle:focus {
    outline: 3px solid rgba(59,130,246,0.25);
    outline-offset: 2px;
}

/* Vnitřek roku (seznam tříd a tabulek) */
.protocol-year-content {
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

/* Jednotlivé třídy v rámci roku */
.protocol-class {
    margin-bottom: 1.5rem;
}

.protocol-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    margin-bottom: 1rem;
}


.protocol-table th, .protocol-table td {
  /* padding: 0.75rem; */
  /* border: 1px solid #ddd; */
  padding: 0.4rem;
  border: 0px solid #ddd;
  width: 300px;
  text-align:left;
}



.protocol-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.no-deadlines {
    color: #dc3545;
    font-style: italic;
}

.has-individual-deadlines {
    color: #28a745;
    font-weight: bold;
}

.deadline-toggle {
    cursor: pointer;
    color: blue;
    text-decoration: underline;
}

.triangular-icon::after {
    
    font-size: 0.8em;
}

.individual-deadlines {
    display: none;
    margin-top: 10px;
    padding: 5px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.individual-deadlines table {
    width: 100%;
    margin-top: 5px;
}

.individual-deadlines th, .individual-deadlines td {
    padding: 5px;
    border-bottom: 1px solid #dee2e6;
}

.hodnoceni-box {
    /* background-color: #CFE3F973;*/
    background-color: #CFFFD75E;
     
}

/* Termin odevydavani protokolu */
.termin-datum {
    color: red;
    font-weight: bold;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    header {
        text-align: center;
        justify-content: center;
    }

    .header-subtext {
        justify-content: center;
        width: 100%;
    }

    .class-card:hover {
        transform: none; /* Vypnutí hover efektu na mobilních zaoízeních */
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .manage-protocols {
        max-width: 95%;
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0.5rem;
    }

    .class-card, .class-prot {
        padding: 0.75rem;
    }
}

/* Vylepšení pro dotykové ovládání */
@media (hover: none) {
    .btn, .class-card, .class-prot {
        cursor: default;
    }

    .btn:active, .class-card:active, .class-prot:active {
        opacity: 0.7;
    }
}



/* Poidané styly pro poihlašovací stránku - vylepšená verze */
.login-container {
    max-width: 400px; /* Užší kontejner na PC */
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form {
    width: 100%;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
}

/* Responzivita pro mobilní zaoízení */
@media screen and (max-width: 768px) {
    .login-container {
        max-width: 90%;
        padding: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .login-form input {
        font-size: 16px; /* Optimální velikost pro dotyková zaoízení */
        padding: 12px;
    }
    
    .login-btn {
        padding: 14px;
    }
}



/* Styly pro dashboard a formuláo pro nahrávání protokolu */

/* Obecné responzivní úpravy */
.dashboard-container {
    max-width: 900px;
    margin: 1rem auto;
}

.container {
    padding: 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Vylepšení seznamu toíd */
.classes-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.class-card {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.class-card a {
    display: block;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Formuláo pro nahrávání protokolu */
.upload-form {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 700px;
}

.protocol-form .form-group {
    margin-bottom: 1.5rem;
}

.protocol-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.protocol-form select,
.protocol-form input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.protocol-form select {
    height: 45px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

/* Styled file input */
.protocol-form input[type="file"] {
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.protocol-form input[type="file"]::-webkit-file-upload-button {
    visibility: hidden;
    width: 0;
}

.protocol-form input[type="file"]::before {
    content: 'Vybrat soubor';
    display: inline-block;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    padding: 8px 16px;
    margin-right: 10px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
}

.alert-error {
    background-color: #f8d7da;
    ylo :?721c24;
    border: 1px solid #f5c6cb;
}

/* Responzivní úpravy pro mobilní zaoízení */
@media screen and (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        text-align: center;
    }
    
    /* Zlepšení náhledu na menších obrazovkách */
    .upload-form {
        padding: 1rem;
    }
    
    h2, h3 {
        font-size: 1.4rem;
    }
}

@media screen and (max-width: 480px) {
    .protocol-form input[type="file"]::before {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .upload-form {
        padding: 0.75rem;
    }
}


/* Neutrální oranžová varianta tlaeítka bez layoutových vedlejších efektu */
.btn-orange {
  background: rgb(230,135,50); /* stejná barva jako Editace studenta */
}

/* Skupina hlavních akčních tlačítek na dashboardu učitele */
.teacher-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Vzhled tlačítek v této skupině – jemný rámeček a stín */
.teacher-actions .btn {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.teacher-actions .btn:hover {
  opacity: 0.95;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}


/* Podbarvení položek protokolu podle povinnosti */
.class-prot.required  {
  background: #fff5f5;              /* velmi svitlá eervená */
  border-left: 4px solid var(--danger);
}

.class-prot.optional  {
  background: #eef6ff;              /* velmi svitlá modrá */
  border-left: 4px solid var(--accent);
}


/* Extra spacing for "Seznam uživatelu" table v manage_students.php */
/*  */
.users-table th,
.users-table td {
  padding-right: 1.5rem !important; /* horizontal spacing between columns */
  padding-left: 0.75rem !important;
}

/* Slightly tighter left padding so text nezaeíná moc daleko od okraje */
.users-table th:first-child,
.users-table td:first-child {
  padding-left: 0.75rem !important;
}