/* static/css/layout.css */

/* Global Header */
.app-header {
  padding: 12px 24px;
  background: rgba(26, 29, 39, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-surface-border);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--brand-gradient);
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.header-brand-info h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.header-brand-info p {
  font-size: 12px;
  color: var(--text-tertiary);
}

.header-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
  margin-left: -4px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s;
}

.header-brand-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: color 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-border);
}

.nav-link .lucide,
.header-actions .btn .lucide {
  width: 18px !important;
  height: 18px !important;
}

.header-actions .btn {
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Plan pill badge + downward tooltip */
#plan-pill {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

#plan-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2235;
  border: 1px solid #3d4160;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
}

#plan-pill:hover::after {
  opacity: 1;
}

/* Auth Layout Wrapper */
.auth-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(circle at top, #1a1d2d 0%, var(--bg-base) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--brand-gradient);
  border-radius: 16px;
  color: white;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.auth-header-logo .lucide {
  width: 28px;
  height: 28px;
}

.auth-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Global Footer */
.app-footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--bg-surface-border);
  background: var(--bg-base);
}

.app-footer a {
  color: var(--text-secondary);
}

.app-footer a:hover {
  color: var(--text-primary);
}

/* Mobile Drawer */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--bg-surface-border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}

#mobile-drawer { display: none; position: fixed; inset: 0; z-index: 8000; }
#mobile-drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(300px, 85vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--bg-surface-border);
  display: flex; flex-direction: column;
  padding: 24px; gap: 8px; overflow-y: auto;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.drawer-header span { font-size: 16px; font-weight: 700; }
.drawer-close { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; }

.drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; background: transparent; border: none;
  cursor: pointer; width: 100%; text-align: left;
  transition: background 0.2s, color 0.2s;
}
.drawer-item:hover { background: var(--bg-surface-border); color: var(--text-primary); }
.drawer-divider { height: 1px; background: var(--bg-surface-border); margin: 8px 0; }

@media (max-width: 768px) {
  .header-brand-info { display: none; }
  .header-actions .nav-link { display: none; }
  .header-actions .btn { display: none; }
  .mobile-menu-btn { display: flex; }
  .auth-card { padding: 32px 24px; }
}
