/*
 * Spolocne UI styly studentskeho webu.
 *
 * Palety:
 * 1. UI paleta: pozadie, plochy, text, okraje a tiene.
 * 2. Tlacidlova paleta: zelene ovladacie prvky — nemenit bez vizualnej revizie.
 * 3. SQL paleta: programatorske farby — nemenit.
 */
:root {
    /* UI paleta — tieto hodnoty sa mozu menit centralne. */
    --ui-background: #aec1d4;
    --ui-surface: #ffffff;
    --ui-navigation-surface: #f4f7fa;
    --ui-primary: #34495e;
    --ui-heading: #2c3e50;
    --ui-text: #333333;
    --ui-border: #cccccc;
    --ui-border-light: #dddddd;
    --ui-hover-surface: #e0e0e0;
    --ui-code-background: #f1f1f1;
    --ui-login-background: rgba(255, 255, 255, 0.85);
    --ui-card-shadow: rgba(0, 0, 0, 0.05);
    --ui-login-shadow: rgba(0, 0, 0, 0.3);

    /* Tlacidlova paleta — zachovana z povodneho webu. */
    --button-green: #2ecc71;
    --button-green-hover: #27ae60;

    /* Programatorska syntax paleta pre lokalny editor. */
    --code-keyword: #0074d9;
    --code-function: #2ecc40;
    --code-type: #ff851b;
    --code-value: #b10dc9;
    --code-comment: #59636e;
}

/* ====== ZAKLAD ====== */
body {
    font-family: Arial, sans-serif;
    background-color: var(--ui-background);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

h2 {
    color: var(--ui-heading);
}

/* ====== HLAVICKA A NAVIGACIA ====== */
header {
    background-color: var(--ui-primary);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
}

nav a {
    color: var(--button-green);
    text-decoration: none;
    font-weight: bold;
}

.nav-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.nav-row .dropdown {
    flex: 1;
}

.dropdown-toggle {
    width: 100%;
    background-color: var(--button-green);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-align: center;
}

.dropdown-toggle:hover {
    background-color: var(--button-green-hover);
}

.dropdown-content {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.dropdown-content.open {
    display: flex;
}

.dropdown-content a {
    background-color: var(--ui-surface);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ui-heading);
    transition: background-color 0.2s ease;
    border: 1px solid var(--ui-border);
}

.dropdown-content a:hover {
    background-color: var(--ui-hover-surface);
}

.nav-back {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.back-button {
    text-align: center;
    text-decoration: none;
    max-width: calc(100% - 100px);
    width: 100%;
    padding: 12px;
}

/* ====== HLAVNY OBSAH ====== */
main {
    background: var(--ui-surface);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--ui-card-shadow);
}

main section {
    background-color: var(--ui-surface);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--ui-card-shadow);
    margin-bottom: 30px;
}

/* ====== ULOHY A MATERIALY ====== */
.uloha {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border-light);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px var(--ui-card-shadow);
}

.zadanie,
.analyza-zadania,
.riesenie,
.analyza-riesenia {
    margin-top: 10px;
}

pre {
    background-color: var(--ui-code-background);
    padding: 10px;
    overflow-x: auto;
    border-radius: 4px;
}

code {
    font-family: Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* SQL/programatorska paleta — nemenit. */
.sql-keyword {
    color: #0074D9;
    font-weight: bold;
}

.sql-function {
    color: #2ECC40;
    font-weight: bold;
}

.sql-table {
    color: #FF851B;
    font-weight: bold;
}

.sql-column {
    color: #B10DC9;
    font-weight: bold;
}

.download-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: var(--button-green);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.download-button:hover {
    background-color: var(--button-green-hover);
}

/* ====== PATICKA ====== */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--ui-text);
    font-size: 0.9em;
}

/* ====== ROZMAZANE POZADIE PRI LOGIN ====== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.bg-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: blur(8px);
    -webkit-filter: blur(8px);
    pointer-events: none;
}

.bg-container.clear iframe {
    filter: none;
    -webkit-filter: none;
    pointer-events: auto;
}

/* ====== PRIHLASOVACI FORMULAR ====== */
.login-form {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ui-login-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--ui-login-shadow);
    max-width: 300px;
    width: 100%;
    box-sizing: border-box;
}

.login-form h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--ui-heading);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    box-sizing: border-box;
}

.login-form input[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: var(--button-green);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.login-form input[type="submit"]:hover {
    background-color: var(--button-green-hover);
}

@media (max-width: 700px) {
    body {
        padding: 10px;
    }

    .nav-row {
        flex-direction: column;
        gap: 10px;
    }
}
