/* Layout.css - Layout és sidebar stílusok */

/* Egységes címsor stílusok */
.page-header {
  margin-bottom: var(--spacing-lg);
}

.page-header .breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: var(--spacing-sm);
}

.page-header .breadcrumb-item {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.page-header .breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.page-header .breadcrumb-item.active {
  color: var(--text-secondary);
}

.page-header .page-title {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.page-header .page-title i {
  color: var(--primary-color);
  margin-right: var(--spacing-md);
  font-size: 1.5rem;
}

.page-header .page-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Sidebar - Fekete háttér, modern menü stílus */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--dark-color);
  border-left: none;
  border-right: 1px solid var(--border-color);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding-top: 30px;
  z-index: 1030;
  transition: left var(--transition-normal), right var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar .nav {
  flex: 1;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#sidebar .nav-link {
  background: transparent;
  color: #fff !important;
  font-size: 0.87rem;
  font-weight: 600;
  border-radius: 0;
  margin: 0.1rem 0;
  padding: 0.7rem 1.1rem 0.5rem 1.1rem;
  position: relative;
  box-shadow: none;
  border: none;
  transition: color 0.18s;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
}

#sidebar .nav-link::after {
  content: '';
  display: block;
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2.5px;
  background: #ffd700;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

#sidebar .nav-link.active::after,
#sidebar .nav-link:hover::after {
  transform: scaleX(1);
}

#sidebar .nav-link.active {
  color: #ffd700 !important;
}

#sidebar .nav-link.active::after {
  opacity: 1;
}

#sidebar .nav-link:hover::after {
  opacity: 1;
}

#sidebar .nav-link:hover {
  color: #fff !important;
}

#sidebar .nav-link i {
  margin-right: 0.85rem;
  width: 20px;
  text-align: center;
  font-size: 1.15rem;
  color: #ffffff;
  flex-shrink: 0;
  transition: color 0.18s;
}

#sidebar .nav-link.active i {
  color: #ffd700;
}

#sidebar .nav-link:hover i {
  color: #ffd700;
}

#sidebar .sidebar-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  padding: 1.5rem 1.25rem 1rem 1.25rem;
  letter-spacing: 0.02em;
}

#sidebar .sidebar-header .btn {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
}

/* Sidebar felhasználó rész */
#sidebar .nav {
  flex: 1;
  padding: 0 1rem;
}

#sidebar .sidebar-user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: none;
  padding: 0.7rem 1.1rem 0.7rem 1.1rem;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#sidebar .user-info {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #fff;
  font-size: 0.93rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#sidebar .user-info small {
  font-size: 0.8rem;
  line-height: 1.2;
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
  display: block;
  white-space: normal;
  overflow: hidden;
}

#sidebar .user-info .btn {
  font-size: 0.92rem;
  padding: 0.22rem 0.7rem;
  background: transparent;
  color: #ffd700;
  border-radius: 5px;
  font-weight: 600;
  border: none;
  transition: color 0.18s;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
}
#sidebar .user-info .btn:hover {
  color: #fff;
}

/* Sidebar backdrop */
#sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1029;
  transition: opacity var(--transition-normal);
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-right: 0;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  transition: margin-left var(--transition-normal),
    margin-right var(--transition-normal);
  min-height: 100vh;
  background-color: var(--background-color);
}

/* Mobile burger button (fixed position) */
.mobile-burger-btn {
  position: fixed;
  top: 0.75rem;
  right: 1.25rem;
  z-index: 1040;
  background: rgba(30, 41, 59, 0.95);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
}

.mobile-burger-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mobile-burger-btn:hover {
  background: rgba(20, 30, 45, 0.95);
  box-shadow: 0 4px 16px rgba(30, 41, 59, 0.4);
  transform: scale(1.05);
}

.mobile-burger-btn:active {
  transform: scale(0.95);
  background: rgba(15, 23, 35, 0.95);
}

.mobile-burger-btn i {
  font-size: 1.1rem;
}

/* Mobile header (deprecated - kept for compatibility) */
.mobile-header {
  display: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  background: var(--card-background);
}

.mobile-header .d-flex {
  align-items: center;
  justify-content: space-between;
}

/* Footer */
.footer {
  background: var(--dark-color);
  color: white;
  padding: var(--spacing-lg) 0;
  margin-top: 3rem;
  font-size: var(--font-size-sm);
}

.footer h6 {
  color: white;
  margin-bottom: var(--spacing-sm);
}

.footer p {
  margin-bottom: var(--spacing-xs);
}

