/* ========================================================
   auth.css — Login, Register & Profile Styles | GameVault
======================================================== */

/* ---- AUTH BODY ---- */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: 20px; /* no bottom nav on auth page */
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-decoration: none;
  margin-bottom: 25px;
}

/* ---- AUTH HEADER LOGO ---- */
.auth-header-logo {
  margin-bottom: 40px;
  animation: fadeInUp .5s ease both;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-header-logo .nav-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 25px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease;
  overflow: visible; /* Ensure nothing is clipped */
}

.auth-header-logo .nav-logo:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.auth-header-logo .auth-nav-icon {
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 8px; /* Extra breathing room */
  margin: -8px;
  vertical-align: middle;
  filter: drop-shadow(0 0 10px rgba(124,58,237,0.4));
  line-height: 1;
}

.auth-header-logo .nav-logo-text {
  padding-right: 5px; /* Spacing for Arabic RTL */
}

/* ---- AUTH CARD ---- */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.1), 0 24px 80px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: fadeInUp .55s ease both .1s;
  border: 1px solid rgba(255,255,255,0.05);
}

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

/* ---- TABS ---- */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(124,58,237,0.2);
}
.auth-tab {
  flex: 1;
  padding: 18px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.auth-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px 2px 0 0;
  transition: width .3s ease;
}
.auth-tab.active { color: var(--primary-light); }
.auth-tab.active::after { width: 70%; }
.auth-tab:hover { color: var(--text-muted); }

/* ---- FORMS ---- */
.auth-form {
  padding: 28px;
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: fadeInUp .4s ease both;
}
.auth-form.active { display: flex; }

.auth-welcome {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.auth-welcome-icon {
  font-size: 2.4rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}
.auth-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.auth-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---- FORM GROUPS ---- */
.form-grp {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-grp label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.form-grp label .label-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.form-grp label i { color: var(--primary-light); font-size: 0.75rem; }

/* ---- HINTS & LINKS ---- */
.auth-link {
  font-size: 0.72rem;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
  text-transform: none;
  letter-spacing: 0;
}
.auth-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.input-hint {
  font-size: 0.72rem;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  animation: fadeInHint 0.3s ease both;
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-hint.error {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.1);
}
.suggestion-link {
  color: var(--primary-light);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  margin: 0 4px;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-grp input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  direction: ltr;
  text-align: right;
  width: 100%;
}
.form-grp input:focus {
  border-color: var(--primary-light);
  background-color: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-grp input::placeholder { color: var(--text-dim); direction: rtl; }

/* Password wrapper */
.pass-wrap { position: relative; }
.pass-wrap input { padding-left: 44px; }
.pass-toggle {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.88rem;
  transition: color .2s;
}
.pass-toggle:hover { color: var(--primary-light); }

/* ---- ERROR ---- */
.auth-err {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* .auth-err::before { content: '⚠️'; } -- Removed for cleaner look */

/* ---- SUBMIT BUTTON ---- */
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 24px rgba(124,58,237,0.35);
}
.auth-submit:hover:not(:disabled) {
  box-shadow: 0 0 40px rgba(124,58,237,0.6);
  transform: translateY(-2px);
}
.auth-submit:disabled { opacity: 0.75; cursor: not-allowed; }

/* ---- ADMIN HINT ---- */
.admin-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed rgba(251,191,36,0.2);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.admin-hint:hover {
  border-color: rgba(251,191,36,0.5);
  color: #fbbf24;
  background: rgba(251,191,36,0.05);
}

/* ---- FOOTER NOTE ---- */
.auth-footer-note {
  text-align: center;
  padding: 16px 28px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.auth-footer-note a { color: var(--primary-light); text-decoration: none; }
.auth-footer-note a:hover { text-decoration: underline; }

/* ================================================================
   PROFILE PAGE
================================================================ */
.profile-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
}

.profile-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

/* ---- Profile Hero Card ---- */
.profile-hero {
  background: rgba(10,10,28,0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  text-align: center;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  animation: fadeInUp .5s ease both;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.profile-avatar {
  width: 90px; height: 90px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 16px;
  box-shadow: 0 0 32px rgba(124,58,237,0.45);
  border: 3px solid rgba(124,58,237,0.3);
  position: relative;
}
.profile-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--gradient-primary) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: spinRing 4s linear infinite;
}
@keyframes spinRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.profile-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.profile-email {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.profile-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
}
.role-admin {
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.4);
  color: #fbbf24;
}
.role-user {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--primary-light);
}

/* ====Admin Dashboard CTA ===*/
.admin-cta {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(6,182,212,0.1));
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  text-decoration: none;
  transition: var(--transition);
  animation: fadeInUp .5s ease both .1s;
}
.admin-cta:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 24px rgba(124,58,237,0.25);
  transform: translateY(-2px);
}
.admin-cta-icon {
  width: 52px; height: 52px;
  background: var(--gradient-primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(124,58,237,0.4);
  flex-shrink: 0;
}
.admin-cta-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.admin-cta-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-cta-arrow {
  font-size: 1.1rem;
  color: var(--primary-light);
  flex-shrink: 0;
}

/* ---- Info Cards ---- */
.profile-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
  animation: fadeInUp .5s ease both .15s;
}
.profile-info-card {
  background: rgba(10,10,28,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(12px);
}
.pic-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.pic-label i { color: var(--primary-light); }
.pic-value { font-size: 0.95rem; font-weight: 600; }

/* ---- Edit Form ---- */
.profile-section {
  background: rgba(10,10,28,0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  animation: fadeInUp .5s ease both .2s;
  backdrop-filter: blur(12px);
}
.profile-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-section-header i { color: var(--primary-light); }
.profile-section-body { padding: 20px; }

.profile-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.profile-form-row input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
  direction: rtl;
}
.profile-form-row input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}


