/* ================================================
   TechTown Students — Auth Modal + Progress CSS
   ================================================ */

/* ── Modal Overlay ─────────────────────────────── */
.tts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 30, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tts-overlay.tts-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Box ─────────────────────────────────── */
.tts-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.tts-overlay.tts-open .tts-modal {
  transform: translateY(0) scale(1);
}

/* Modal top accent stripe */
.tts-modal::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #6366f1, #38bdf8);
}

/* ── Close button ──────────────────────────────── */
.tts-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.2s;
  z-index: 2;
}
.tts-modal-close:hover { background: #e2e8f0; color: #0f172a; }

/* ── Modal inner ───────────────────────────────── */
.tts-modal-inner { padding: 32px 36px 36px; }

/* ── Logo & title ──────────────────────────────── */
.tts-modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.tts-modal-logo .logo-bubble {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 800;
}

.tts-modal-logo span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.tts-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  font-family: 'Sora', sans-serif;
}

.tts-modal-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 24px;
}

/* ── Tabs ──────────────────────────────────────── */
.tts-tabs {
  display: flex;
  gap: 0;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.tts-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
  font-family: inherit;
}

.tts-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Form ──────────────────────────────────────── */
.tts-form { display: flex; flex-direction: column; gap: 14px; }

.tts-field { position: relative; }

.tts-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.tts-field-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.tts-field-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.tts-field-input.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.tts-field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 1rem;
}

/* Password toggle */
.tts-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  font-size: 1rem;
  transition: color 0.2s;
}
.tts-pw-toggle:hover { color: #2563eb; }

/* ── Submit button ─────────────────────────────── */
.tts-submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  margin-top: 4px;
}

.tts-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}

.tts-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.tts-submit-btn .tts-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.tts-submit-btn.loading .tts-spinner { display: block; }
.tts-submit-btn.loading .tts-btn-text { display: none; }

/* ── Divider ───────────────────────────────────── */
.tts-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.tts-divider::before, .tts-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.tts-divider span { font-size: 0.75rem; color: #94a3b8; font-weight: 500; white-space: nowrap; }

/* ── Google button ─────────────────────────────── */
.tts-google-btn {
  width: 100%;
  padding: 11px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tts-google-btn:hover { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.tts-google-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.tts-google-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

/* ── Error / success messages ──────────────────── */
.tts-message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
  align-items: flex-start;
  gap: 8px;
}
.tts-message.show { display: flex; }
.tts-message.error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.tts-message.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.tts-message.info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Forgot password link ──────────────────────── */
.tts-forgot {
  text-align: right;
  margin-top: -8px;
}
.tts-forgot a {
  font-size: 0.8rem;
  color: #2563eb;
  text-decoration: none;
}
.tts-forgot a:hover { text-decoration: underline; }

/* ── Remember me ───────────────────────────────── */
.tts-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
}

.tts-remember input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ── Footer links ──────────────────────────────── */
.tts-modal-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 16px;
}
.tts-modal-footer a { color: #2563eb; text-decoration: none; }
.tts-modal-footer a:hover { text-decoration: underline; }

/* ── Header user menu ──────────────────────────── */
.tts-user-menu-wrap {
  position: relative;
}

.tts-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  cursor: pointer;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.tts-user-trigger:hover { background: rgba(255,255,255,0.18); }

.tts-user-trigger img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.tts-user-trigger .tts-chevron {
  font-size: 0.6rem;
  opacity: 0.7;
  transition: transform 0.2s;
}

.tts-user-menu-wrap.open .tts-chevron { transform: rotate(180deg); }

.tts-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  border: 1px solid #e2e8f0;
  min-width: 220px;
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.22s ease;
}

.tts-user-menu-wrap.open .tts-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tts-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tts-dropdown-header img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}

.tts-dropdown-name { font-size: 0.875rem; font-weight: 700; color: #0f172a; display: block; }
.tts-dropdown-email { font-size: 0.75rem; color: #94a3b8; display: block; }

.tts-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.tts-dropdown-item:hover { background: #f8fafc; color: #0f172a; }
.tts-dropdown-item.danger { color: #ef4444; }
.tts-dropdown-item.danger:hover { background: #fef2f2; }

.tts-dropdown-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* ── Solve bar (sticky bottom on problem pages) ── */
.tts-solve-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e2e8f0;
  z-index: 100;
  padding: 12px 24px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.tts-solve-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tts-solved-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tts-mark-btn { font-size: 0.85rem; padding: 9px 18px; }

/* ── Toast notification ────────────────────────── */
.tts-toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tts-toast.show { transform: translateX(0); }
.tts-toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.tts-toast.error   { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* ── My Progress page ──────────────────────────── */
.tts-progress-page { max-width: 900px; margin: 0 auto; }

.tts-profile-card {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  color: #fff;
}

.tts-profile-avatar-wrap { position: relative; flex-shrink: 0; }

.tts-profile-avatar {
  width: 72px !important;
  height: 72px !important;
  border-radius: 50% !important;
  border: 3px solid rgba(255,255,255,0.3) !important;
  object-fit: cover;
}

.tts-auth-badge {
  position: absolute;
  bottom: 0; right: 0;
  width: 22px; height: 22px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

.tts-profile-info { flex: 1; }
.tts-profile-info h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; color: #fff; }
.tts-profile-info p  { color: rgba(255,255,255,0.65); font-size: 0.875rem; margin-bottom: 6px; }
.tts-joined { font-size: 0.75rem; color: rgba(255,255,255,0.45); }

.tts-profile-stats-row { display: flex; gap: 24px; margin-left: auto; flex-wrap: wrap; }
.tts-pstat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tts-pstat-icon   { font-size: 1.2rem; }
.tts-pstat-number { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.tts-pstat-label  { font-size: 0.72rem; color: rgba(255,255,255,0.55); }

.tts-section-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.tts-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 18px;
}

.tts-badges-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.tts-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: linear-gradient(135deg,#eff6ff,#e0e7ff);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  min-width: 80px;
}
.tts-badge-icon { font-size: 1.5rem; }
.tts-badge-label { font-size: 0.72rem; font-weight: 700; color: #3730a3; }

.tts-table-wrap { overflow-x: auto; }

.tts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tts-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.tts-table tr:last-child td { border-bottom: none; }
.tts-table tr:hover td { background: #f8fafc; }

.tts-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.tts-status-solved   { background: #dcfce7; color: #15803d; }
.tts-status-attempted { background: #fef9c3; color: #a16207; }

.tts-empty {
  text-align: center;
  padding: 48px 20px;
  color: #64748b;
}
.tts-empty p { margin-bottom: 20px; }

/* ── Animations ────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
  .tts-modal-inner { padding: 24px 22px 28px; }
  .tts-profile-card { flex-direction: column; text-align: center; }
  .tts-profile-stats-row { margin: 0 auto; }
}
