/* ==========================================================================
   HANCERZ ACCOUNT - COMPONENTS & INTERFACE ELEMENTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. App Topbar & Ecosystem Header
   -------------------------------------------------------------------------- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

@media (max-width: 1023px) {
  .menu-toggle-btn {
    display: inline-flex;
  }
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  user-select: none;
}

.brand-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-subtitle-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(6, 182, 212, 0.12);
  color: var(--brand-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.icon-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.icon-action-btn:hover {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* User Pill in Topbar */
.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  border-radius: 9999px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.user-pill-btn:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-strong);
}

.user-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--surface-secondary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-pill-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891b2, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-pill-name {
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown Menus */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  padding: 0.5rem;
  z-index: 60;
  display: none;
  animation: dropdownEnter 0.18s ease-out forwards;
}

.dropdown-menu.active {
  display: block;
}

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

.dropdown-header {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.4rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

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

.dropdown-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--accent-ruby);
}

/* Ecosystem Launcher Grid */
.ecosystem-grid-menu {
  width: 290px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  padding: 0.85rem;
}

.dropdown-menu.ecosystem-grid-menu.active {
  display: grid;
}

.ecosystem-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 0.75rem 0.35rem;
  border-radius: 0.65rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.ecosystem-app-item:hover {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.ecosystem-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.ecosystem-app-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   2. Google Account-Style Left Vertical Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.sidebar-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 0.4rem;
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-card);
}

@media (max-width: 1023px) {
  .sidebar-close-btn {
    display: inline-flex;
  }
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav-item {
  width: 100%;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 9999px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  white-space: nowrap;
}

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

/* Active State (Google Account Pill Style) */
.sidebar-nav-link.active {
  background-color: rgba(6, 182, 212, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-nav-link.active::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-cyan);
  box-shadow: 0 0 8px var(--brand-cyan);
}

/* Google-Style Circular Icon Badges */
.nav-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-nav-link:hover .nav-icon-badge {
  transform: scale(1.06);
}

.badge-home {
  background-color: var(--icon-home-bg);
  color: var(--icon-home-fg);
}
.badge-profile {
  background-color: var(--icon-profile-bg);
  color: var(--icon-profile-fg);
}
.badge-security {
  background-color: var(--icon-security-bg);
  color: var(--icon-security-fg);
}
.badge-sessions {
  background-color: var(--icon-sessions-bg);
  color: var(--icon-sessions-fg);
}
.badge-apps {
  background-color: var(--icon-apps-bg);
  color: var(--icon-apps-fg);
}
.badge-danger {
  background-color: var(--icon-danger-bg);
  color: var(--icon-danger-fg);
}

/* --------------------------------------------------------------------------
   3. Hero Header & Overview View
   -------------------------------------------------------------------------- */
.overview-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.avatar-hero-container {
  position: relative;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.avatar-hero-img {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-subtle);
  background-color: var(--surface-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.avatar-hero-container:hover .avatar-hero-img {
  border-color: var(--brand-cyan);
}

.avatar-hero-initials {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e7490, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  border: 3px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.avatar-hero-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--surface-secondary);
  border: 2px solid var(--bg-main);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.avatar-hero-container:hover .avatar-hero-badge {
  background-color: var(--brand-cyan);
  color: #ffffff;
  transform: scale(1.1);
}

.hero-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.hero-email {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
}

/* Quick Shortcut Action Chips */
.hero-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 580px;
}

.shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.shortcut-chip:hover {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Card Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.h-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.h-card:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-card-hover);
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

/* --------------------------------------------------------------------------
   4. Forms, Inputs & Buttons
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.h-input, .h-select, .h-textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background-color: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

.h-input:focus, .h-select:focus, .h-textarea:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px var(--brand-cyan-glow);
}

.h-input:disabled, .h-input[readonly] {
  background-color: var(--surface-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-icon-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.input-icon-btn:hover {
  color: var(--text-primary);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #ffffff;
  border: none;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background-color: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-ruby);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-ruby);
}

/* --------------------------------------------------------------------------
   5. Password Strength Meter
   -------------------------------------------------------------------------- */
.strength-track {
  height: 5px;
  background-color: var(--surface-secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.6rem;
  display: flex;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
}

.strength-weak {
  width: 25%;
  background-color: var(--accent-ruby);
}
.strength-fair {
  width: 50%;
  background-color: var(--accent-amber);
}
.strength-good {
  width: 75%;
  background-color: var(--brand-cyan);
}
.strength-strong {
  width: 100%;
  background-color: var(--accent-emerald);
}

.strength-criteria-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.strength-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.strength-item.valid {
  color: var(--accent-emerald);
}

/* --------------------------------------------------------------------------
   6. Device Sessions & Connected Apps Cards
   -------------------------------------------------------------------------- */
.device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  margin-bottom: 0.85rem;
  transition: all 0.2s ease;
}

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

.device-card-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.device-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-cyan);
  flex-shrink: 0;
}

.device-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.device-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.badge-current-device {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* --------------------------------------------------------------------------
   7. Data & Deletion (Danger Zone) Form & Success Screen
   -------------------------------------------------------------------------- */
.danger-container {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, rgba(18, 18, 21, 0.8) 100%);
  border-radius: 1rem;
  padding: 1.75rem;
}

.deletion-request-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.deletion-success-card {
  display: none;
  background-color: var(--surface-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.85rem;
  padding: 2.25rem 1.5rem;
  text-align: center;
  animation: panelFadeIn 0.3s ease-out forwards;
}

.success-icon-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

/* --------------------------------------------------------------------------
   8. Cyber-Obsidian Toast Notifications
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  width: calc(100% - 2.5rem);
  pointer-events: none;
}

.hz-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  background: #141418;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px #27272a;
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  transform-origin: top right;
  animation: toastEnter 0.25s ease-out forwards;
  transition: all 0.2s ease;
}

.hz-toast.toast-leave {
  animation: toastExit 0.2s ease-in forwards;
}

.hz-toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

.hz-toast-content {
  flex-grow: 1;
}

.hz-toast-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.9rem;
  color: #ffffff;
}

.hz-toast-msg {
  color: #a1a1aa;
  font-size: 0.825rem;
}

.hz-toast-close {
  flex-shrink: 0;
  color: #71717a;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

.hz-toast-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.hz-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.hz-toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
}

/* Toast Variants */
.toast-error { border-left: 4px solid #ef4444; }
.toast-error .hz-toast-icon { color: #ef4444; }
.toast-error .hz-toast-progress-bar { background: #ef4444; }

.toast-success { border-left: 4px solid #10b981; }
.toast-success .hz-toast-icon { color: #10b981; }
.toast-success .hz-toast-progress-bar { background: #10b981; }

.toast-warning { border-left: 4px solid #f59e0b; }
.toast-warning .hz-toast-icon { color: #f59e0b; }
.toast-warning .hz-toast-progress-bar { background: #f59e0b; }

.toast-info { border-left: 4px solid #06b6d4; }
.toast-info .hz-toast-icon { color: #06b6d4; }
.toast-info .hz-toast-progress-bar { background: #06b6d4; }

@keyframes toastEnter {
  from { opacity: 0; transform: translateY(-0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastExit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-0.75rem); }
}

/* --------------------------------------------------------------------------
   9. Loading Spinner
   -------------------------------------------------------------------------- */
.spinner {
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
