/* ============================================
   EGGLISH – PERFIL  |  Perfil.css
   ============================================ */

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

:root {
  --blue:    #1cb0f6;
  --blue-d:  #0090d9;
  --yellow:  #f5a623;
  --yellow-d:#d48800;
  --green:   #58cc02;
  --green-d: #3ea800;
  --purple:  #8549ba;
  --purple-d:#6a3a96;
  --orange:  #ff9600;
  --orange-d:#e07800;
  --teal:    #00c5a1;
  --teal-d:  #009e82;
  --red:     #ff4b4b;
  --white:   #ffffff;
  --bg:      #f0f4f8;
  --card:    #ffffff;
  --text:    #1a1a2e;
  --mid:     #4b5563;
  --light:   #9ca3af;
  --border:  #e5e7eb;
  --radius:  20px;
  --shadow:  0 4px 24px rgba(0,0,0,0.10);
  --font:    'Nunito', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  text-decoration: none;
  color: inherit;
}

/* ══════════ NAVBAR ══════════ */

.navbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); padding: 0 32px; height: 68px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.navbar-logo { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 40px; height: 40px; object-fit: contain; }
.logo-text { font-size: 1.4rem; font-weight: 900; color: var(--text); }

/* Quita los puntos/bullets de listas en el navbar */
.navbar-links,
.navbar-links ul,
.navbar-links li { list-style: none; margin: 0; padding: 0; }

.navbar-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 24px; text-decoration: none;
  font-size: 0.9rem; font-weight: 700; color: var(--mid);
  transition: background .2s, color .2s; white-space: nowrap; line-height: 1;
}
.navbar-links a:hover { background: var(--bg); color: var(--text); }
.navbar-links a.active { background: #dbeafe; color: var(--blue); }
.navbar-auth { display: flex; align-items: center; gap: 12px; }
.btn-entrar {
  font-family: var(--font); font-weight: 700; font-size: .9rem;
  color: var(--mid); text-decoration: none; padding: 8px 14px; border-radius: 12px;
}
.btn-registrarse {
  font-family: var(--font); font-weight: 800; font-size: .95rem;
  color: var(--white); background: var(--yellow); text-decoration: none;
  padding: 10px 22px; border-radius: 12px;
  box-shadow: 0 4px 0 var(--yellow-d); transition: transform .1s, box-shadow .1s;
}
.btn-registrarse:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--yellow-d); }

/* --- DISEÑO ESCRITORIO --- */
@media (min-width: 769px) {
  .hamburger { display: none; }

  .nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 20px;
  }

  .navbar-links {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 4px;
  }

  .navbar-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }
}

/* --- DISEÑO MÓVIL (MAX 768PX) --- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1100;
  }

  .navbar-logo {
    z-index: 1200;
    position: relative;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex !important;
    flex-direction: column;
    padding: 100px 30px 40px;
    transition: left 0.4s ease-in-out;
    z-index: 1050;
    overflow-y: auto;
  }

  .nav-menu.active { left: 0; }

  .navbar-links {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    display: flex !important;
  }

  .navbar-links a {
    font-size: 1.2rem;
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    display: block;
    text-align: left;
  }

  .navbar-auth {
    flex-direction: column;
    width: 100%;
    gap: 15px;
    margin-top: 30px;
    border-top: 2px solid var(--border);
    padding-top: 30px;
    display: flex !important;
  }

  .btn-registrarse {
    text-transform: none !important;
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1.1rem;
  }
}

/* ══════════ MAIN LAYOUT ══════════ */
.main-content {
  display: flex;
  gap: 28px;
  padding: 32px 40px;
  flex: 1;
  align-items: flex-start;
}

/* ══════════ LEFT PANEL ══════════ */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 280px;
  flex-shrink: 0;
}

/* PROFILE CARD */
.profile-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  border: 2px solid var(--border);
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}

.avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--blue);
  background: var(--bg);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--yellow);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform .15s;
}
.avatar-edit-btn:hover { transform: scale(1.1); }

.profile-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 8px;
}
.profile-joined {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mid);
}

/* INFO CARDS (idiomas, amigos) */
.info-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 20px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-blue {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.03em;
}
.link-blue:hover { text-decoration: underline; }

/* IDIOMAS */
.language-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flag-img {
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.lang-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
.lang-level {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--light);
}

/* AMIGOS */
.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background .2s;
  cursor: pointer;
}
.friend-item:hover { background: var(--bg); }

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--white);
  flex-shrink: 0;
}
.friend-avatar-maria { background: var(--purple); }
.friend-avatar-juan  { background: var(--blue); }

.friend-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}
.friend-exp {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--light);
}

.btn-ver-todos {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--blue);
  background: none;
  border: 2px solid var(--blue);
  border-radius: 10px;
  padding: 8px 0;
  cursor: pointer;
  transition: background .2s, color .2s;
  width: 100%;
}
.btn-ver-todos:hover { background: var(--blue); color: var(--white); }

/* ══════════ RIGHT PANEL ══════════ */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-width: 0;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
}

/* ══════════ ESTADÍSTICAS ══════════ */
.stats-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: 14px;
  padding: 16px 14px;
}

.stat-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--light);
  margin-top: 2px;
}

/* ══════════ LOGROS ══════════ */
.achievements-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.achievements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.achievements-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.achievement-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.achievement-item:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(28,176,246,0.10);
}

.achievement-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  position: relative;
}
.orange-bg     { background: #fff3e0; }
.yellow-bg     { background: #fffbe6; }
.blue-light-bg { background: #e8f4fd; }
.pink-bg       { background: #fce4ec; }

.achievement-icon--completed { opacity: 1; }

.check-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 0.85rem;
  line-height: 1;
}

.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.achievement-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.achievement-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text);
}
.achievement-level {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--white);
  background: var(--blue);
  padding: 2px 10px;
  border-radius: 99px;
  flex-shrink: 0;
}
.achievement-desc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mid);
}

/* BARRA DE PROGRESO */
.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-bar-wrapper > div:first-child {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}
.progress-bar--yellow { background: var(--yellow); }
.progress-bar--blue   { background: var(--blue); }

.progress-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--mid);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════ FOOTER ══════════ */
.footer {
  background: var(--white); border-top: 2px solid var(--border);
  text-align: center; padding: 36px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-logo    { width: 44px; height: 44px; object-fit: contain; }
.footer-brand   { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.footer-tagline { font-size: .88rem; color: var(--mid); font-weight: 600; max-width: 380px; line-height: 1.5; }
.footer-copy    { font-size: .8rem; color: var(--blue); font-weight: 700; margin-top: 4px; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    padding: 20px 16px;
  }
  .left-panel {
    width: 100%;
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar-links { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .achievement-item { flex-direction: column; align-items: flex-start; }
}