.footer .text-muted {
  color: var(--text-muted) !important;
}

/* Loading */
.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.loading.show {
  display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Sidebar scrollbar - sötét háttérhez illeszkedő */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 991px) {
  #sidebar {
    left: auto;
    right: -220px;
    transition: right var(--transition-normal), left var(--transition-normal);
  }
  #sidebar.show {
    right: 0;
    left: auto;
  }
  #sidebar-backdrop.show {
    display: block;
  }
  .main-content {
    margin-left: 0;
    margin-right: 0;
  }
  .mobile-header {
    display: block;
  }
  
  /* Tawk.to chat widget elrejtése mobil nézetben, amikor a sidebar zárva van */
  /* A JavaScript megoldás kezeli ezt dinamikusan, ez csak egy backup */
  body:not(.sidebar-open) #tawkchat-container,
  body:not(.sidebar-open) #tawkchat {
    display: none !important;
  }
}

@media (min-width: 992px) {
  #sidebar-backdrop {
    display: none !important;
  }
}

/* Utility osztályok */
.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-1 {
  flex: 1 !important;
}

.mt-auto {
  margin-top: auto !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: var(--spacing-xs) !important;
}

.mb-2 {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-3 {
  margin-bottom: var(--spacing-md) !important;
}

.mt-3 {
  margin-top: var(--spacing-md) !important;
}

.mt-4 {
  margin-top: var(--spacing-lg) !important;
}

.p-3 {
  padding: var(--spacing-md) !important;
}

.pt-4 {
  padding-top: var(--spacing-lg) !important;
}

.text-center {
  text-align: center !important;
}

.text-md-end {
  text-align: right !important;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-lg-block {
  display: block !important;
}

.d-lg-none {
  display: none !important;
}

@media (max-width: 991px) {
  .d-lg-block {
    display: none !important;
  }

  .d-lg-none {
    display: block !important;
  }

  .text-md-end {
    text-align: left !important;
  }
}

/* Sidebar felhasználó rész új stílusok */
.sidebar-user {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 0;
  gap: 0;
}
.user-info {
  padding: 0.7rem 0.5rem 0.3rem 0.5rem !important;
  gap: 0.2rem !important;
}
.sidebar-profile {
  position: relative;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-profile-img {
  margin-bottom: 0.2rem !important;
}
.sidebar-profile-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0;
}
.sidebar-profile-email-tooltip {
  display: none;
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 10;
}
.sidebar-profile:hover .sidebar-profile-email-tooltip,
.sidebar-profile:focus .sidebar-profile-email-tooltip {
  display: block;
}
.sidebar-tokens {
  margin-top: auto;
  padding-bottom: 0.5rem;
}
.sidebar-tokens .d-flex {
  gap: 0.2rem;
}
.sidebar-user .btn {
  padding: 0.22rem 0.7rem !important;
  font-size: 0.95rem !important;
  margin: 0 !important;
  min-width: 32px;
}
.sidebar-user .d-flex.gap-1 {
  gap: 0.3rem !important;
  margin-top: 0.2rem !important;
  margin-bottom: 0.2rem !important;
}

/* Mobilnézeti optimalizációk a sidebar-hoz */
@media (max-width: 991px) {
  /* Csökkentjük a sidebar tetején lévő padding-ot mobilnézetben */
  #sidebar {
    padding-top: 10px;
  }

  /* Csökkentjük a sidebar-header padding-ját mobilnézetben */
  #sidebar .sidebar-header {
    padding: 0.75rem 1rem 0.5rem 1rem;
  }

  /* Csökkentjük a sidebar-user min-height-jét mobilnézetben */
  .sidebar-user {
    min-height: 140px !important;
  }

  /* Optimalizáljuk a user-info padding-ját mobilnézetben */
  .user-info {
    padding: 0.5rem 0.5rem 0.2rem 0.5rem !important;
  }

  /* Csökkentjük a sidebar-tokens padding-ját mobilnézetben */
  .sidebar-tokens {
    padding-bottom: 0.75rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Kisebb font méret a tokenekhez mobilnézetben */
  .sidebar-tokens .text-white {
    font-size: 0.85rem;
  }

  /* Kisebb gombok mobilnézetben */
  .sidebar-tokens .btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }

  /* Kisebb profil ikon mobilnézetben */
  .sidebar-profile-img {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.5rem !important;
  }

  /* Kisebb név font méret mobilnézetben */
  .sidebar-profile-name {
    font-size: 0.9rem !important;
  }
}
