/* ═══════════════════════════════════════════════════════
   NasajTools Auth & Credits UI Styles
   Used on AI tool pages only
   ═══════════════════════════════════════════════════════ */

/* ── Auth Container (Navbar) ── */
.nasaj-auth-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-end: 8px;
}

/* ── Login Button ── */
.nasaj-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4285f4, #3a5afe);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.nasaj-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(58, 90, 254, 0.4);
}

.nasaj-login-btn i {
  font-size: 0.95rem;
}

.nasaj-signup-btn {
  background: transparent;
  color: var(--text-primary, #e4e4e7);
  border: 1px solid rgba(58, 90, 254, 0.3);
}

.nasaj-signup-btn:visited {
  color: var(--text-primary, #e4e4e7);
}

.nasaj-signup-btn:hover {
  background: rgba(58, 90, 254, 0.08);
  box-shadow: none;
}

/* ── Credits Badge ── */
.nasaj-credits-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(58, 90, 254, 0.15);
  color: var(--text-primary, #e4e4e7);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: default;
  transition: all 0.3s ease;
  border: 1px solid rgba(58, 90, 254, 0.3);
  white-space: nowrap;
  text-decoration: none;
}

.nasaj-credits-badge i {
  color: #fbbf24;
  font-size: 0.85rem;
}

.nasaj-credits-badge.low {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.3);
}

.nasaj-credits-badge.low i {
  color: #fb923c;
}

.nasaj-credits-badge.empty {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.nasaj-credits-badge.empty i {
  color: #ef4444;
}

/* ── User Avatar Menu ── */
.nasaj-user-menu {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.nasaj-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(58, 90, 254, 0.4);
  transition: border-color 0.3s ease;
}

.nasaj-avatar:hover {
  border-color: #3a5afe;
}

.nasaj-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── User Dropdown ── */
.nasaj-user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  inset-inline-end: 0;
  min-width: 220px;
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.nasaj-user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nasaj-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
}

.nasaj-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #e4e4e7);
}

.nasaj-user-email {
  font-size: 0.75rem;
  color: var(--text-secondary, #a1a1aa);
  direction: ltr;
  unicode-bidi: isolate;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.nasaj-dropdown-credits {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-primary, #e4e4e7);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  text-align: start;
}

.nasaj-dropdown-credits i {
  color: #fbbf24;
}

.nasaj-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: start;
  text-decoration: none;
}

.nasaj-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #e4e4e7);
}

.nasaj-btn-logout:hover {
  color: #ef4444;
}

/* ── Mobile Auth ── */
.nasaj-mobile-auth {
  padding: 16px 0;
  margin-top: 12px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  text-align: start;
}

.nasaj-mobile-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 8px 0;
  color: var(--text-primary, #e4e4e7);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: start;
}

.nasaj-mobile-credits {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  margin-inline-start: 0;
  font-size: 0.85rem;
  color: #fbbf24;
  text-align: start;
}

.nasaj-mobile-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4285f4, #3a5afe);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.nasaj-mobile-login-btn:hover {
  opacity: 0.9;
}

