﻿.profile{
  display:flex;
  justify-content:center;
  padding: 60px 24px 80px;
  position: relative;
  z-index: 1;
}

.profile__card{
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-strong);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.profile__card::before{
  content:"";
  position: absolute;
  inset: 0 0 auto 0;
  height: 120px;
  background: linear-gradient(180deg, rgb(36 127 209 / 65%), #ffffff);
  opacity: .9;
  pointer-events: none;
}

.profile__card > *{
  position: relative;
  z-index: 1;
}

.profile__title{
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.profile__row{
  display:flex;
  justify-content:space-between;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.profile__row:last-of-type{border-bottom: none}

.profile__row strong{color: var(--ink)}
.profile__row strong.muted{color: var(--muted)}
.profile__progress{
  width: min(260px, 60%);
  display:flex;
  flex-direction: column;
  gap: 6px;
  align-items:flex-end;
}
.progressbar__track{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(45,124,195,.12);
  border: 1px solid rgba(45,124,195,.18);
  overflow:hidden;
}
.progressbar__fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  border-radius: 999px;
  transition: width .2s ease;
}
.progressbar__meta{
  font-weight: 800;
  color: var(--ink);
  font-size: 12px;
}

.profile__actions{
  display:flex;
  gap: 12px;
  margin-top: 18px;
}

.profile__tabs{
  display:flex;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 6px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  flex-wrap: wrap;
}
.tabbtn{
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 14px;
  font-weight: 700;
  color: var(--ink);
  cursor:pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.tabbtn:hover{color: var(--blue)}
.tabbtn.active{
  background: var(--blue);
  color: #ffffff;
  border-color: rgba(45,124,195,.65);
  box-shadow: var(--glow);
}

.profile__panel{animation: fadeIn .2s ease}

.history__list{
  display:grid;
  gap: 10px;
}
.history__item{
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.history__item.pass{
  border-color: rgba(22,163,74,.55);
  background: rgba(22,163,74,.10);
}
.history__item.fail{
  border-color: rgba(239,68,68,.55);
  background: rgba(239,68,68,.10);
}
.history__title{font-weight: 800}
.history__meta{
  color: var(--muted);
  font-size: 12px;
}
.history__score{
  font-weight: 800;
}
.history__empty{
  color: var(--muted);
  font-size: 13px;
  padding: 6px 2px;
}

@keyframes fadeIn{
  from{opacity:.5; transform: translateY(2px)}
  to{opacity:1; transform: translateY(0)}
}

body.theme-dark .profile__card::before{opacity:.35}
body.theme-dark .profile__tabs{background: transparent}
body.theme-dark .progressbar__track{background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.18)}
body.theme-dark .history__item{background: #0b1326}

@media (max-width: 520px){
  .profile{padding: 40px 18px 60px}
  .profile__card{padding: 18px}
  .profile__actions{flex-direction: column}
}

@media (max-width: 420px){
  .profile__row{flex-direction: column; align-items:flex-start; gap: 6px}
  .profile__progress{width: 100%; align-items:flex-start}
}

@media (orientation: landscape) and (max-height: 520px){
  .profile{
    padding: 32px 18px 48px;
  }
  .profile__card{
    padding: 18px;
  }
  .profile__actions{
    flex-direction: row;
    flex-wrap: wrap;
  }
}
