/* Modern UI CSS pro CMS aplikaci */

/* Základní animace pro komponenty */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Vylepšené základní styly */
body {
  padding: 0;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.main-layout {
  display: flex;
  height: 100vh;
  transition: all 0.3s ease;
}

/* Animované komponenty */
.animated-card {
  animation: fadeIn 0.5s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.animated-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.animated-icon {
  transition: transform 0.3s ease;
}

.animated-icon:hover {
  transform: scale(1.2);
}

.animated-button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.animated-button:hover {
  transform: translateY(-2px);
}

.animated-button::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  transition: all 0.6s ease;
}

.animated-button:hover::after {
  left: 100%;
}

/* Vylepšená navigace */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: #f8f9fa;
  padding: 20px;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.sidebar .nav-item {
  margin-bottom: 5px;
  animation: slideIn 0.5s ease-out;
  animation-fill-mode: both;
}

.sidebar .nav-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar .nav-item:nth-child(2) { animation-delay: 0.2s; }
.sidebar .nav-item:nth-child(3) { animation-delay: 0.3s; }
.sidebar .nav-item:nth-child(4) { animation-delay: 0.4s; }
.sidebar .nav-item:nth-child(5) { animation-delay: 0.5s; }
.sidebar .nav-item:nth-child(6) { animation-delay: 0.6s; }

.sidebar .nav-link {
  color: #495057;
  padding: 10px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.sidebar .nav-link i {
  margin-right: 10px;
  transition: all 0.3s ease;
}

.sidebar .nav-link.active {
  color: #0056b3;
  font-weight: bold;
  background-color: rgba(0, 86, 179, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.05);
  transform: translateX(5px);
}

.sidebar .nav-link:hover i {
  transform: scale(1.2);
}

/* Submenu styly */
.nav-item-with-submenu {
  position: relative;
}

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 15px;
  border-left: 2px solid #e9ecef;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.nav-submenu.show {
  max-height: 200px;
  opacity: 1;
}

.nav-submenu .nav-item {
  margin-bottom: 2px;
}

.nav-submenu .nav-link {
  padding: 8px 15px;
  font-size: 0.9em;
  color: #6c757d;
  border-radius: 4px;
  margin-left: 10px;
}

.nav-submenu .nav-link:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.05);
  transform: translateX(3px);
}

.nav-submenu .nav-link.active {
  color: #0056b3;
  background-color: rgba(0, 86, 179, 0.1);
  font-weight: 500;
}

.nav-toggle-icon {
  transition: transform 0.3s ease;
  margin-left: auto;
  font-size: 0.8em;
}

.nav-toggle-icon.rotated {
  transform: rotate(90deg);
}

/* Breadcrumb navigace */
.breadcrumb-nav {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.9em;
}

.breadcrumb-nav .breadcrumb-item {
  color: #6c757d;
}

.breadcrumb-nav .breadcrumb-item.active {
  color: #495057;
  font-weight: 500;
}

.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: #adb5bd;
  margin: 0 8px;
}

.breadcrumb-nav .breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.breadcrumb-nav .breadcrumb-item a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Vylepšené komponenty */
.card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 20px;
  background-color: white;
  animation: fadeIn 0.5s ease-out;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.table {
  margin-bottom: 0;
  width: 100%;
  font-size: 0.9rem;
}

.table th {
  background-color: #007bff;
  color: white;
  font-weight: 600;
  padding: 12px 8px;
  border: none;
  text-align: center;
  white-space: nowrap;
  font-size: 0.85rem;
}

.table td {
  padding: 10px 8px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
  /* Odstraněn transform: scale() - způsoboval trhání UI */
}

/* Formuláře */
.form-control {
  border-radius: 6px;
  border: 1px solid #ced4da;
  padding: 10px 12px;
  transition: all 0.3s ease;
}

/* Barevné motivy */
.bg-light-blue {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-left: 4px solid #2196f3;
}

.bg-light-orange {
  background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
  border-left: 4px solid #ff9800;
}

.bg-light-green {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border-left: 4px solid #4caf50;
}

.card.bg-light-blue:hover,
.card.bg-light-orange:hover,
.card.bg-light-green:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