.nasaj-mobile-signup-btn {
  margin-top: 8px;
  background: transparent;
  color: var(--text-primary, #e4e4e7);
  border: 1px solid rgba(58, 90, 254, 0.25);
}

.nasaj-mobile-signup-btn:visited {
  color: var(--text-primary, #e4e4e7);
}

.nasaj-mobile-logout {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nasaj-mobile-logout:hover {
  color: #ef4444;
}

/* ── Credit Modal ── */
.nasaj-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.nasaj-modal-overlay.show {
  opacity: 1;
}

.nasaj-modal {
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nasaj-modal-overlay.show .nasaj-modal {
  transform: scale(1);
}

.nasaj-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  inset-inline-end: 16px;
  background: none;
  border: none;
  color: var(--text-secondary, #a1a1aa);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.nasaj-modal-close:hover {
  color: var(--text-primary, #e4e4e7);
}

.nasaj-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(58, 90, 254, 0.15), rgba(58, 90, 254, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.nasaj-modal-icon i {
  font-size: 1.5rem;
  color: #3a5afe;
}

.nasaj-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #e4e4e7);
  margin-bottom: 8px;
}

.nasaj-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #a1a1aa);
  line-height: 1.6;
  margin-bottom: 24px;
}

.nasaj-modal-desc strong {
  color: #fbbf24;
}

.nasaj-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nasaj-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nasaj-modal-btn.primary {
  background: linear-gradient(135deg, #4285f4, #3a5afe);
  color: #fff;
}

.nasaj-modal-btn.primary:hover {
  box-shadow: 0 4px 16px rgba(58, 90, 254, 0.4);
  transform: translateY(-1px);
}

.nasaj-modal-btn.secondary {
  background: transparent;
  color: var(--text-secondary, #a1a1aa);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.nasaj-modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #e4e4e7);
}

/* ── Light Mode ── */
body.light-mode .nasaj-credits-badge {
  color: #1e1e2e;
}

body.light-mode .nasaj-user-dropdown {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .nasaj-dropdown-header {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nasaj-user-name {
  color: #1e1e2e;
}

body.light-mode .nasaj-user-email {
  color: #6b7280;
}

body.light-mode .nasaj-dropdown-credits {
  color: #1e1e2e;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nasaj-dropdown-btn {
  color: #6b7280;
}

body.light-mode .nasaj-dropdown-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1e1e2e;
}

body.light-mode .nasaj-modal {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

body.light-mode .nasaj-modal-title {
  color: #1e1e2e;
}

body.light-mode .nasaj-modal-desc {
  color: #6b7280;
}

html:not(.dark) .nasaj-modal-close {
  color: #9ca3af;
}

html:not(.dark) .nasaj-modal-close:hover {
  color: #1e1e2e;
}

html:not(.dark) .nasaj-modal-btn.secondary {
  color: #6b7280;
  border-color: rgba(0, 0, 0, 0.15);
}

html:not(.dark) .nasaj-modal-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1e1e2e;
}

html:not(.dark) .nasaj-mobile-auth {
  border-color: rgba(0, 0, 0, 0.1);
}

html:not(.dark) .nasaj-mobile-user-info {
  color: #1e1e2e;
}

body.light-mode .nasaj-signup-btn,
body.light-mode .nasaj-signup-btn:visited,
html:not(.dark) .nasaj-signup-btn,
html:not(.dark) .nasaj-signup-btn:visited {
  color: #3a5afe;
  border-color: rgba(58, 90, 254, 0.35);
  background: rgba(58, 90, 254, 0.04);
}

body.light-mode .nasaj-signup-btn:hover,
html:not(.dark) .nasaj-signup-btn:hover {
  color: #2447eb;
  background: rgba(58, 90, 254, 0.1);
  border-color: rgba(58, 90, 254, 0.45);
}

body.light-mode .nasaj-signup-btn i,
html:not(.dark) .nasaj-signup-btn i,
body.light-mode .nasaj-mobile-signup-btn,
body.light-mode .nasaj-mobile-signup-btn:visited,
html:not(.dark) .nasaj-mobile-signup-btn,
html:not(.dark) .nasaj-mobile-signup-btn:visited {
  color: #3a5afe;
}

body.light-mode .nasaj-mobile-signup-btn,
body.light-mode .nasaj-mobile-signup-btn:visited,
html:not(.dark) .nasaj-mobile-signup-btn,
html:not(.dark) .nasaj-mobile-signup-btn:visited {
  border-color: rgba(58, 90, 254, 0.35);
  background: rgba(58, 90, 254, 0.04);
}

body.light-mode .nasaj-mobile-signup-btn:hover,
html:not(.dark) .nasaj-mobile-signup-btn:hover {
  color: #2447eb;
  background: rgba(58, 90, 254, 0.1);
  border-color: rgba(58, 90, 254, 0.45);
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .nasaj-auth-container {
    display: none;
  }
}

@media (max-width: 768px) {
  .nasaj-auth-container {
    gap: 6px;
  }

  .nasaj-login-btn span {
    display: none;
  }

  .nasaj-login-btn {
    padding: 8px 12px;
  }

  .nasaj-credits-badge {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .nasaj-avatar {
    width: 28px;
    height: 28px;
  }
}
