/* ============================================
   SPA LAYOUT STYLES - SIDEBAR & CAROUSEL
   ============================================ */

/* General SPA Layout */
body.spa-layout {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Top Header (Simplified) */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(106, 61, 232, 0.03);
}

/* Linha inferior do header removida */
.top-header::before {
  content: none;
}

.top-header-container {
  width: 100%;
  height: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-header .logo {
  height: 50px;
  display: flex;
  align-items: center;
  margin-left: 15px;
}

.top-header .logo:hover {
  scale: 1.2;
  transition: all 0.3s ease;
}

.top-header .logo img {
  height: 100%;
  width: auto;
}

.header-info {
  display: flex;
  align-items: center;
  margin-right: 15px;
  gap: 15px;
}

.players-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(106, 61, 232, 0.2);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-color);
}

.players-count i {
  color: var(--primary-light);
}

/* User Account Dropdown */
.user-account {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(106, 61, 232, 0.2);
  border-radius: 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.account-button:hover {
  background: rgba(106, 61, 232, 0.4);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(26, 26, 46, 0.98);
  border: 1px solid rgba(106, 61, 232, 0.3);
  border-radius: 10px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.user-account:hover .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

.account-dropdown a:hover {
  background: rgba(106, 61, 232, 0.2);
  color: var(--text-color);
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 10px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  width: 80px;
  background: rgba(106, 61, 232, 0.08);
  z-index: 900;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  transition: width 0.3s ease;
}

/* Linha lateral estilizada */
.sidebar-nav::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(120, 80, 255, 0.8) 0%,
    rgba(120, 80, 255, 0.5) 40%,
    rgba(120, 80, 255, 0.2) 70%,
    transparent 100%
  );
}

.sidebar-nav:hover {
  width: 220px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  gap: 5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    var(--accent-color)
  );
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: rgba(106, 61, 232, 0.15);
  color: var(--text-color);
}

.sidebar-item:hover::before,
.sidebar-item.active::before {
  transform: scaleY(1);
}

.sidebar-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(81, 37, 201, 0.4);
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar-item:hover .sidebar-icon,
.sidebar-item.active .sidebar-icon {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  box-shadow: 0 5px 15px rgba(106, 61, 232, 0.4);
  transform: scale(1.1);
}

.sidebar-icon i {
  font-size: 1.3rem;
}

.sidebar-label {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-nav:hover .sidebar-label {
  opacity: 1;
}

/* SPA Wrapper */
.spa-wrapper {
  margin-left: 80px;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Page Carousel Container */
.page-carousel-container {
  width: 100%;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-carousel {
  width: 100%;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.carousel-page {
  width: 100%;
  display: none;
  flex-direction: column;
  flex: 1;
}

.carousel-page.active {
  display: flex;
}

/* Animações de transição de página (usadas pelo JS) */
.carousel-page.slide-out-left,
.carousel-page.slide-out-right,
.carousel-page.slide-in-left,
.carousel-page.slide-in-right {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Page Content */
.page-content {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

/* Loading Overlay */
.page-loading {
  position: fixed;
  top: 60px;
  left: 80px;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.page-loading.active {
  opacity: 1;
  visibility: visible;
}

.page-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(106, 61, 232, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(106, 61, 232, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(106, 61, 232, 0.4);
}

.mobile-menu-toggle i {
  font-size: 1.3rem;
  color: var(--text-color);
}

/* Footer adjustments for SPA */
.site-footer {
  width: 100%;
}

/* Sidebar Auth - hidden on desktop */
.sidebar-auth {
  display: none;
}

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

@media (max-width: 1024px) {
  .top-header-container {
    padding: 0 20px 0 90px;
  }

  .sidebar-nav {
    width: 70px;
  }

  .spa-wrapper {
    margin-left: 70px;
  }

  .page-loading {
    left: 70px;
  }
}

@media (max-width: 768px) {
  .top-header-container {
    padding: 0 15px;
    width: 100%;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Sidebar mobile - Hidden by default */
  .sidebar-nav {
    transform: translateX(-100%);
    width: 250px;
    transition: transform 0.3s ease;
  }

  .sidebar-nav.mobile-open {
    transform: translateX(0);
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sidebar-nav.mobile-open .sidebar-label {
    opacity: 1;
  }

  .spa-wrapper {
    margin-left: 0;
  }

  .page-loading {
    left: 0;
  }

  /* Header Info responsive */
  .players-count span {
    display: none;
  }

  /* Esconder auth do header no mobile */
  .header-info .auth-buttons,
  .header-info .user-account {
    display: none;
  }

  /* Mostrar auth na sidebar no mobile */
  .sidebar-auth {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(106, 61, 232, 0.2);
  }
}

@media (max-width: 480px) {
  .top-header {
    height: 50px;
  }

  .top-header .logo {
    height: 45px;
  }

  .spa-wrapper {
    margin-top: 50px;
  }

  .page-loading {
    top: 50px;
  }

  .spa-wrapper {
    min-height: calc(100vh - 50px);
  }

  .auth-buttons {
    gap: 5px;
  }

  .header-info {
    gap: 10px;
  }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 850;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }
}
