/**
 * Mind Bridge Institute, Patna
 * Student Profile Stylesheet — AMOLED Dark Educational SaaS Theme
 * File: profile.css
 * 
 * Deep obsidian black palette with metallic gold accents,
 * subtle borders, compact rectangular cards, and mobile responsiveness.
 */

:root {
  --obsidian-bg:        #08090C;
  --obsidian-surface:   #0E1017;
  --obsidian-card:      #131620;
  --obsidian-elevated:  #181C28;
  --obsidian-input:     #0A0C13;
  --obsidian-line:      rgba(212, 175, 55, 0.16);
  --obsidian-border:    rgba(255, 255, 255, 0.08);
  --obsidian-border-sub:rgba(255, 255, 255, 0.05);

  --gold-primary:       #D4AF37;
  --gold-bright:        #F5C842;
  --gold-glow:          rgba(212, 175, 55, 0.25);
  --gold-ambient:       rgba(212, 175, 55, 0.08);

  --accent-blue:        #38BDF8;
  --accent-green:       #10B981;
  --accent-red:         #EF4444;

  --text-primary:       #FFFFFF;
  --text-heading:       #FAF9F6;
  --text-secondary:     #CBD2DE;
  --text-muted:         #8E96A4;
  --text-dim:           #64748B;

  --radius-xs:          6px;
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
  --radius-full:        9999px;

  --shadow-sm:          0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card:        0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-elevated:    0 16px 36px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--obsidian-bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(212, 175, 55, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #050608 0%, #08090C 100%);
  color: var(--text-secondary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px; /* Space for bottom nav */
  overflow-x: hidden;
}

/* ============================================================
   TOPBAR NAVIGATION
   ============================================================ */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(10, 12, 17, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--obsidian-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  background: #000;
}

.brand-crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-names {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--gold-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-link-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

.header-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--obsidian-surface);
  border: 1px solid var(--gold-primary);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.header-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   MAIN CONTAINER & IN-PAGE HEADER
   ============================================================ */
.profile-container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
}

.inpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-border);
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--gold-bright);
  border-color: var(--gold-primary);
}

/* Alert Notification Toast */
.profile-alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.86rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: alertFadeIn 0.25s ease;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.profile-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
}

.profile-alert.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
}

/* ============================================================
   SECTION 1: PROFILE OVERVIEW CARD
   ============================================================ */
.profile-card {
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.profile-header-banner {
  height: 96px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(14, 16, 23, 0.95) 100%);
  border-bottom: 1px solid var(--obsidian-line);
}

.profile-header-content {
  padding: 0 24px 24px;
  margin-top: -46px;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #000;
  border: 3px solid #0E1017;
  outline: 2px solid var(--gold-primary);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-initial-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1C202F 0%, #0E1017 100%);
  color: var(--gold-bright);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--obsidian-elevated);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.avatar-wrap:hover .avatar-edit-badge {
  background: var(--gold-primary);
  color: #000;
  transform: scale(1.1);
}

.avatar-upload-input {
  display: none;
}

.btn-toggle-edit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--obsidian-elevated);
  border: 1px solid var(--obsidian-border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-edit:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.1);
}

.btn-toggle-edit.active-cancel {
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
  background: rgba(239, 68, 68, 0.08);
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-email-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-email-verified {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.badge-email-unverified {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
}

.badge-class {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-bright);
}

.btn-verify-now {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-verify-now:hover {
  background: var(--gold-primary);
  color: #000;
}

/* ============================================================
   SECTION 2: ACADEMIC & PROFILE INFORMATION (VIEW & EDIT)
   ============================================================ */
.section-card {
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.section-title-wrap {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--obsidian-border-sub);
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* Info Grid (View Mode) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-cell {
  background: var(--obsidian-card);
  border: 1px solid var(--obsidian-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.info-cell:hover {
  border-color: rgba(212, 175, 55, 0.3);
  background: var(--obsidian-elevated);
}

.info-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.info-value {
  font-size: 0.94rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-value.empty {
  color: var(--text-dim);
  font-weight: 500;
}

/* Edit Mode Form */
.edit-form-wrap {
  display: none;
}

.edit-form-wrap.active {
  display: block;
  animation: editSlideIn 0.25s ease;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-mark {
  color: var(--accent-red);
  font-weight: 700;
}

.readonly-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.form-input {
  background: var(--obsidian-input);
  border: 1px solid var(--obsidian-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
  background: #0E1017;
}

.form-input.disabled-input {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--obsidian-border-sub);
}

.btn-cancel-action {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-border);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-save-action {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #FFE89D 0%, #D4AF37 50%, #B88E28 100%);
  border: none;
  color: #050608;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
}

.btn-save-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.45);
}

/* ============================================================
   SECTION 3: ACCOUNT NAVIGATION & ACTIONS
   ============================================================ */
.account-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.account-action-card {
  background: var(--obsidian-card);
  border: 1px solid var(--obsidian-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-action-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  background: var(--obsidian-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.action-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.action-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-icon-wrap.gold {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold-bright);
}

.action-icon-wrap.blue {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-blue);
}

.action-icon-wrap.green {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
}

.action-icon-wrap.red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #F87171;
}

.action-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.action-card-title.red {
  color: #F87171;
}

.action-card-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-card-arrow {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.account-action-card:hover .action-card-arrow {
  color: var(--gold-bright);
  transform: translateX(3px);
}

.account-action-card.signout-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.account-action-card.signout-card:hover .action-card-arrow.red {
  color: #F87171;
}

/* ============================================================
   FIXED BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: rgba(8, 9, 12, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--obsidian-line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0 8px;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 4px;
  transition: all 0.15s ease;
}

.bnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bnav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bnav-item:hover {
  color: var(--text-secondary);
}

.bnav-item.active {
  color: var(--gold-bright);
}

.bnav-item.active .bnav-icon svg {
  stroke: var(--gold-bright);
}

/* ============================================================
   RESPONSIVENESS (MOBILE-FIRST)
   ============================================================ */
@media (max-width: 640px) {
  .profile-container {
    padding: 16px 14px 40px;
  }

  .dash-topbar {
    padding: 0 14px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .account-actions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-header-content {
    padding: 0 16px 20px;
  }

  .section-card {
    padding: 18px 16px;
  }

  .profile-name {
    font-size: 1.25rem;
  }
}
