/* =============================================
   AZ Learner Team Page Styles
   ============================================= */

/* --- CSS Variables / Brand Colors --- */
:root {
  --brand-blue: #3b82f6;
  --brand-blue-dark: #1d4ed8;
  --brand-orange: #FFAB40;
  --brand-purple: #a855f7;
  --bg-dark: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.5);
  --radius-card: 16px;
  --radius-btn: 8px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Animated Background --- */
.bg-animated {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(-45deg, #020617, #0f172a, #1e3a8a, #172554);
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
}

@keyframes gradientBG {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Utility --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   SITE HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-logo:hover {
  color: var(--brand-blue);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 50px;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-back:hover {
  background: var(--brand-blue);
  color: white;
}

.nav-back svg {
  width: 16px;
  height: 16px;
}

/* =============================================
   PAGE HERO / HEADER SECTION
   ============================================= */
.page-hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-badge span {
  width: 6px;
  height: 6px;
  background: var(--brand-blue);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.page-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* =============================================
   TEAM GRID SECTION
   ============================================= */
.team-section {
  padding: 20px 0 80px;
}

/* Loading / error states */
.team-loading,
.team-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.team-error {
  color: #f87171;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Team grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 16px;
}

/* CEO card – centred in its own full-width row */
.ceo-card {
  grid-column: 1 / -1;
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}

/* =============================================
   PROFILE CARD
   ============================================= */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--transition-med), box-shadow var(--transition-med), background var(--transition-med), border-color var(--transition-med);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.profile-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
}

/* Card top accent bar */
.card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
}

/* Card image */
.card-image-wrap {
  padding: 28px 28px 0;
  display: flex;
  justify-content: center;
}

.card-image {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(59, 130, 246, 0.4);
  background: #1e3a8a;
  transition: border-color var(--transition-fast);
}

.profile-card:hover .card-image {
  border-color: var(--brand-blue);
}

/* Card body */
.card-body {
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-align: center;
}

.card-role {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-blue);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.card-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  text-align: center;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(1.65em * 3);
}

/* View Profile button */
.btn-view-profile {
  display: block;
  width: 100%;
  padding: 11px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-btn);
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-top: auto;
}

.btn-view-profile:hover {
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

/* =============================================
   SITE FOOTER
   ============================================= */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* =============================================
   PROFILE DETAIL PAGE
   ============================================= */

/* Profile hero */
.profile-hero {
  padding: 60px 0 48px;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(59, 130, 246, 0.5);
  background: #1e3a8a;
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.08);
}

.profile-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.profile-hero .role-badge {
  display: inline-block;
  padding: 5px 18px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 50px;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Share profile button */
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 22px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 50px;
  color: var(--brand-blue);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-share:hover,
.btn-share:focus-visible {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.7);
  outline: none;
  transform: translateY(-1px);
}

.btn-share svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Profile sections layout */
.profile-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 80px;
}

.profile-content .full-width {
  grid-column: 1 / -1;
}

/* Section cards */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 28px;
}

.section-card h2 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card h2::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: var(--brand-blue);
  border-radius: 2px;
}

.section-card p {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.9375rem;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.skill-tag {
  padding: 5px 14px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 50px;
  color: #c084fc;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.skill-tag:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #e879f9;
}

/* Projects placeholder */
.projects-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.projects-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* Social links */
.socials-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-link.github {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}
.social-link.github:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.social-link.linkedin {
  background: rgba(10, 102, 194, 0.12);
  border: 1px solid rgba(10, 102, 194, 0.35);
  color: #60a5fa;
}
.social-link.linkedin:hover {
  background: #0a66c2;
  color: white;
  border-color: #0a66c2;
}

.social-link.twitter {
  background: rgba(29, 161, 242, 0.1);
  border: 1px solid rgba(29, 161, 242, 0.3);
  color: #38bdf8;
}
.social-link.twitter:hover {
  background: #1da1f2;
  color: white;
  border-color: #1da1f2;
}

.social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

/* ---- Team join CTA ---- */
.team-join-cta {
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.team-join-link {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.team-join-link:hover {
  color: var(--brand-blue-dark);
  text-decoration: underline;
}

/* =============================================
   TEAM PROFILE FORM PAGE  (profile-form.html)
   ============================================= */

/* Page layout */
.pf-main {
  padding: 20px 0 80px;
}

.pf-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.pf-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 18px;
  background: var(--brand-blue);
  border-radius: 2px;
}

.pf-section-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.pf-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

/* Form */
.pf-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 28px;
}

.pf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-required {
  color: #f87171;
}

.pf-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.pf-input::placeholder {
  color: var(--text-muted);
}

.pf-input:focus {
  border-color: var(--brand-blue);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pf-input.pf-input-error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.pf-textarea {
  resize: vertical;
  min-height: 100px;
}

.pf-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pf-error {
  font-size: 0.8rem;
  color: #f87171;
  min-height: 1em;
}

.pf-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 4px 0;
}

/* Social field icons */
.pf-field-social .pf-label {
  color: var(--text-secondary);
}

.pf-social-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Submit button */
.pf-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--brand-blue);
  border: none;
  border-radius: var(--radius-btn);
  color: white;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  margin-top: 8px;
}

.pf-btn-submit:hover {
  background: var(--brand-blue-dark);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.pf-btn-submit:active {
  transform: translateY(0);
}

.pf-btn-submit svg {
  width: 18px;
  height: 18px;
}

/* ---- Preview column ---- */
.pf-preview-col {
  position: sticky;
  top: 80px;
}

.pf-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.pf-preview-grid {
  grid-template-columns: 1fr !important;
  margin-bottom: 28px;
}

/* Disable pointer events on the placeholder "View Profile" span */
.pf-preview-btn-placeholder {
  pointer-events: none;
  opacity: 0.7;
  cursor: default;
}

/* ---- Generated output ---- */
.pf-output {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.pf-output.is-visible {
  display: flex;
}

.pf-output-success {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-btn);
  color: #86efac;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.pf-output-success svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #4ade80;
}

.pf-output-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.pf-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.pf-output-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.pf-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 50px;
  color: var(--brand-blue);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pf-copy-btn:hover {
  background: var(--brand-blue);
  color: white;
}

.pf-copy-btn.copied {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.pf-copy-btn svg {
  width: 14px;
  height: 14px;
}

.pf-code {
  padding: 18px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

/* Next-steps card */
.pf-instructions {
  /* reuses .section-card */
}

.pf-steps {
  list-style: decimal;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pf-steps li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.pf-steps code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-primary);
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Tablet */
@media (max-width: 768px) {
  .profile-content {
    grid-template-columns: 1fr;
  }

  .profile-content .full-width {
    grid-column: 1;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .page-hero {
    padding: 56px 0 40px;
  }

  .page-hero h1 {
    font-size: 2rem;
  }

  /* Form layout stacks on tablet */
  .pf-layout {
    grid-template-columns: 1fr;
  }

  .pf-preview-col {
    position: static;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .card-image-wrap {
    padding: 20px 20px 0;
  }

  .card-body {
    padding: 16px 20px 20px;
  }

  .page-hero {
    padding: 40px 0 32px;
  }

  .page-hero h1 {
    font-size: 1.75rem;
  }

  .socials-list {
    flex-direction: column;
  }

  .social-link {
    justify-content: center;
  }
}
