/* 🌍 ZÁKLADNÝ ŠTÝL */
body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    margin: 0;
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.page-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 40px;
    background: transparent;
    text-align: center;
}

h2, h3 {
    text-align: center;
    margin: 20px 0 10px 0;
}

/* 📋 TABUĽKY */
table {
    border-collapse: collapse;
    width: 90%;
    max-width: 900px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 20px auto 30px auto;
    text-align: left;
    transition: background-color 0.35s ease, color 0.35s ease;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    transition: color 0.3s ease;
}

th {
    background-color: #0078d4;
    color: #fff;
}

tr:hover { background-color: #f1f1f1; }

/* 📄 FORMULÁRE */
form {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 900px;
    margin: 0 auto 40px auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: left;
    transition: background-color 0.35s ease, color 0.35s ease;
}

textarea {
    width: 100%;
    height: 150px;
    font-family: Consolas, monospace;
    white-space: pre-wrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input[type=text], input[type=number] {
    padding: 10px;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input[type=submit], button {
    padding: 10px 20px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.25s ease, transform 0.1s ease;
}

/* 🎨 FAREBNÉ TLAČIDLÁ */
.btn-blue { background-color: #0078d4; }
.btn-blue:hover { background-color: #005fa3; }
.btn-green { background-color: #28a745; }
.btn-green:hover { background-color: #218838; }
.btn-gray { background-color: #6c757d; }
.btn-gray:hover { background-color: #555; }
.delete-btn { background-color: #d9534f; }
.edit-btn { background-color: #28a745; }

/* 🔹 TLAČIDLÁ – ROZBALOVANIE */
.toggle-btn {
    cursor: pointer;
    font-size: 16px;
    padding: 3px 8px;
    background-color: #0078d4;
    color: white;
    border-radius: 4px;
    border: none;
    transition: background-color 0.2s, transform 0.15s;
}
.toggle-btn:hover {
    background-color: #005fa3;
    transform: scale(1.05);
}

td.actions { display: flex; gap: 10px; }

/* 📦 HORNÝ PANEL */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto 30px auto;
    width: 100%;
}

/* 🔍 VYHĽADÁVANIE */
#searchInput {
    display: block;
    margin: 0 auto 10px auto;
    width: 100%;
    max-width: 600px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 6px rgba(0,120,212,0.4);
}

/* 🟦 MODÁLNE OKNO */
#editModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}
#editModal.active { display: flex; opacity: 1; }

#editModal .modal-content {
    position: relative;
    background: #ffffff;
    width: 90%; height: 90%;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transform: scale(0.95);
    transition: transform 0.25s ease-in-out, background-color 0.35s ease, color 0.35s ease;
}
#editModal.active .modal-content { transform: scale(1); }

#editModal button[type="submit"] {
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
#editModal button[type="submit"]:hover {
    background-color: #218838;
    transform: scale(1.03);
}
#editModal button[type="submit"]:active { transform: scale(0.98); }

#editModal .close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #444;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}
#editModal .close-btn:hover { color: #d9534f; }

/* 🧾 Flexibilná výška editovacej oblasti */
#editModal .editable-area {
    min-height: 400px;   /* minimálna výška – aby nebolo malé okno */
    max-height: 70vh;    /* maximálna výška – nech sa nezväčší príliš */
    overflow-y: auto;    /* scrollbar, ak text presiahne výšku */
    resize: vertical;    /* možnosť manuálne zväčšiť okno */
    padding: 10px;
    box-sizing: border-box;
}

/* 🟫 DETAILY (Voice Over / rozbalený riadok) */
.details-row {
    background-color: #f9f9f9;   /* svetlý režim – jemné svetlé pozadie */
    animation: fadeIn 0.25s ease;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 🌙 DARK MODE – tmavé pozadie a svetlý text */
body.dark .details-row,
body.dark tr.details-row,
body.dark #data-table tr.details-row td {
    background-color: #1c1c1c !important;  /* tmavé pozadie pre Chrome aj Edge */
    color: #f1f1f1 !important;             /* svetlý text */
    border-top: 1px solid #333 !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 🩶 Zvýraznený text vnútri detailov */
body.dark tr.details-row td span[style*="background-color"],
body.dark tr.details-row td font[style*="background-color"] {
    border-radius: 3px;
    padding: 1px 3px;
    display: inline-block;
    filter: brightness(1.05);
}

/* 🔔 TOAST SPRÁVY */
#toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10000;
}
#toast.show { opacity: 1; }

/* 🔐 LOGIN STRÁNKA */
.login-container {
    width: 360px;
    margin: 80px auto;
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    text-align: center;
}

.login-container h2 {
    color: #0078d4;
    margin-bottom: 25px;
    font-size: 1.6em;
}

.login-container .error {
    color: #d9534f;
    background: #ffe5e5;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 🎨 WYSIWYG EDITOR */
.color-toolbar {
    margin: 10px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    background: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 8px;
}

/* 🌙 DARK MODE */
body.dark {
    background-color: #121212;
    color: #e0e0e0;
}
body.dark table { background-color: #1e1e1e; color: #e0e0e0; }
body.dark th { background-color: #333; color: #fff; }
body.dark tr:hover { background-color: #242424; }
body.dark input, body.dark textarea {
    background-color: #2b2b2b;
    color: #fff;
    border: 1px solid #444;
}
body.dark form {
    background-color: #1f1f1f;
    color: #e0e0e0;
}
body.dark .toggle-btn { background-color: #3391ff; }
body.dark .toggle-btn:hover { background-color: #4aa3ff; }

/* 🧠 DARK MODE – fix pre editor a modal */
body.dark #editModal .modal-content {
    background-color: #1b1b1b;
    color: #e0e0e0;
    border: 1px solid #333;
}
body.dark .editable-area {
    background-color: #2b2b2b;
    color: #fff;
    border: 1px solid #555;
}
body.dark .color-toolbar {
    background: #1e1e1e;
    border: 1px solid #444;
}
body.dark .color-btn, body.dark .format-btn, body.dark .clear-btn {
    background: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #555;
}
body.dark .color-btn:hover, body.dark .format-btn:hover, body.dark .clear-btn:hover {
    background: #3a3a3a;
}

/* 🌙 FINAL FIX – funkčné zvýraznenie farieb v dark mode (Chrome, Edge, Firefox) */

/* Základ – zobrazenie inline farieb */
body.dark .editable-area span[style*="background-color"],
body.dark .editable-area font[style*="background-color"],
body.dark .details-row span[style*="background-color"],
body.dark .details-row font[style*="background-color"] {
    background-image: none !important;
    background-blend-mode: normal !important;
    mix-blend-mode: normal !important;
    isolation: isolate !important;
    opacity: 1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    filter: brightness(1.05);
}

/* 🟨 Žltá a khaki – čierny text */
body.dark span[style*="background-color: yellow"],
body.dark span[style*="background-color: khaki"],
body.dark font[style*="background-color: yellow"],
body.dark font[style*="background-color: khaki"],
body.dark span[style*="#ffff00"],
body.dark font[style*="#ffff00"],
body.dark span[style*="rgb(255,255,0)"],
body.dark font[style*="rgb(255,255,0)"] {
    background-color: yellow !important;
    color: #000 !important;
}

/* 🟩 Zelené odtiene – čierny text */
body.dark span[style*="background-color: lightgreen"],
body.dark font[style*="background-color: lightgreen"],
body.dark span[style*="#90ee90"],
body.dark font[style*="#90ee90"],
body.dark span[style*="rgb(144,238,144)"],
body.dark font[style*="rgb(144,238,144)"] {
    background-color: lightgreen !important;
    color: #000 !important;
}

/* 🟦 Modré odtiene – čierny text */
body.dark span[style*="background-color: lightblue"],
body.dark font[style*="background-color: lightblue"],
body.dark span[style*="#add8e6"],
body.dark font[style*="#add8e6"],
body.dark span[style*="rgb(173,216,230)"],
body.dark font[style*="rgb(173,216,230)"] {
    background-color: lightblue !important;
    color: #000 !important;
}

/* 🩶 Voice Over – čitateľné zobrazenie */
body.dark tr.details-row td span[style*="background-color"],
body.dark tr.details-row td font[style*="background-color"] {
    border-radius: 3px;
    padding: 1px 2px;
    display: inline-block;
    filter: brightness(1.1);
}

/* 🔧 Chrome dark mode – obídenie automatickej inverzie */
@media (prefers-color-scheme: dark) {
    body.dark span[style*="background-color"],
    body.dark font[style*="background-color"] {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        background-color: transparent !important;
    }
}

/* 📱 ANDROID FIX – plne funkčné zvýraznenie textu v dark mode (Chrome, Samsung Internet, Edge mobile) */
@media (prefers-color-scheme: dark) and (hover: none) and (pointer: coarse) {
  /* 🛑 Zákaz automatickej inverzie farieb na Android Chrome */
  body.dark .editable-area span[style*="background-color"],
  body.dark .details-row span[style*="background-color"],
  body.dark .editable-area font[style*="background-color"],
  body.dark .details-row font[style*="background-color"] {
      forced-color-adjust: none !important;
      color-adjust: exact !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
      background-image: none !important;
      mix-blend-mode: normal !important;
      opacity: 1 !important;
  }

  /* 🟨 Žltá a khaki – nech má čierny text */
  body.dark span[style*="background-color: yellow"],
  body.dark span[style*="background-color: khaki"],
  body.dark font[style*="background-color: yellow"],
  body.dark font[style*="background-color: khaki"],
  body.dark span[style*="#ffff00"],
  body.dark font[style*="#ffff00"] {
      background-color: yellow !important;
      color: #000 !important;
  }

  /* 🟩 Svetlozelená – nech má tmavý text */
  body.dark span[style*="background-color: lightgreen"],
  body.dark font[style*="background-color: lightgreen"],
  body.dark span[style*="#90ee90"],
  body.dark font[style*="#90ee90"] {
      background-color: lightgreen !important;
      color: #000 !important;
  }

  /* 🟦 Svetlomodrá – nech má tmavý text */
  body.dark span[style*="background-color: lightblue"],
  body.dark font[style*="background-color: lightblue"],
  body.dark span[style*="#add8e6"],
  body.dark font[style*="#add8e6"] {
      background-color: lightblue !important;
      color: #000 !important;
  }

  /* 💡 Donúti Chrome na Androide renderovať pôvodné farby z editora */
  html, body, .editable-area, .details-row {
      color-scheme: only light !important;
  }
}

/* Bonus: zaručí, že desktop aj mobily nepremaľujú zvýraznenia */
body.dark .editable-area [style*="background-color"],
body.dark .details-row   [style*="background-color"] {
  forced-color-adjust: none !important;
}

/* 🛠️ LOGIN FIX – medzera medzi heslom a tlačidlom "Prihlásiť" */
.login-container input[type="password"],
.login-container input[type="text"] {
    margin-bottom: 15px !important;
}

.login-container input[type="submit"],
.login-container button[type="submit"] {
    margin-top: 10px !important;
    display: block;
    width: 100%;
}

/* 📝 PDF tlačidlo – text vždy čierny v light aj dark mode */
.pdf-btn {
    color: #000 !important;
    background-color: #f1f1f1 !important;
    border: 1px solid #ccc !important;
}

.pdf-btn:hover {
    background-color: #e0e0e0 !important;
}

/* 🎬 PREMIÉRY – farebné odlíšenie riadkov */
.premiera-buduca {
    background-color: rgba(0, 120, 212, 0.12); /* jemne modré pozadie */
    color: #0078d4;
    font-weight: 600;
}

.premiera-minula {
    background-color: rgba(40, 167, 69, 0.12); /* jemne zelené pozadie */
    color: #28a745;
    font-weight: 600;
}

/* 🌙 DARK MODE – kontrastné farby */
body.dark .premiera-buduca {
    background-color: rgba(0, 120, 212, 0.25);
    color: #66b3ff;
}

body.dark .premiera-minula {
    background-color: rgba(40, 167, 69, 0.25);
    color: #6ddf8a;
}

/* 🔗 ŠTÝL PRE ODKAZY, ABY VYZERALI AKO TLAČIDLÁ */
a.btn-blue, a.btn-green, a.btn-gray {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.25s ease, transform 0.1s ease;
}

/* 🔹 MODRÉ TLAČIDLO (zoradenie, späť) */
a.btn-blue { background-color: #0078d4; }
a.btn-blue:hover { background-color: #005fa3; }

/* 🟩 ZELENÉ (ak by si použil aj inde) */
a.btn-green { background-color: #28a745; }
a.btn-green:hover { background-color: #218838; }

/* ⚙️ ŠEDÉ – tlačidlo Späť */
a.btn-gray { background-color: #6c757d; }
a.btn-gray:hover { background-color: #555; }

/* 🌙 DARK MODE – mierne zosvetlené farby */
body.dark a.btn-blue { background-color: #3391ff; }
body.dark a.btn-blue:hover { background-color: #4aa3ff; }
body.dark a.btn-gray { background-color: #888; }
body.dark a.btn-gray:hover { background-color: #aaa; }

.btn-red { background-color: #ff0000; }
.btn-red:hover { background-color: #cc0000; }

/* 🟥 YouTube – väčšie editačné okno */
#editModal .modal-content {
    width: 90%;
    max-width: 1000px;
    height: 90%;
    max-height: 90%;
    padding: 40px;
    overflow-y: auto;
}

#editModal textarea {
    width: 100%;
    height: 70vh; /* oveľa väčší priestor pre písanie */
    resize: vertical;
    font-family: Consolas, monospace;
    font-size: 15px;
    line-height: 1.5;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #000;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 🌙 Dark mode */
body.dark #editModal textarea {
    background-color: #2b2b2b;
    color: #fff;
    border: 1px solid #444;
}
/* === 🎨 WYSIWYG toolbar: oprava farieb tlačidiel === */

/* Light mód – čierny text */
.color-toolbar button,
.color-toolbar .format-btn,
.color-toolbar .color-btn {
  color: #000 !important;
  background: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  margin: 2px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Hover efekt pre lepší kontrast */
.color-toolbar button:hover {
  background: #e0e0e0;
}

/* Dark mód – biely text */
body.dark .color-toolbar button,
body.dark .color-toolbar .format-btn,
body.dark .color-toolbar .color-btn {
  color: #fff !important;
  background: #333;
  border-color: #555;
}

body.dark .color-toolbar button:hover {
  background: #444;
}

.youtube-popis {
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 6px;
}
.youtube-popis span {
  padding: 1px 3px;
  border-radius: 3px;
}

/* 🎯 YouTube Popis – fix odsekov a odsadenia */
.youtube-popis p,
.youtube-popis div {
  margin: 0 !important;              /* odstráni medzery medzi odsekmi */
  padding: 0 !important;
  text-indent: 0 !important;         /* zruší prvé odsadenie z Wordu */
  line-height: 1.6;
}

.youtube-popis {
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 6px;
  text-align: left;                  /* zarovná text naľavo */
  font-size: 15px;
  color: inherit;
}

.youtube-popis span {
  padding: 1px 3px;
  border-radius: 3px;
  display: inline;
}

/* 🌓 Dark mode – zachovanie čitateľnosti zvýraznených textov */
body.dark .youtube-popis span[style*="background-color"] {
  filter: brightness(1.05);
}

/* 🚫 Úplný fix – odstránenie Word odsekov a odsadení (aj inline štýly) */
.youtube-popis p,
.youtube-popis div,
.youtube-popis span,
.youtube-popis *[style*="margin-left"],
.youtube-popis *[style*="text-indent"],
.youtube-popis *[style*="padding-left"] {
  margin-left: 0 !important;
  text-indent: 0 !important;
  padding-left: 0 !important;
}

/* 🎯 Text v popise vždy zarovnaný naľavo */
.youtube-popis {
  text-align: left !important;
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 6px;
}

/* 🔔 TOAST OZNÁMENIE */
.toast {
  visibility: hidden;
  min-width: 200px;
  background-color: #4caf50;
  color: white;
  text-align: center;
  border-radius: 10px;
  padding: 10px 16px;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.4s, bottom 0.4s;
}
.toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

.order-indicator {
  font-size: 14px;
  color: gray;
  margin-left: 10px;
}

.add-section form {
  background: var(--box-bg, #f9f9f9);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dark .add-section form {
  background: #2b2b2b;
  color: #eee;
}


/* ===================================================
   📝 ŠTÝL PRE WYSIWYG EDITOR (editor.js)
   =================================================== */
.editable-area {
  min-height: 250px;        /* výška editora */
  max-height: 400px;        /* ochrana pred pretečením */
  overflow-y: auto;         /* umožní posúvanie textu */
  border: 1px solid #ccc;   /* decentný rámik */
  border-radius: 6px;
  padding: 10px;
  font-size: 15px;
  line-height: 1.6;
  background: var(--box-bg, #fff);
  color: var(--text-color, #000);
  white-space: pre-wrap;    /* zachováva zalomenia riadkov */
  transition: all 0.2s ease;
}

.editable-area:focus {
  outline: none;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
  border-color: #007bff;
}

.dark .editable-area {
  background: #333;
  color: #f5f5f5;
  border-color: #555;
}

/* 🟦 Väčšie modálne okno pre Pridať nový záznam */
#addModal .modal-content {
  width: 90%;             /* väčšia šírka */
  max-width: 1000px;      /* horný limit ako pri edit okne */
  height: 90vh;           /* takmer celá výška obrazovky */
  max-height: 90vh;
  padding: 40px;          /* viac priestoru pre text */
  overflow-y: auto;       /* scrollbar ak treba */
}

/* ✍️ Väčšia editačná plocha v okne „Pridať“ */
#addModal .editable-area {
  min-height: 60vh;       /* väčšia výška poľa na písanie */
  resize: vertical;       /* používateľ môže ručne meniť výšku */
  font-size: 15px;
  line-height: 1.5;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #000;
}

/* 🌙 Dark mode úprava */
body.dark #addModal .editable-area {
  background-color: #2b2b2b;
  color: #fff;
  border: 1px solid #444;
}


/* ===============================
   🪶 Jednotný vzhľad Voice Over textu
   =============================== */

/* text vo výpise aj po rozkliknutí (details-row / voice-row) */
.voice-cell,
.details-row td {
  line-height: 1.5 !important;
  font-size: 15px;
  color: var(--text-color, #222);
  white-space: normal !important;
  word-break: break-word;
}

/* odseky a divy vo vnútri Voice Over */
.voice-cell p,
.voice-cell div,
.details-row td p,
.details-row td div {
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  text-indent: 0 !important;
}

/* odstráni medzeru po poslednom odseku */
.voice-cell p:last-child,
.voice-cell div:last-child,
.details-row td p:last-child,
.details-row td div:last-child {
  margin-bottom: 0 !important;
}

/* zvýraznenie textu v hľadaní (aby nebolo krikľavé) */
.voice-cell mark,
.details-row mark {
  background: #fff59d;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* farby pre dark mód */
body.dark .voice-cell,
body.dark .details-row td {
  color: #ddd;
}

body.dark .voice-cell mark,
body.dark .details-row mark {
  background: #555;
  color: #fff;
}

