*, *::before, *::after {
  box-sizing: border-box;
}


body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  height: 100%;
  margin: 0;
  padding: 0;
  color: #333;

  /* Přidáme padding na spodní část, aby obsah nekryl footer */
  padding-bottom: 60px; /* Výška footeru + rezerva */
  box-sizing: border-box;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* plynulý scroll na iOS */
}

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

//  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

form label {
  color: #000000;
  background-color: #f7f7f7;
}

 form input[type="text"],
 form input[type="email"],
 form input[type="password"],
 form select,
 form textarea {
  color: #000000;
  background-color: #ffffff;
  font-size: 1rem;
  padding: 10px;
}

form input:focus {
  border-color: #2c3e50;
  outline: none;
box-shadow: 0 0 5px rgba(44, 62, 80, 0.5);
}

/* Dashboard container jako flexbox */
.dashboard-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  max-width: 1200px;
  margin: auto;
}

/* Widgety jako grid s 3 sloupci */
.widgets-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Reklama vedle widgetů */
.ad-zone {
  width: 250px;
  background: #fff;
  border: 1px dashed #aaa;
  padding: 15px;
  height: fit-content;
  border-radius: 8px;
  position: sticky;
  top: 80px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Mobile: přepneme dashboard container na sloupec */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  .widgets-grid {
    grid-template-columns: 1fr !important; /* jeden sloupec */
  }

  .widget-card {
    grid-column: span 1 !important;
  }

  .add-widget-card {
    grid-column: span 3;
  }

  /* Reklama pod widgety, plná šířka */
  .ad-zone {
    width: 100%;
    margin-top: 20px;
    position: static; /* aby nebyla sticky */
    order: 2; /* za widgety */
  }
}

/* Upravené styly pro navigaci a hamburger menu */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2c3e50;
  padding: 10px 20px;
  color: #ecf0f1;
}

/* Obal hamburgeru + menu */
.menu-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Hamburger tlačítko */
.menu-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #ecf0f1;
  cursor: pointer;
  display: none; /* skryté na desktopu */
}

@media (min-width: 769px) {
  .menu {
  min-height: 50px;
  }
}

/* Výchozí menu - viditelné na desktopu */
.menu {
  display: flex;
  align-items: center;
}

.menu ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.menu ul li {
  margin-right: 20px;
}

.menu ul li a {
  color: #ecf0f1;
  text-decoration: none;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.menu ul li a:hover {
  background-color: #34495e;
}

@media (max-width: 480px) {
  .content {
  color: #000000;
  background-color: #ffffff;
  padding: 10px;
}
}

/* Mobilní styl */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .page-container {
    max-width: 100%;
    padding: 0 10px;
  }

  footer {
    max-width: 100%;
    padding: 10px;
    left: 0;
    transform: none;
    width: 100%;
  }

  .content {
    padding: 15px;
    margin: 10px 0;
    max-width: 100%;
    box-shadow: none;
  }

  .menu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    background-color: #2c3e50;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    width: 150px;
    margin-top: 5px;
    flex-direction: column;
  }

  /* Když je menu otevřené */
  .menu.open {
    max-height: 500px; /* dostatečně velká hodnota */
    transition: max-height 0.5s ease-in;
  }

  .menu ul {
    flex-direction: column;
  }
  .menu ul li {
    margin: 10px 0;
  }
}

.widget-card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
}

.widget-controls button {
  background: none;
  border: none;
  font-size: 1rem;
  margin-left: 8px;
  cursor: pointer;
  color: #666;
}

.widget-controls button:hover {
  color: #000;
}

.widget-card.dragging {
  opacity: 0.5;
  border: 2px dashed #aaa;
}

.modal {
  position: fixed;
  z-index: 10;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 300px;
  position: relative;
}

.close {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 20px;
  cursor: pointer;
}

form {
  color: #000000;
  background-color: #f7f7f7;
  margin: 20px auto;
  padding: 20px;
}

form select, form button {
  padding: 10px;
  font-size: 1rem;
  margin-top: 10px;
}

form button {
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

form button:hover {
  background: #34495e;
}

header {
  background-color: #2c3e50;
  padding: 10px 20px;
  min-height: 60px;
  display: flex;
  align-items: center; /* vertikální centrování obsahu */
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

header nav ul li {
  margin-right: 20px;
}

header nav ul li a {
  color: #ecf0f1;
  text-decoration: none;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

header nav ul li a:hover,
header nav ul li a:focus {
  background-color: #34495e;
  outline: none;
}

footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
//  max-width: 960px;
  width: 100%;
  height: 80px;
  padding: 10px 20px;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Aby obsah nebyl pod footerem */
.content {
  flex: 1;
  padding: 20px 30px;
  margin: 20px auto;
  max-width: 900px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background: #fff;
  font-size: 1rem;
  color: #333;
}

.flash {
  margin: 20px auto;
  padding: 10px;
  max-width: 600px;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
}

.flash-error {
  background-color: #e74c3c;
  color: white;
}

.flash-success {
  background-color: #2ecc71;
  color: white;
}

.btn {
  padding: 10px;
  font-size: 1rem;
  margin-top: 10px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
}

.btn:hover {
  background: #34495e;
}

.form-container {
  margin: 20px auto;
  max-width: 600px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

th {
  background-color: #2c3e50;
  color: #ecf0f1;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}