/* Login Gate */
.login-gate {
  position: fixed;
  inset: 0;
  background: var(--bg-secondary);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  min-height: 100dvh;
}

.login-gate-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.main-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.no-scroll {
  overflow: hidden;
}

.login-gate-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-gate-logo i {
  font-size: 48px;
  color: var(--primary);
  display: block;
  margin-bottom: 12px;
}

.login-gate-logo h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-gate-logo p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.btn-google-gate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .btn-google-gate:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-switch {
  text-align: center;
  font-size: 14px;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .auth-switch a:hover {
    text-decoration: underline;
  }
}

@keyframes pulse {
  0% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.6; transform: scale(1); }
}

/* Header */

.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .header {
  background: rgba(13, 17, 23, 0.8);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.logo i {
  font-size: 24px;
}


/* Header UI Elements */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
}

.search-box input {
  width: 100%;
  padding: 10px 70px 10px 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-box kbd {
  position: absolute;
  right: 14px;
  padding: 3px 8px;
  font-size: 11px;
  background: var(--bg-hover);
  border-radius: 6px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .btn-icon:hover {
    background: var(--primary);
    color: var(--on-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.btn-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

@media (hover: hover) and (pointer: fine) {
  .btn-avatar:hover {
    border-color: var(--primary);
    transform: scale(1.05);
  }
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .auth-switch a:hover {
    text-decoration: underline;
  }
}

.user-info-card {
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.avatar-wrapper {
  position: relative;
  display: flex;
}

.status-dot-avatar {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  background: #9ca3af; /* Default gray */
  z-index: 2;
}

.user-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  overflow: hidden;
  border: 2px solid var(--border);
}

#userInitial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.user-info-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.status-online {
  font-size: 12px;
  color: var(--success);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 10px;
}

/* Content Area */
.content {
  flex: 1;
  padding: 24px;
  width: 100%;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive Layout Fixes (Mobile) */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .header-left {
    flex: 0 0 auto;
  }

  .header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  /* Reset search box as a simple button container */
  .header .search-box {
    width: auto;
    height: auto;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header .search-box input {
    display: none;
  }

  .header .search-box i {
    position: static;
    transform: none;
    pointer-events: auto;
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
  }

  /* Search Panel specific results grid */
  #modalSearchGrid {
    grid-template-columns: 1fr; /* Full width on mobile for better visibility */
    gap: 16px;
  }
}


