/* ===== RESET A ZÁKLADNÍ STYLY =========================================================================== */

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


html, body {
  height: 100%;
  font-family: Arial, sans-serif;  
  color: #fff;
  overflow-x: hidden; 
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
    url('pozadi.jpg');
  background-position: 0px 100px; 
  background-repeat: no-repeat;
  background-attachment:  fixed;   
  background-size: cover; 
  }


/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #000;
  text-align: center;
  padding: 15px 20px;
  z-index: 1001;
  height: 100px;
  border-bottom: 0px solid #333;
}


/* ===== NAVIGACE ===== */
nav {
  position: fixed;
  top: 110px;
  left: 5px;
  width: 220px;
  max-height: calc(100vh - 170px); /* (100vh - 220px) */
  background-color: rgba(0, 0, 0, 0.2);
  padding: 20px;
  overflow-y: auto;
  z-index: 999;
  border: 2px solid #40e0d0;    
  border-radius: 12px;   
}


nav a {
  color: #40e0d0;
  text-decoration: none;
  display: block;
  font-weight: bold;
  margin: 3px 0;
  cursor: pointer;
  transition: color 0.3s;
  padding: 3px 5px;
  border-radius: 3px;
}

nav a:hover {
  color: #5fd3d3;
  background-color: rgba(255,255,255,0.1);
}

nav a.active {
  color: yellow;
  background-color: rgba(255,255,255,0.2);
}


/* ===== NAVIGACE - SUBMENU ===== */
.nav-item {
  position: relative;
}

.submenu {
  display: none;
  background-color: transparent;
  border-left: 3px solid #40e0d0;
  margin-left: 15px;
  padding-left: 10px;
  margin-top: 5px;
  border-radius: 4px;
}

/* Zobrazí submenu po kliknutí */
.nav-item.active .submenu {
  display: block;
}

.submenu a {
  color: #87ceeb !important;
  font-size: 0.9em;
  margin: 2px 0;
}

.submenu a:hover {
  color: #40e0d0 !important;
}

.nav-item:has(.submenu) > a::after {
  content: "  ▼";
  color: #faac05;
  font-size: 0.8em;
  transition: transform 0.3s ease;
}


/* ===== HLAVNÍ CONTAINER ===== */
.container {
  display: flex;
  min-height: 100vh;
  padding-top: 120px;   

  /*  přesunuto do:  html, body {}
  background-image: 
   linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
   url('pozadi.jpg');
  background-position: 0px 120px; 
  background-repeat: no-repeat;
  background-attachment:  fixed;   
  background-size: cover; 
  */
}


/* ===== HLAVNÍ OBSAH STRÁNKY===== */
#content {
  flex: 1;
  margin-left: 200px;
  margin-bottom: 40px;
  position: relative;  
  min-height: calc(100vh - 160px);
  min-width: 0; /* OPRAVA: bez tohoto se #content jako flex položka nesmí
                   zmenšit pod přirozenou šířku svého nejširšího vnořeného
                   obsahu, a roztáhne celou stránku mimo obrazovku
                   (přesně to způsobovalo přetékání na 768-980px) */
}


main {
  position: relative;  
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 40px 20px;
  color: #fff;
  width: 100%;
  min-height: calc(100vh - 160px);     
}


/* ===== FOOTER ===== */
footer {
  position: fixed;  /* Zachováváme fixed positioning */
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background-color: #000;
  text-align: center;
  font-size: 0.9em;
  color: #ccc;
  line-height: 40px;
  z-index: 1000;
  border-top: 0px solid #333;
}

/* Skrytá oblast pro kliknutí v pravé části */
footer .hidden-click-area {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;  /* Šířka klikací oblasti */
  height: 100%;
  background: transparent;
  cursor: default; /* kurzor se nezmění */
  z-index: 1001;
  display: block;  /* Pro správné zobrazení odkazu */
  text-decoration: none;  /* Odstranění podtržení */
  
}

/* Pro debugging - odkomentujte pro zobrazení oblasti */
/*
 footer .hidden-click-area:hover {
  background-color: rgba(255, 0, 0, 0.2);
}
*/



/* ================ Další (ZÁKLADNÍ) STYLY ==================================================================== */


