@import url('base.css');

/* ===== PROFILE LAYOUT ===== */
.profile-layout {
  display: block;
}

/* ===== PROFILE CARD ===== */
.profile-card {
  max-width: 820px;
  margin: 0 auto 34px;
  text-align: center;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.profile-banner {
  height: 180px;
  border-radius: 14px;
  background: var(--card2);
  background-size: cover;
  background-position: center;
}
.profile-info { padding: 0 20px 20px; }
.profile-avatar-wrap {
  margin-top: -40px; margin-bottom: 12px;
  position: relative; display: inline-block;
}
.profile-avatar {
  width: 170px; height: 170px; border-radius: 50%;
  border: 6px solid var(--bg); object-fit: cover;
  background: var(--card2);
}
.profile-name { font-size: 44px; font-weight: 400; font-family: var(--display); margin-bottom: 0; }
.profile-username { color: var(--muted); font-size: 24px; margin-bottom: 18px; }
.profile-bio { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.profile-since { font-size: 12px; color: var(--muted2); margin-bottom: 16px; }

/* Stats grid */
.profile-stats-grid {
  display: none;
}
.pstat {
  background: var(--card2); padding: 12px 8px; text-align: center;
}
.pstat-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.pstat-lbl { font-size: 11px; color: var(--muted2); margin-top: 3px; }

/* Social stats */
.social-stats { display: flex; justify-content: center; gap: 0; margin-bottom: 18px; }
.social-stat { text-align: center; min-width: 170px; padding: 0 22px; border-right: 5px solid rgba(217,217,217,.4); }
.social-stat:last-child { border-right: 0; }
.social-stat strong { display: block; font-size: 42px; font-weight: 400; font-family: var(--display); line-height: 1; }
.social-stat span { font-size: 18px; color: var(--muted2); }

/* ===== MAIN CONTENT ===== */
.profile-main { max-width: 980px; margin: 0 auto; }
.profile-settings-btn {
  width: 100%;
  justify-content: center;
}
.profile-project-grid {
  max-width: 100%;
}
.profile-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.profile-tabs .tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.section-title {
  font-size: 14px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Followers grid */
.followers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.follower-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 12px;
  text-align: center; text-decoration: none;
  transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.follower-card:hover { border-color: var(--border-hover); color: var(--accent); transform: translateY(-2px); }
.follower-card img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--card); }
.follower-name { font-size: 13px; font-weight: 600; color: var(--text); }

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}

@media (max-width: 760px) {
  .profile-card {
    margin-bottom: 22px;
  }
  .profile-banner {
    height: 118px;
    border-radius: 10px;
  }
  .profile-info {
    padding: 0 10px 14px;
  }
  .profile-avatar-wrap {
    margin-top: -32px;
    margin-bottom: 6px;
  }
  .profile-avatar {
    width: 96px;
    height: 96px;
    border-width: 4px;
  }
  .profile-name {
    max-width: 100%;
    font-size: 30px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }
  .profile-username {
    max-width: 100%;
    font-size: 16px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
  }
  .profile-bio {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 10px;
  }
  .profile-since {
    margin-bottom: 10px;
  }
  .profile-stats-grid {
    display: none;
  }
  .social-stats {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 12px;
  }
  .social-stat {
    min-width: 0;
    flex: 1 1 0;
    max-width: none;
    padding: 0 6px;
    border-right: 3px solid rgba(217,217,217,.45);
    border-radius: 0;
    background: transparent;
  }
  .social-stat:last-child {
    border-right: 0;
  }
  .social-stat strong {
    font-size: 25px;
  }
  .social-stat span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.15;
    color: var(--muted);
    white-space: normal;
    overflow-wrap: break-word;
  }
  .profile-main {
    max-width: 100%;
  }
  .profile-tabs {
    margin: 0 -14px 18px;
    padding: 0 14px 8px;
  }
  .profile-tabs .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .profile-project-grid {
    gap: 18px;
  }
  .followers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .profile-avatar {
    width: 88px;
    height: 88px;
  }
  .profile-name {
    font-size: 27px;
  }
  .social-stat strong {
    font-size: 22px;
  }
  .social-stat span {
    font-size: 11px;
  }
}

/* ===== SETTINGS PAGE ===== */
.settings-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start;
}
.settings-nav {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  position: sticky; top: 80px;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; color: var(--muted); font-size: 14px;
  text-decoration: none; font-weight: 500; transition: all 0.15s;
  border-left: 2px solid transparent;
}
.settings-nav-item:hover { color: var(--text); background: var(--card2); }
.settings-nav-item.active { color: var(--accent); background: rgba(111,140,255,0.08); border-left-color: var(--accent); }
.settings-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
}
.settings-section h2 { font-size: 16px; font-weight: 700; margin-bottom: 20px; }

.profile-style-preview {
  min-height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
}

@media (max-width: 768px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; padding: 8px; }
  .settings-nav-item { border-left: none; border-radius: var(--radius-sm); border-bottom: 2px solid transparent; }
  .settings-nav-item.active { border-bottom-color: var(--accent); border-left-color: transparent; }
}
