/* ========================================
   Subto.One v2.0 - Enhanced Styles
   PWA, Auth, Teams, API Components
   ======================================== */

/* ========================================
   GOOGLE SIGN-IN BUTTON (Premium)
   ======================================== */
.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.google-signin-btn:hover {
  background: #f8fafc;
  border-color: rgba(66, 133, 244, 0.3);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(66, 133, 244, 0.1);
}

.google-signin-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.google-signin-btn:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(66, 133, 244, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(66, 133, 244, 0.15);
}

.google-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.google-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.google-btn-text {
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* Teams section sign-in button variant */
.teams-signin-btn {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: 14px;
}

/* ========================================
   USER PROFILE & DROPDOWN
   ======================================== */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.user-avatar:hover {
  border-color: #5dd39e;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

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

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

.user-email {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.2;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  
}

.dropdown-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  z-index: 1000;
  overflow: hidden;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.dropdown-item:hover svg {
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.logout-item {
  color: #ef4444;
}

.logout-item:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ========================================
   NAVIGATION LINKS (with icons)
   ======================================== */
.header-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  
}

.header-nav .nav-link svg {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.header-nav .nav-link:hover svg,
.header-nav .nav-link.active svg {
  opacity: 1;
}

/* ========================================
   API SECTION
   ======================================== */
.api-section {
  padding: var(--space-2xl) var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.api-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.api-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: var(--space-lg);
  
}

.api-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

.api-card-header h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.api-key-card {
  grid-column: span 2;
}

.api-key-container {
  text-align: center;
  padding: var(--space-xl);
}

.api-key-message {
  color: var(--text-secondary);
  font-size: 1rem;
}

.api-key-authenticated {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.api-key-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.api-key-display code {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  
}

.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: var(--accent);
}

/* API Code Example */
.api-example {
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
}

.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.code-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.code-tab:hover {
  color: var(--text-primary);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.api-code {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.api-code code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre;
}

/* API Endpoints */
.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}

.endpoint-method {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.endpoint-method.get {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.endpoint-method.post {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.endpoint-method.put {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.endpoint-method.delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
}

.endpoint-path-large {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text-primary);
  margin-left: 12px;
}

.endpoint-desc {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Rate Limits */
.rate-limits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.rate-item {
  text-align: center;
  padding: var(--space-md);
  background: var(--bg);
  border-radius: 10px;
}

.rate-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.rate-label {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ========================================
   API DOCUMENTATION STYLES
   ======================================== */
.api-docs {
  max-width: 900px;
  margin: var(--space-2xl) auto 0;
  padding: 0 var(--space-lg);
}

.api-docs-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.api-doc-section {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.api-doc-section:last-child {
  border-bottom: none;
}

.api-doc-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.api-doc-subheading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-lg) 0 var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-doc-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.api-doc-text code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  color: var(--accent);
}

.api-endpoint-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}

.api-code-block {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-md);
  overflow-x: auto;
  margin: var(--space-sm) 0;
}

.api-code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre;
}

.api-params-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-sm) 0;
  font-size: 0.875rem;
}

.api-params-table tr {
  border-bottom: 1px solid var(--border-subtle);
}

.api-params-table tr:last-child {
  border-bottom: none;
}

.api-params-table td {
  padding: var(--space-sm) var(--space-md);
  vertical-align: top;
}

.api-params-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  white-space: nowrap;
}

.api-params-table td:nth-child(2) {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

.api-params-table td:nth-child(3) {
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.api-params-table td:last-child {
  color: var(--text-secondary);
}

/* Code tabs in docs */
.api-doc-section .code-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
}

.api-doc-section .code-tabs + .api-code-block {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}

/* ========================================
   TEAMS SECTION
   ======================================== */
.teams-section {
  padding: var(--space-2xl) var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.teams-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* Benefits Banner */
.teams-benefits {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.benefit-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .teams-benefits {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: var(--space-xl);
  
}

.team-card:hover {
  border-color: var(--accent);
}

.team-action-card {
  grid-column: span 2;
}

.team-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl);
}

.team-empty-state svg {
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.team-empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.team-empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.team-actions {
  display: flex;
  gap: var(--space-md);
}

.team-actions .btn-primary,
.team-actions .btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Team Dashboard */
.team-dashboard {
  grid-column: span 2;
}

.team-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
}

.team-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #5dd39e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg);
}

