/* =============================
   RESET + ZÁKLAD
   ============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  color: #333;
}

/* =============================
   HEADER (mobile-first)
   ============================= */
header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: #007BFF;
  color: white;
  padding: 1rem;
}

#nazev_aplikace {
  width: 100%;
  text-align: center;
  margin-bottom: 0.75rem;
}

#nazev_aplikace h1 {
  font-size: 1.4rem;
  font-weight: bold;
  color: white;
}

#nazev_aplikace span {
  font-weight: 300;
  margin-left: 0.3rem;
}

#nazev_aplikace small {
  display: block;
  font-size: 0.7rem;
  color: #e0e0e0;
  margin-top: 0.2rem;
}

/* =============================
   MENU + PŘIHLÁŠENÍ (mobile-first)
   ============================= */
.menu,
.prihlaseni_registrace {
  width: 100%;
}

.menu > ul,
.prihlaseni_registrace > ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1rem;
}

.menu > ul > li,
.prihlaseni_registrace > ul > li {
  position: relative;
}

.menu a,
.prihlaseni_registrace a,
.btn-logout {
  color: white;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  font-size: 0.9rem;
}

/* hlavní položky menu */
.menu > ul > li > a {
  display: block;
  padding: 0.5rem 0;
}

/* hover podtržení jen u hlavních položek */
.menu > ul > li > a:hover::after,
.prihlaseni_registrace a:hover::after,
.btn-logout:hover::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: white;
  bottom: 0;
  left: 0;
}

/* aktivní hlavní položka */
.menu > ul > li.aktivni > a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  background-color: white;
  bottom: -2px;
  left: 0;
}

/* =============================
   SUBMENU
   ============================= */
.submenu {
  list-style: none;
  margin-top: 0.25rem;
  margin-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.submenu li a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  color: #eaf4ff;
}

.submenu li a:hover {
  text-decoration: underline;
}

/* =============================
   LOGOUT BUTTON
   ============================= */
.btn-logout {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  margin-left: 0;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  background-color: #ffffff;
  color: #007BFF;
  border-color: #ffffff;
}

.btn-logout:hover::after {
  display: none;
}

/* =============================
   ZPRÁVY (messages)
   ============================= */
.messages {
  list-style: none;
  margin: 1rem 2rem;
}

.messages li {
  border-radius: 5px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.messages .success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

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

/* =============================
   TABULKA API
   ============================= */
#api-table {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto 2rem;
  border-collapse: collapse;
  font-family: inherit;
}

#api-table th,
#api-table td {
  padding: 0.75em 1.5em;
  text-align: left;
  border-bottom: 1px solid #bdc3c7;
}

#api-table thead {
  background-color: #ecf0f1;
}

#api-table thead th {
  color: #2c3e50;
  font-weight: 600;
}

#api-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#api-table tbody tr:hover {
  background-color: #f1f1f1;
}

/* =============================
   BUTTON-GROUP
   ============================= */
.content-header {
  text-align: center;
  margin-bottom: 2rem;
}

.button-group {
  display: inline-flex;
  gap: 1rem;
  margin-top: 1rem;
}

.button-group button {
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5em 1.2em;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#btn-email {
  background-color: #2ecc71;
}

#btn-email:hover {
  background-color: #27ae60;
  transform: translateY(-1px);
}

#btn-phone {
  background-color: #e67e22;
}

#btn-phone:hover {
  background-color: #d35400;
  transform: translateY(-1px);
}

/* =============================
   DESKTOP
   ============================= */
@media (min-width: 1200px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
  }

  #nazev_aplikace {
    width: auto;
    text-align: left;
    margin-bottom: 0;
  }

  #nazev_aplikace h1 {
    font-size: 1.8rem;
  }

  #nazev_aplikace small {
    font-size: 0.8rem;
  }

  .menu,
  .prihlaseni_registrace {
    width: auto;
  }

  .menu > ul,
  .prihlaseni_registrace > ul {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    width: auto;
    margin-bottom: 0;
  }

  .menu > ul > li > a {
    font-size: 1.3rem;
    padding: 0.4rem 0;
  }

  .prihlaseni_registrace a,
  .btn-logout,
  .user-info {
    font-size: 1.2rem;
  }

  .btn-logout {
    margin-left: 1rem;
  }

  .menu > ul > li > a:hover::after,
  .prihlaseni_registrace a:hover::after {
    height: 2px;
  }

  .menu > ul > li.aktivni > a::after {
    height: 4px;
    bottom: -2px;
  }

  /* desktop dropdown */
  .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    margin-left: 0;
    margin-top: 0;
    padding: 0.4rem 0;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    z-index: 1000;
    gap: 0;
  }

  .has-submenu:hover .submenu {
    display: block;
  }

  .submenu li {
    width: 100%;
  }

  .submenu li a {
    color: #333;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    white-space: nowrap;
  }

  .submenu li a:hover {
    background-color: #f2f2f2;
    text-decoration: none;
  }
}