/**
 * te-auth.css — Universal Think Extra 9-Dot App Launcher & SSO Styles
 * Operated by Shri Laxmi Narayan Technologies (SLNT)
 */

:root {
  --te-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --te-font-mono: 'JetBrains Mono', monospace;
  --te-bg-card: rgba(17, 24, 39, 0.94);
  --te-bg-hover: rgba(255, 255, 255, 0.06);
  --te-border: rgba(255, 255, 255, 0.12);
  --te-border-active: rgba(99, 102, 241, 0.4);
  --te-text: #f9fafb;
  --te-text-muted: #9ca3af;
  --te-text-subtle: #6b7280;
  --te-accent: #6366f1;
  --te-accent-glow: rgba(99, 102, 241, 0.25);
  --te-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
  --te-bg-card: rgba(255, 255, 255, 0.96);
  --te-bg-hover: rgba(0, 0, 0, 0.04);
  --te-border: rgba(0, 0, 0, 0.1);
  --te-border-active: rgba(79, 70, 229, 0.4);
  --te-text: #0f172a;
  --te-text-muted: #475569;
  --te-text-subtle: #94a3b8;
  --te-accent: #4f46e5;
  --te-accent-glow: rgba(79, 70, 229, 0.15);
  --te-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Launcher Container & Trigger */
.te-launcher-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--te-font);
  user-select: none;
}

.te-launcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--te-text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.te-launcher-btn:hover,
.te-launcher-btn[aria-expanded="true"] {
  background: var(--te-bg-hover);
  color: var(--te-text);
  border-color: var(--te-border);
}

.te-launcher-btn:focus-visible {
  outline: 2px solid var(--te-accent);
  outline-offset: 2px;
}

.te-waffle-icon {
  display: grid;
  grid-template-columns: repeat(3, 3.5px);
  grid-template-rows: repeat(3, 3.5px);
  gap: 3px;
}

.te-waffle-dot {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background-color: currentColor;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.te-launcher-btn:hover .te-waffle-dot {
  background-color: var(--te-accent);
}

.te-launcher-btn:hover .te-waffle-dot:nth-child(even) {
  transform: scale(1.15);
}

/* Floating Dropdown Modal / Popover */
.te-launcher-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 370px;
  max-width: calc(100vw - 24px);
  background: var(--te-bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--te-border);
  border-radius: 16px;
  box-shadow: var(--te-shadow);
  padding: 16px;
  z-index: 99999;
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: teMenuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

.te-launcher-dropdown.te-open {
  display: flex;
}

@keyframes teMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.te-launcher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--te-border);
}

.te-launcher-header-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--te-text-muted);
}

.te-launcher-brand-pill {
  font-size: 0.68rem;
  font-family: var(--te-font-mono);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--te-accent);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-weight: 600;
}

/* App List / Grid */
.te-launcher-apps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.te-launcher-apps::-webkit-scrollbar {
  width: 5px;
}
.te-launcher-apps::-webkit-scrollbar-thumb {
  background: var(--te-border);
  border-radius: 10px;
}

.te-app-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.te-app-item:hover {
  background: var(--te-bg-hover);
  border-color: var(--te-border-active);
  transform: translateX(2px);
}

.te-app-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--te-border);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.te-app-item:hover .te-app-icon-wrap {
  transform: scale(1.08);
  border-color: var(--te-accent);
}

.te-app-content {
  flex: 1;
  min-width: 0;
}

.te-app-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.te-app-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--te-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.te-app-tag {
  font-size: 0.68rem;
  font-family: var(--te-font-mono);
  color: var(--te-text-subtle);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.te-app-desc {
  font-size: 0.76rem;
  color: var(--te-text-muted);
  line-height: 1.35;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Specialized GATE / Ananya Sub-branch Pills */
.te-gate-branches {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.te-gate-pill {
  font-size: 0.7rem;
  font-family: var(--te-font-mono);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--te-accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
}

.te-gate-pill:hover {
  background: var(--te-accent);
  color: #fff;
  border-color: var(--te-accent);
}

/* Footer Section */
.te-launcher-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--te-border);
  font-size: 0.74rem;
}

.te-footer-link {
  color: var(--te-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.te-footer-link:hover {
  color: var(--te-accent);
}

.te-slnt-tag {
  font-family: var(--te-font-mono);
  font-size: 0.68rem;
  color: var(--te-text-subtle);
}

/* Universal User Profile / Login Pill Component */
.te-user-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--te-font);
}

.te-user-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--te-accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--te-accent-glow);
}

.te-user-auth-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.te-user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--te-bg-hover);
  border: 1px solid var(--te-border);
  color: var(--te-text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.te-user-profile-badge:hover {
  border-color: var(--te-border-active);
  background: rgba(255, 255, 255, 0.08);
}

.te-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #10b981);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.te-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
