@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

/* ===================================================================
   1. DESIGN SYSTEM & COLOR TOKENS
   =================================================================== */
:root {
  --bg-main:         #dcd7c4;
  --bg-surface:      #FFFFFF;
  --bg-hero:         #1C1014;
  --bg-hero-alt:     #32151F;
  
  --primary-indigo:  #9F1239;
  --primary-hover:   #881337;
  --coral-accent:    #BE185D;
  --coral-hover:     #9D174D;
  --teal-free:       #0D9488;
  --amber-tag:       #B45309;

  --text-main:       #0F172A;
  --text-muted:      #64748B;
  --text-light:      #FCF8F9;
  --line-color:      #E2E8F0;

  --font-heading:    'Plus Jakarta Sans', sans-serif;
  --font-body:       'Inter', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;

  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       18px;

  --shadow-sm:       0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md:       0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg:       0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-glow:     0 0 20px rgba(190, 24, 93, 0.25);

  --transition:      all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===================================================================
   2. GLOBAL LAYOUT
   =================================================================== */
body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-main);
}

.account-page {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 24px;
}

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

/* ===================================================================
   3. SIDEBAR STYLING
   =================================================================== */
.account-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 90px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-color);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-indigo);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.sidebar-user-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-left: 10px;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.account-nav-item:hover {
  background: #FFF5F7;
  color: var(--coral-accent);
}

.account-nav-item.active {
  background: var(--coral-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #E11D48;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.logout-btn:hover {
  background: #FFE4E6;
}

/* ===================================================================
   4. CONTENT CARDS & PANELS
   =================================================================== */
.account-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.content-section {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.content-header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-color);
}

.content-header.compact {
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.content-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.content-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0 6px;
}

.content-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.content-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Profile Details Card */
.profile-card-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--line-color);
}

.large-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-indigo);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-main-info {
  flex-grow: 1;
}

.profile-main-info h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.profile-main-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.member-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.edit-profile-btn {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.edit-profile-btn:hover {
  border-color: var(--coral-accent);
  color: var(--coral-accent);
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  background: #FAFAFA;
  border: 1px solid var(--line-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-item strong {
  font-size: 14px;
  color: var(--text-main);
}

.status-text {
  color: #16A34A !important;
}

/* Stats Overview */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #FAFAFA;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
}

.plan-stat {
  color: var(--primary-indigo) !important;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Empty States */
.empty-content {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-content-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #FFF5F7;
  color: var(--coral-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.empty-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-content p {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 16px;
}

.content-action {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--coral-accent);
}

/* Test Attempt Row Card */
.test-attempt-card {
  background: #FAFAFA;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.test-attempt-card:hover {
  background: #FFFFFF;
  border-color: var(--coral-accent);
  box-shadow: var(--shadow-sm);
}

/* Performance Section */
.performance-placeholder {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.performance-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
}

.performance-item span {
  width: 220px;
}

.progress-track {
  flex-grow: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--coral-accent);
}

/* Settings List */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #FAFAFA;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-sm);
}

.setting-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.setting-row p {
  font-size: 13px;
  color: var(--text-muted);
}

.cooldown-notice {
  font-size: 11px;
  color: var(--amber-tag);
  margin-top: 4px;
  display: inline-block;
}

.setting-action-btn {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.setting-action-btn:hover {
  border-color: var(--coral-accent);
  color: var(--coral-accent);
}

/* ===================================================================
   5. MODALS & POPUPS
   =================================================================== */
.analysis-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 10, 13, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.analysis-modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.analysis-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-color);
  background: #FDFBFB;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

/* ===================================================================
   6. RESPONSIVE QUERIES
   =================================================================== */
@media (max-width: 860px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
  }

  .performance-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .performance-item span {
    width: 100%;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}