/* ==========================================================================
   Layout Styles - OpenDev Platform
   科技感布局 - Tech Layout
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

/* Sidebar - 科技感侧边栏 */
.sidebar {
  width: 240px;
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    rgba(10, 10, 15, 0.95) 100%
  );
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 侧边栏发光边框效果 */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 212, 255, 0.3) 20%,
    rgba(0, 255, 136, 0.2) 50%,
    rgba(0, 212, 255, 0.3) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

/* Logo 发光效果 */
.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.5),
    transparent
  );
}

.sidebar-logo-link {
  text-decoration: none;
  display: block;
  transition: var(--transition);
}

.sidebar-logo-link:hover {
  opacity: 0.9;
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* Footer 顶部发光线 */
.sidebar-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.3),
    transparent
  );
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.sidebar-footer .user-info:hover {
  background-color: rgba(0, 212, 255, 0.05);
  border-color: var(--border-color);
}

.sidebar-footer .btn-logout {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.sidebar-footer .btn-logout:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(255, 71, 87, 0.1);
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 14px;
  position: relative;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: rgba(0, 212, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
  border-right: none;
}

/* 活动导航项左侧发光条 */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-gradient);
  border-radius: 0 2px 2px 0;
  box-shadow: var(--glow-primary);
}

/* 导航图标 - 科技感 SVG 样式 */
.nav-item-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.nav-item-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--text-tertiary);
  transition: var(--transition);
}

.nav-item:hover .nav-item-icon svg {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5));
}

.nav-item.active .nav-item-icon svg {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.7));
}

/* 图标点击效果 */
.nav-item:active .nav-item-icon svg {
  stroke: var(--accent-secondary);
  filter: drop-shadow(0 0 12px rgba(0, 255, 136, 0.8));
  transform: scale(0.95);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar - 科技感顶栏 */
.top-bar {
  height: 64px;
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    rgba(10, 10, 15, 0.9) 100%
  );
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 顶栏底部发光线 */
.top-bar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.2) 20%,
    rgba(0, 255, 136, 0.15) 50%,
    rgba(0, 212, 255, 0.2) 80%,
    transparent
  );
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-switcher {
  display: flex;
  align-items: center;
}

.account-switch-select {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 200px;
}

.account-switch-select:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.account-switch-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 3px rgba(0, 212, 255, 0.15),
    var(--glow-primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.user-info:hover {
  background-color: rgba(0, 212, 255, 0.05);
  border-color: var(--border-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  position: relative;
}

/* 头像发光环 */
.user-avatar::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.3);
  animation: pulse-glow 3s ease-in-out infinite;
}

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

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

.user-email {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.3s ease;
  position: relative;
  max-width: 100%;
}

.content-area.page-transitioning {
  opacity: 0.3;
  pointer-events: none;
}

.page-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.page-header {
  margin-bottom: 28px;
  animation: fade-in-up 0.5s ease;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Sidebar Skeleton Loading State
   ========================================================================== */

.sidebar-skeleton .nav-skeleton-item {
  height: 40px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.sidebar-skeleton .user-info-skeleton {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.sidebar-skeleton .skeleton-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.sidebar-skeleton .skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-skeleton .skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.sidebar-skeleton .skeleton-line.short {
  width: 60%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .content-area {
    padding: 16px;
  }

  .top-bar {
    height: 56px;
    padding: 0 16px;
  }
}