/* Tlačítka */
.btn {
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Mobilní přepínač menu */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: none;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.mobile-toggle:hover {
  transform: scale(1.1);
  background-color: #0056b3;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.mobile-toggle:active {
  transform: scale(0.95);
}

/* Responzivní design pro tabulky */
.table-responsive {
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dee2e6;
}

/* Tablet breakpoint */
@media (max-width: 1200px) {
  .sidebar {
    width: 200px;
  }
  
  .table {
    font-size: 0.8rem;
  }
  
  .table th,
  .table td {
    padding: 8px 6px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 180px;
  }
  
  .table th,
  .table td {
    padding: 6px 4px;
    font-size: 0.75rem;
  }
  
  .form-control {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* Mobilní zařízení */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    height: 100vh;
    width: 250px;
    z-index: 1500;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    background-color: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease, left 0.3s ease;
  }
  
  .sidebar.show {
    transform: translateX(0);
    left: 0;
  }
  
  .content-area {
    width: 100%;
    margin-left: 0;
  }
  
  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  /* Overlay pro mobilní menu */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* Zmenšené spacing pro mobily */
  .header-section {
    padding: 10px 15px;
  }
  
  .scrollable-content {
    padding: 15px;
  }
  
  .dashboard-card {
    margin-bottom: 15px;
  }
  
  .dashboard-card-header,
  .dashboard-card-body {
    padding: 15px;
  }
  
  /* Tabulky na mobilech */
  .table-responsive {
    border: none;
    box-shadow: none;
  }
  
  .table {
    min-width: 800px; /* Zajistí horizontální scroll */
    font-size: 0.75rem;
  }
  
  .table th {
    padding: 8px 4px;
    font-size: 0.7rem;
    white-space: nowrap;
  }
  
  .table td {
    padding: 6px 4px;
    font-size: 0.75rem;
  }
  
  .table input.form-control {
    min-width: 80px;
    padding: 4px 6px;
    font-size: 0.75rem;
  }
  
  /* Formuláře na mobilech */
  .form-control {
    padding: 10px;
    font-size: 16px; /* Zabrání zoom na iOS */
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 10px;
  }
  
  .btn-group .btn {
    width: auto;
    margin-bottom: 0;
  }
  
  /* Tab navigace na mobilech */
  .nav-pills .nav-link {
    padding: 10px 8px;
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  .nav-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Modaly na mobilech */
  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  .modal-xl {
    max-width: calc(100% - 20px);
  }
}

/* Extra malé mobily */
@media (max-width: 480px) {
  .table {
    min-width: 600px;
    font-size: 0.7rem;
  }
  
  .table th,
  .table td {
    padding: 4px 2px;
  }
  
  .form-control {
    padding: 8px;
  }
  
  .dashboard-card-header,
  .dashboard-card-body {
    padding: 10px;
  }
  
  .btn {
    padding: 10px 16px;
  }
  
  /* Stack columns na velmi malých obrazovkách */
  .row .col-md-3,
  .row .col-md-4,
  .row .col-md-6 {
    margin-bottom: 10px;
  }
}

/* Dashboard karty */
.dashboard-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 20px;
  background-color: white;
  animation: fadeIn 0.5s ease-out;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card-header {
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-card-body {
  padding: 20px;
}

.dashboard-stat {
  text-align: center;
  padding: 15px;
}

.dashboard-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 5px;
}

.dashboard-stat-label {
  color: #6c757d;
  font-size: 0.9rem;
}

/* Animace pro dashboard */
.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }

/* Přizpůsobení pro grafy */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Breadcrumbs navigace */
.breadcrumb {
  background-color: transparent;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: #6c757d;
}

.breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
}

/* == Přidané styly z dashboard.html == */

/* Styly pro přehledové karty (summary cards) */
.summary-card {
    height: 100%;
}

.summary-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #007bff; /* Bootstrap primary color */
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: #343a40; /* Bootstrap dark gray */
    margin-bottom: 5px;
}

.summary-label {
    color: #6c757d; /* Bootstrap secondary text color */
    font-size: 0.9rem;
}

.trend-up {
    color: #28a745; /* Bootstrap success color */
}

.trend-down {
    color: #dc3545; /* Bootstrap danger color */
}

/* Dashboard karty - obecnější styl pro karty s hlavičkou a tělem */
.dashboard-card {
  /* Použijeme existující .card styl z modern.css a jen případně doplníme/přepíšeme */
  /* Většina .dashboard-card stylů z dashboard.html je již pokryta obecným .card */
  /* Animace jsou také z .animated-card nebo .dashboard-card:nth-child */
   background-color: white; /* Ujistíme se, že je pozadí bílé */
}

.dashboard-card-header {
  /* Přizpůsobení existujícího .card-header */
  background-color: #f8f9fa; /* Světle šedé pozadí jako na dashboardu */
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem; /* Odsazení podobné Bootstrap .card-body */
}

.dashboard-card-body {
  /* Použijeme existující .card-body */
  padding: 1.25rem; /* Odsazení podobné Bootstrap .card-body */
}
