/* Native aligned styles for Auth, Project Hub & Modals */

.project-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 9, 17, 0.72);
  backdrop-filter: blur(9px);
}

.project-loading-modal[hidden] { display: none; }

.project-loading-card {
  width: min(440px, calc(100vw - 40px));
  padding: 32px 34px 28px;
  border: 1px solid rgba(24, 199, 255, 0.32);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(10, 27, 42, 0.98), rgba(6, 16, 28, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 42px rgba(24, 199, 255, 0.1);
  text-align: center;
  animation: projectLoadingEnter 180ms ease-out;
}

.project-loading-card h2 {
  margin: 20px 0 8px;
  color: #eff8ff;
  font-size: 21px;
  letter-spacing: 0.015em;
}

.project-loading-card p {
  min-height: 20px;
  margin: 0;
  color: #9eb2c7;
  font-size: 13px;
}

.project-loading-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.project-loading-spinner span {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: #18c7ff;
  border-radius: 50%;
  animation: projectLoadingSpin 1.1s linear infinite;
}

.project-loading-spinner span:nth-child(2) {
  inset: 9px;
  border-top-color: #16f08c;
  animation-direction: reverse;
  animation-duration: 0.85s;
}

.project-loading-spinner span:nth-child(3) {
  inset: 22px;
  border: 0;
  background: radial-gradient(circle, rgba(22, 240, 140, 0.85) 0 18%, rgba(24, 199, 255, 0.2) 21% 52%, transparent 55%);
  animation: projectLoadingPulse 1.25s ease-in-out infinite;
}

.project-loading-track {
  height: 3px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(147, 166, 186, 0.12);
}

.project-loading-track i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #18c7ff, #16f08c, transparent);
  animation: projectLoadingTrack 1.2s ease-in-out infinite;
}

@keyframes projectLoadingSpin { to { transform: rotate(360deg); } }
@keyframes projectLoadingPulse { 50% { transform: scale(0.72); opacity: 0.55; } }
@keyframes projectLoadingTrack { from { transform: translateX(-120%); } to { transform: translateX(340%); } }
@keyframes projectLoadingEnter { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  .project-loading-spinner span,
  .project-loading-track i,
  .project-loading-card { animation-duration: 2.5s; }
}

.auth-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 7% 5%, rgba(0, 255, 188, 0.12), transparent 31%),
    radial-gradient(circle at 67% 0%, rgba(53, 112, 255, 0.12), transparent 36%),
    radial-gradient(circle at 96% 8%, rgba(155, 84, 255, 0.10), transparent 34%),
    linear-gradient(145deg, #08151f 0%, #07111d 44%, #050911 100%);
  z-index: 10000;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  padding: 20px;
}

.auth-card {
  background: rgba(11, 23, 36, 0.85);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  padding: 3rem 2.5rem;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.5), 
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
  animation: authFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #16ffc5;
  font-size: 18px;
  font-weight: 800;
  clip-path: polygon(50% 0, 93% 24%, 93% 76%, 50% 100%, 7% 76%, 7% 24%);
  background: linear-gradient(135deg, rgba(22, 240, 140, 0.16), rgba(24, 199, 255, 0.08));
  border: 2px solid #16ffc5;
  box-shadow: 0 0 30px rgba(22, 240, 140, 0.22);
  margin: 0 auto 1.5rem auto;
}

.auth-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--soft);
  margin-bottom: 2.2rem;
  font-size: 13px;
}

.auth-form-group {
  text-align: left;
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(24, 199, 255, 0.55);
  box-shadow: 0 0 12px rgba(24, 199, 255, 0.15);
}

.auth-btn {
  width: 100%;
  padding: 0.85rem;
  margin-top: 1rem;
  background: rgba(22, 240, 140, 0.12);
  border: 1px solid var(--green);
  border-radius: 7px;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(22, 240, 140, 0.08);
}

.auth-btn:hover {
  background: rgba(22, 240, 140, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(22, 240, 140, 0.18);
}

/* Project Hub Dashboard */
.project-hub {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 7% 5%, rgba(0, 255, 188, 0.05), transparent 31%),
    radial-gradient(circle at 67% 0%, rgba(53, 112, 255, 0.05), transparent 36%),
    radial-gradient(circle at 96% 8%, rgba(155, 84, 255, 0.04), transparent 34%),
    linear-gradient(145deg, #08151f 0%, #07111d 44%, #050911 100%);
  z-index: 9000;
  padding: 3rem;
  overflow-y: auto;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
}

.hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto 3rem auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
}

.hub-title h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.hub-title p {
  color: var(--soft);
  margin: 0.5rem 0 0 0;
  font-size: 14px;
}

.hub-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: rgba(24, 199, 255, 0.55);
  background: rgba(24, 199, 255, 0.08);
}

.btn-primary {
  padding: 0.65rem 1.25rem;
  background: rgba(24, 199, 255, 0.12);
  border: 1px solid var(--cyan);
  border-radius: 7px;
  color: var(--cyan);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: rgba(24, 199, 255, 0.22);
  transform: translateY(-1px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(24, 199, 255, 0.45);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4), 0 0 15px rgba(24, 199, 255, 0.08);
}

.project-card h2 {
  font-size: 20px;
  margin: 0 0 1rem 0;
  color: var(--text);
  font-weight: 600;
}

.project-meta {
  font-size: 13px;
  color: var(--soft);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-meta code {
  color: var(--cyan);
  font-family: monospace;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-badge.active {
  background: rgba(22, 240, 140, 0.12);
  color: var(--green);
  border: 1px solid rgba(22, 240, 140, 0.2);
}

.project-badge.archived {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--red);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon-danger:hover {
  background: rgba(255, 81, 72, 0.1);
  border-color: var(--red);
}

/* Nav bar at the top of detail console */
.project-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 23, 36, 0.85);
  border-bottom: 1px solid var(--line-strong);
  padding: 1rem 2rem;
  backdrop-filter: blur(12px);
  z-index: 8000;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-project-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}

.nav-project-name {
  font-weight: 700;
  color: var(--text);
  font-size: 18px;
}

.nav-project-edit {
  background: transparent;
  border: none;
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
}

.nav-project-edit:hover {
  color: var(--cyan);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.run-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.run-select-wrapper label {
  color: var(--soft);
  font-size: 13px;
}

.run-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55rem 1rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s;
}

.run-select:focus {
  border-color: rgba(24, 199, 255, 0.55);
}

/* Glassmorphic input fields in settings/modals */
.glass-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 19, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.glass-modal-content {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.glass-modal-content h3 {
  margin: 0 0 1.5rem 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
}

.glass-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2rem;
}

/* Ensure legacy action modal overlay sits above modern navbar, hub, and popovers */
.action-modal {
  z-index: 12000 !important;
}
