/* Layout & Structural Styling */

.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 10%, rgba(6, 182, 212, 0.05) 0px, transparent 40%);
}

/* Sidebar Navigation */
.app-sidebar {
  background-color: rgba(17, 24, 39, 0.85);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  backdrop-filter: var(--glass-blur);
  z-index: 100;
  transition: var(--transition-normal);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.35);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, var(--text-primary), #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: left;
  transition: var(--transition-fast);
}

.nav-item button svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-item button:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item button:hover svg {
  stroke: var(--text-primary);
}

.nav-item.active button {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.05));
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--text-primary);
}

.nav-item.active button svg {
  stroke: var(--color-primary);
}

.sidebar-footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
}

.avatar svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Wrapper */
.app-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(11, 15, 25, 0.5);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-success-glow);
  color: var(--color-success);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.app-content {
  flex-grow: 1;
  padding: 2.5rem;
  overflow-y: auto;
  position: relative;
}

/* Page transitions */
.app-section {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-height: 100%;
}

.app-section.active {
  display: block;
  animation: fadeIn 0.4s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Adaptations */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 240px 1fr;
  }
  .app-header, .app-content {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 60px; /* main section + navigation bar at bottom */
    height: 100vh;
  }
  
  .app-sidebar {
    grid-row: 2;
    flex-direction: row;
    padding: 0 1rem;
    height: 60px;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    align-items: center;
  }
  
  .brand-section, .sidebar-footer {
    display: none;
  }
  
  .nav-list {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 0;
  }
  
  .nav-item button {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    gap: 0.25rem;
    width: auto;
    border: none;
    background: none !important;
  }

  .nav-item button svg {
    width: 22px;
    height: 22px;
  }
  
  .app-main {
    height: calc(100vh - 60px);
  }
  
  .app-header {
    padding: 1rem;
  }
  
  .app-content {
    padding: 1rem;
  }
}