.team-info {
  flex: 1;
}

.team-info h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

.team-members-count {
  color: var(--text-tertiary);
  font-size: 14px;
}

.team-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.team-section-header h4 {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  
}

.btn-text:hover {
  background: rgba(0, 212, 170, 0.1);
}

.team-members-list,
.team-scans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-text {
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-lg);
}

/* Team Features */
.team-features {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-xl);
  text-align: left;
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.feature-card:hover {
  border-color: var(--border-strong);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xs);
}

.feature-icon svg {
  color: var(--accent);
}

.feature-card h4 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 1024px) {
  .team-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .team-features {
    grid-template-columns: 1fr;
  }
}

/* Team Scan Items */
.team-scan-item {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  
  cursor: pointer;
}

.team-scan-item:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.03);
}

.scan-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-url {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.scan-meta {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Team Settings Modal */
.settings-section {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h4 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}

/* Teams Sign-in Prompt */
.teams-signin-prompt {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.teams-signin-prompt svg {
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.teams-signin-prompt h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.teams-signin-prompt p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.teams-signin-btn {
  padding: 12px 24px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .api-key-card,
  .team-action-card,
  .team-dashboard,
  .team-features,
  .teams-signin-prompt {
    grid-column: span 1;
  }

  .team-features {
    grid-template-columns: 1fr;
  }

  .rate-limits {
    grid-template-columns: 1fr;
  }

  .teams-container,
  .api-container {
    grid-template-columns: 1fr;
  }

  .user-details {
    display: none;
  }

  .endpoint-desc {
    display: none;
  }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

.toast-success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.toast-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* ========================================
   PWA INSTALL BANNER
   ======================================== */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-md);
  z-index: 1000;
  animation: slideUp 0.3s var(--ease-smooth);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.pwa-banner-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pwa-icon {
  font-size: 1.5rem;
}

.pwa-text {
  flex: 1;
  color: var(--text-secondary);
}

.pwa-install-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.pwa-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ========================================
   APP HEADER - Clean Professional
   ======================================== */
.app-header {
  position: sticky;
  top: 0;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  padding: var(--space-sm) var(--space-lg);
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.125rem; /* larger site title in header */
  letter-spacing: -0.01em;
}

.logo-favicon {
  display: block;
  width: 4rem; /* much larger top-left logo */
  height: 4rem;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

/* keep header usable on small screens */
@media (max-width: 640px) {
  .logo-favicon {
    width: 2rem;
    height: 2rem;
  }
  .logo {
    gap: 8px;
    font-size: 1rem;
  }
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.logo-text {
  color: var(--text-primary);
  font-size: 1.125rem; /* larger header text */
  line-height: 1;
}

.logo-accent {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: var(--space-xs);
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  
}

.nav-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.nav-link:hover {
  color: var(--text-secondary);
  background: var(--surface-soft);
}

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

.nav-link.active svg {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-outline {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ========================================
   LANDING ENHANCEMENTS - Professional
   ======================================== */
.landing-hero {
  text-align: center;
  margin-bottom: var(--space-2xl, 48px);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.landing-title {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #ffffff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-tagline {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.landing-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.feature-badge {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  
}

.feature-badge:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.landing-subtitle {
  margin-top: var(--space-xl);
  font-size: 0.875rem;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* ========================================
   PRICING SECTION
   ======================================== */
.pricing-section,
.teams-section,
.api-section {
  padding: var(--space-section) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-description {
  color: var(--text-tertiary);
  margin-top: var(--space-sm);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-lg);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 212, 170, 0.05) 100%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.pricing-header h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.pricing-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.price {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.period {
  color: var(--text-tertiary);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.pricing-features li {
  padding: var(--space-sm) 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-soft);
  padding-left: 24px;
  position: relative;
}

.pricing-features li.included::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 600;
}

.pricing-features li.excluded {
  color: var(--text-tertiary);
}

.pricing-features li.excluded::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
  font-weight: 600;
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-btn {
  width: 100%;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  display: block;
}

/* ========================================
   TEAMS SECTION
   ======================================== */
.teams-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  min-height: 400px;
}

.teams-sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.create-team-btn {
  width: 100%;
  margin-bottom: var(--space-md);
}

.teams-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.teams-empty {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-align: center;
  padding: var(--space-lg);
}

.teams-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.teams-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-tertiary);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* ========================================
   API SECTION
   ======================================== */
.api-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
}

.api-keys-panel,
.api-docs-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.api-keys-panel h3,
.api-docs-panel h3 {
  margin-bottom: var(--space-md);
}

.api-empty {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.code-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

.code-block pre {
  margin: 0;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.api-endpoints {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.api-endpoints li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.api-endpoints code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  max-width: 420px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content.modal-lg {
  max-width: 560px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 140, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-hint {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: var(--space-md);
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.form-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Invite Code Display */
.invite-code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.invite-code-display code {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 4px;
}

/* Buttons - Professional Styling */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ee5a52, #dc4d41);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.btn-text:hover {
  opacity: 0.8;
}

.full-width {
  width: 100%;
}

/* Account Modal */
.account-profile {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
}

.account-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.account-info h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.account-info p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.account-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(107, 140, 255, 0.15) 0%, rgba(93, 211, 158, 0.15) 100%);
  border: 1px solid rgba(107, 140, 255, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.stat-item {
  text-align: center;
  padding: var(--space-md);
  background: var(--bg);
  border-radius: 12px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Scans List */
.scans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.scan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  
}

.scan-item:hover {
  border-color: var(--accent);
}

.scan-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-url {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.scan-date {
  color: var(--text-tertiary);
  font-size: 12px;
}

.scan-scores {
  display: flex;
  gap: 8px;
}

.scan-scores .score {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.scan-scores .perf { background: rgba(93, 211, 158, 0.15); color: #5dd39e; }
.scan-scores .seo { background: rgba(107, 140, 255, 0.15); color: #6b8cff; }
.scan-scores .security { background: rgba(255, 176, 32, 0.15); color: #ffb020; }

.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  padding: var(--space-xl);
}

/* Team Members */
.team-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 8px;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.member-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.member-role.owner {
  color: #fbbf24;
}

.member-role.admin {
  color: #8b5cf6;
}

.member-role.member {
  color: var(--text-tertiary);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 3000;
  opacity: 0;
  
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.toast-success .toast-icon {
  background: rgba(93, 211, 158, 0.2);
  color: #5dd39e;
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.toast-info .toast-icon {
  background: rgba(107, 140, 255, 0.2);
  color: #6b8cff;
}

.toast-message {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

/* ========================================
   USAGE STATS
   ======================================== */
.usage-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.usage-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

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

.usage-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 4px;
  transition: width 0.5s var(--ease-smooth);
}

.usage-text {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: right;
}

.usage-upgrade {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.usage-upgrade p {
  margin-bottom: var(--space-md);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
  }
  
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: var(--space-md);
    margin-left: 0;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .teams-container {
    grid-template-columns: 1fr;
  }
  
  .api-container {
    grid-template-columns: 1fr;
  }
  
  .landing-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: var(--space-sm) var(--space-md);
  }
  /* Keep the Google sign-in visible on small screens while hiding other header controls */
  .header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
  }
  /* Hide admin or profile panels that are not useful on narrow viewports */
  .header-actions .api-admin-backfill,
  .header-actions #user-dropdown,
  .header-actions #user-profile {
    display: none !important;
  }
  /* Ensure the primary login button remains prominent */
  .header-actions .google-signin-btn {
    display: inline-flex !important;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
  }
  
  .landing-features {
    flex-direction: column;
    align-items: center;
  }
}

/* Session video: responsive 16:9 player (YouTube-like) */
.session-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.session-video video,
.video-skeleton {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  overflow: hidden;
}

.video-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-video .view-video-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 640px) {
  .session-video video,
  .video-skeleton { max-width: 100%; border-radius: 8px; }
}