/* ===== BAREVNOST ODKAZŮ ===== */
/* navštívené odkazy stejnou barvou jako nenavštívené (dřív oranžová) */
main a:link,
main a:visited { color: #28a745; }
main a:hover { color: #20c997; }
main a:active { color: #e8590c; }

/* ===== NADPISY ===== */
h1 { color: yellow; }
h2 { color: #da70d6; }
h3 { color: #32cd32; }

/* ===== UTILITY TŘÍDY ===== */
.bold-CAL {
  font-weight: bold;
  color: #40e0d0;
}

.center-pink {
  color: #DA70D6;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 20px auto;
  font-size: 1.8em;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.center-red {
  color: #ff4444;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  font-size: 2.0em;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
  line-height: 1.2;
}

.odkaz-zluty {
  text-decoration: none;
  color: inherit; /* převezme barvu z rodiče (h2) */
  transition: color 0.3s ease;
}

.odkaz-zluty:hover {
  color: yellow !important; /* při najetí žlutá */
}

.odkaz-zluty:visited {
  color: inherit;
}

/* ===== HLAVNÍ OBSAH STRÁNKY ===== */
main p {
  font-size: 1.1em;
  line-height: 1.6;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  max-width: 800px;
  margin: 15px auto;
  text-align: left;
}


/* ===== MENU TOGGLE PRO MOBIL ===== */
.menu-toggle {
  display: none;  
  margin-top: 10px;
  background: none;
  color: #40e0d0;
  border: 2px solid #40e0d0;
  padding: 8px 14px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
  z-index: 1002;
  position: relative;
  pointer-events: auto;
}

.menu-toggle:hover {
  background-color: #40e0d0;
  color: #000;
}



/* ===== CONTEST LOG VIEWER ===== */
main:has(.contest-log-viewer) {
  max-width: 1200px !important;
  margin: 0 auto;
}

/* ===== PROJEKTY A DALŠÍ SEKCE ===== */
.project, .fotogalerie, .archiv {
  background-color: rgba(255,255,255,0.05);
  border: none;
  border-radius: 8px;
  padding: 15px;
  margin: 20px auto;
  max-width: 600px;
  text-align: center;
  overflow-x: auto; 
}

.project img, .fotogalerie img, .archiv img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 10px 0;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.project p, .archiv p {
  text-indent: 20px;
  margin-bottom: 1.2em;
  line-height: 1.5;
  text-align: left;
}

/* ===== ČLENOVÉ RADIOKLUBU - OPRAVENÁ LAYOUT ===== */
.members-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.operator {
  background-color: rgba(255,255,255,0.08);
  border: none;
  border-radius: 12px;
  padding: 25px;
  margin: 30px auto;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.operator:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  border-color: #40e0d0;
}

.operator img:not(.overlay) {
  width: 300px; /*190px;*/
  height: auto; /*270px;*/
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.7);
  flex-shrink: 0;
  margin-bottom: 15px;
  border: 2px solid #555;
  transition: border-color 0.3s ease;
}

.operator:hover img {
  border-color: #40e0d0;
}

.operator-content {
  margin-top: 15px;
}

.operator-content h3 {
  color: #32cd32;
  font-size: 1.4em;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.operator-content p {
  color: #ccc;
  text-align: center;
  font-size: 1.1em;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* ===== TABULKY ===== */
table {
  margin: 20px auto;
  border: none;
  border-collapse: collapse;
  width: auto;
  max-width: 100%;
}

table th,
table td {
  padding: 4px 8px;
  text-align: center;
  border: none;
  border-collapse: collapse;
  vertical-align: middle;
  line-height: 1.2;
}

table th:first-child,
table td:first-child {
  text-align: left;
}

/* Speciální styly pro contest tabulky */
.contest-table th,
.contest-table td {
  padding: 2px 6px;
  font-size: 0.9em;
}

.centered-table {
  margin: 20px auto;
  border-collapse: collapse;
}

.centered-table th,
.centered-table td {
  padding: 4px 8px;
  text-align: center;
  border: none;
  border-collapse: collapse;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap; 
}

.centered-table th:first-child,
.centered-table td:first-child {
  text-align: left;
  border: none;
  border-collapse: collapse;
}

/* ===== DEBUG OKNO - OPRAVA Z-INDEX ===== */
.debug-container,
.login-form,
.debug-overlay {
  position: fixed;
  z-index: 500 !important; /* Nižší než menu tlačítko a navigace */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  max-width: 400px;
  width: 90%;
}

/* Pokud je debug okno backdrop, nesmí blokovat menu */
.debug-backdrop,
.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 498 !important; /* Nižší než všechny menu prvky */
  pointer-events: none; /* Nezablokovat pointer events na header */
}

.debug-backdrop > *,
.overlay-backdrop > * {
  pointer-events: auto; /* Znovu povolit na child elementech */
}

/* Debug minimalizované tlačítko */
.debug-minimized {
  position: fixed;
  top: 10px;
  right: 60px; /* Vedle menu tlačítka */
  width: 40px;
  height: 40px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.debug-minimized:hover {
  background: #0056b3;
}

.debug-container.minimized {
  display: none;
}

.debug-container.active {
  display: block;
  z-index: 500;
}


/* VARIANTA A: pulzující stmívání */
.nadpis-pulz {
    text-align: center;
    font-size: 52px;
    font-weight: bold;
    color: #14ffec;
    animation: stmivani 3s ease-in-out infinite;
}
@keyframes stmivani {
    0%   { opacity: 1; }
    50%  { opacity: 0.3; }
    100% { opacity: 1; }
}

/* VARIANTA B: tyrkysový gradient zprava doleva */
.nadpis-gradient {
    text-align: center;
    font-size: 52px;
    font-weight: bold;
    background: linear-gradient(90deg, #0d7377, #14ffec, #0d7377, #14ffec, #0d7377);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: barvy 6s linear infinite;
}
@keyframes barvy {
    0%   { background-position: 300% center; }
    100% { background-position: 0% center; }
}

/* ===== RESPONSIVE DESIGN ============================================================================================================================== */

@media (max-width: 768px) {
  /* Pozadí pro mobilní zařízení */
  html, body {
    background-attachment: scroll !important; /* Změna z fixed na scroll */
    background-size: cover !important;
    background-position: center !important;
  }
  

  header {
    height: 120px; /* Zvětšení výšky pro lepší rozmístění */
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.95); /* Silnější pozadí pro mobil */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }
  
  header h1 {
    margin-bottom: 0;
    font-size: 1.2em; /* Menší nadpis na mobilu */
  }
  
  .menu-toggle {
    display: block;
    margin-top: 5px;
    background: none;
    color: #40e0d0;
    border: 2px solid #40e0d0;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    z-index: 1002 !important;
    position: relative !important;
    pointer-events: auto !important;
  }
  
  nav {
    display: none;
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    width: 260px;
    background-color: rgba(0,0,0,0.95);
    max-height: calc(100vh - 160px);
    border-right: none;
    border-bottom: 1px solid #333;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 999 !important;
  }

  nav.active {
    display: block;   
    width: 260px;
    transform: translateY(0);
    opacity: 1;
  }
  
  /* Desktop hover efekt pro submenu 
  .nav-item:hover .submenu {
    display: block;
  }
  */
  
  .container {
    padding-top: 120px; /* Stejné jako výška headeru */
    background-position: 0px 120px;
  }
  
  #content {
    margin-left: 0;
    /*  Zajištění že content pokryje celou šířku */
    width: 100vw;
    min-width: 100vw;
  }
  
  main {
    position: relative;  
    top: 0px;
    left: 0px;
    padding: 20px 15px; /* Více padding pro obsah */    
    background: rgba(0, 0, 0, 0.4); /* Jemnější overlay pro mobil */
    /* Zajištění že main pokryje celou šířku */
    width: 100%;
    min-width: 100vw;
    margin: 0;
    box-sizing: border-box;
  }
  
  .center-pink {
    font-size: 1.4em;
    margin-top: 25px; /* Přidání odsazení od menu tlačítka */
    padding-top: 10px;
  }
  
  .center-red {
    font-size: 2.0em;
  }
  
  main img {
    max-width: 95%;
  }

  /* Členové - mobilní optimalizace */
  .members-container {
    padding: 10px;
  }
  
  .operator {
    margin: 20px auto;
    padding: 20px;
    max-width: none;
  }

  .operator img:not(.overlay) {
   width: 300px; /*190px;*/
   height: auto; /*270px;*/
  }

  .operator-content h3 {
    font-size: 1.1em;
  }

  .operator-content p {
    font-size: 0.95em;
  }
  
  /* Animace submenu na mobilu */
  .submenu {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .nav-item.active .submenu {
    display: block;
    max-height: 200px;
  }

  /* Debug okno - mobilní úpravy */
  .debug-container,
  .login-form {
    top: 60% !important; /* Posunout níž aby nezakrývalo header */
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    z-index: 500 !important;
  }

  .debug-minimized {
    top: 15px;
    right: 15px;
    z-index: 900;
  }



  
}