.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-save:hover { box-shadow: 0 0 20px rgba(124,58,237,0.4); transform: translateY(-1px); }

/* ---- Logout ---- */
.btn-logout {
  width: 100%;
  padding: 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 12px;
  color: #f87171;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: fadeInUp .5s ease both .25s;
}
.btn-logout:hover {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.6);
  transform: translateY(-1px);
}

/* ---- Update msg ---- */
.update-msg {
  font-size: 0.8rem;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  display: none;
}
.update-msg.success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  display: block;
}

/* ---- NAVBAR USER SECTION ---- */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 7px 14px 7px 10px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  transition: var(--transition);
  cursor: pointer;
}
.nav-user-btn:hover {
  border-color: var(--border-hover);
  background: rgba(124,58,237,0.08);
}
.nav-avatar {
  width: 30px; height: 30px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.nav-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- ADMIN BADGE in navbar ---- */
.nav-admin-dot {
  width: 8px; height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 6px #fbbf24;
  animation: pulse 2s ease infinite;
}

@media (max-width: 600px) {
  .profile-cards { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px;
  }
  .profile-info-card { padding: 14px; }
  .profile-form-row { flex-direction: column; }
  .btn-save { width: 100%; justify-content: center; }
}

/* ================================================================
   LIGHT MODE OVERRIDES (AUTH & PROFILE)
================================================================ */
.light-mode .auth-card { 
  background: rgba(255, 255, 255, 0.9); 
  border-color: rgba(0,0,0,0.08); 
  box-shadow: 0 10px 40px rgba(0,0,0,0.06), 0 20px 80px rgba(0,0,0,0.02); 
}
.light-mode .auth-title { color: #1e293b; }
.light-mode .auth-sub { color: #475569; }

/* Welcome Icons Light Mode */
.light-mode .auth-welcome-icon i,
.light-mode .site-brand-icon {
  color: var(--primary) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: var(--primary) !important;
  filter: drop-shadow(0 4px 10px rgba(124, 58, 237, 0.15)) !important;
}

.light-mode .form-grp input { 
  background: #f8fafc; 
  color: #1e293b; 
  border-color: rgba(0,0,0,0.1); 
}
.light-mode .form-grp input:focus { 
  background: #ffffff; 
  border-color: var(--primary); 
}
.light-mode .profile-hero { background: #ffffff; border-color: rgba(0,0,0,0.05); box-shadow: 0 10px 40px rgba(0,0,0,0.03); }
.light-mode .profile-name { color: #1e293b !important; }
.light-mode .profile-email { color: #64748b !important; }
.light-mode .profile-info-card { background: #ffffff !important; border-color: rgba(0,0,0,0.05) !important; }
.light-mode .pic-label { color: #94a3b8 !important; }
.light-mode .pic-value { color: #1e293b !important; }
.light-mode .profile-section { background: #ffffff !important; border-color: rgba(0,0,0,0.05) !important; }
.light-mode .profile-section-header { color: #1e293b !important; border-bottom-color: rgba(0,0,0,0.03) !important; }
.light-mode .profile-form-row input { background: #f8fafc; color: #1e293b; border-color: rgba(0,0,0,0.1); }
.light-mode .profile-form-row input:focus { background: #ffffff; border-color: var(--primary); }
.light-mode .btn-logout { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
.light-mode .admin-cta { background: #f8fafc; border-color: rgba(0,0,0,0.05); }
.light-mode .admin-cta-title { color: #1e293b; }
.light-mode .admin-cta-sub { color: #64748b; }
.light-mode .auth-tab { color: #94a3b8; }
.light-mode .auth-tab.active { color: var(--primary); }
.light-mode .auth-tab:hover { color: #1e293b; }

.light-mode .auth-header-logo .nav-logo {
  background: #ffffff;
  border-color: rgba(0,0,0,0.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.light-mode .auth-header-logo .nav-logo-text {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #1e293b !important;
  color: #1e293b !important;
}
.light-mode .auth-header-logo .auth-nav-icon {
  background: var(--primary); /* Use solid color in light mode for consistency */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(124,58,237,0.15));
}
