/**
 * Layout Styles - App layout, sidebar, navigation, and responsive design
 */

/* ========== App Layout ========== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ========== Mobile Menu Toggle ========== */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.mobile-menu-toggle:hover {
  background: var(--primary-hover);
}

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

/* ========== Mobile Overlay ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

/* ========== Sidebar Styles ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 95;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.1);
  color: white;
  border-left-color: var(--sidebar-active);
}

.nav-icon {
  font-size: 1.25rem;
  margin-right: 0.75rem;
  width: 1.5rem;
  text-align: center;
}

.nav-label {
  font-weight: 500;
}

/* ========== Sidebar Footer ========== */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: white;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.locale-switcher {
  margin-bottom: 0.75rem;
}

.locale-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--gray-400);
}

.locale-select {
  width: 100%;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.locale-select:hover {
  background: rgba(255, 255, 255, 0.1);
}

.locale-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.locale-select option {
  background: var(--gray-800);
  color: white;
}

.logout-form {
  margin: 0;
}

.logout-button {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-button:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.logout-button .nav-icon {
  margin-right: 0.5rem;
}

.version-info {
  text-align: center;
  padding: 0.75rem 0.5rem;
  margin-top: 0.5rem;
}

.version-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ========== Main Content ========== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content-wrapper {
  padding: 2rem;
  max-width: 1400px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ========== Responsive Design ========== */

/* Tablet breakpoint (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .content-wrapper {
    padding: 1.5rem;
  }
}

/* Mobile breakpoint (max-width: 768px) */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hide sidebar by default on mobile */
  .sidebar {
    transform: translateX(-100%);
  }

  /* Show sidebar when active */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Show overlay when sidebar is active */
  .sidebar-overlay.active {
    display: block;
  }

  /* Main content takes full width on mobile */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .content-wrapper {
    padding: 1rem;
    padding-top: 4rem; /* Make room for mobile menu toggle */
  }

  .container {
    padding: 1rem;
  }

  /* Hide page numbers in pagination on mobile, show only prev/next */
  .desktop-only {
    display: none !important;
  }
}

/* Small mobile breakpoint (max-width: 480px) */
@media (max-width: 480px) {
  .mobile-menu-toggle {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .content-wrapper {
    padding: 0.75rem;
    padding-top: 3.5rem;
  }

  .sidebar-brand h1 {
    font-size: 1.125rem;
  }

  .user-info {
    padding: 0.625rem;
  }

  .nav-link {
    padding: 0.625rem 1rem;
  }

  .nav-icon {
    font-size: 1.125rem;
    margin-right: 0.625rem;
  }
}
