/* mypage.css */

/* ============================================================
   1. 글로벌 디자인 시스템 및 테마 스펙 통합
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;500;600;700;800&display=swap');

:root {
  --bg-color: #030712;
  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;
  --card-bg: rgba(15, 23, 42, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary-color: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --input-bg: rgba(255, 255, 255, 0.03);
  --cyan-point: #06b6d4;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(15, 23, 42, 0.06);
  --primary-glow: rgba(99, 102, 241, 0.06);
  --input-bg: rgba(15, 23, 42, 0.02);
  --cyan-point: #0891b2;
}

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

body {
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
}

/* 사이드바 여백 마진 보정 레이아웃 */
.home_content {
  margin-left: 78px;
  width: calc(100% - 78px);
  padding: 40px 40px 80px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.sidebar.open~.home_content,
.sidebar.active~.home_content {
  margin-left: 250px;
  width: calc(100% - 250px);
}

.mypage-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   2. 프로필 히어로 카드 (.profile-card)
   ============================================================ */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar i {
  font-size: 4.5rem;
  color: var(--primary-color);
}

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

.nickname-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nickname-row h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.btn-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-edit:hover {
  color: var(--cyan-point);
  background: rgba(6, 182, 212, 0.1);
}

.user-role-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  color: #818cf8;
  align-self: flex-start;
}

.account-actions {
  display: flex;
  gap: 12px;
}

/* ============================================================
   3. 맞춤 기술 스택 및 로드맵 구역 (.dashboard-section)
   ============================================================ */
.dashboard-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.is-hidden {
  display: none !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 16px;
}

.section-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.section-header h3 i {
  color: #f59e0b;
}

.step-pill {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--cyan-point);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

/* 기술 스택 칩 배치 링 */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tag-row .tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--cyan-point);
}

/* 로드맵 박스 (원형 게이지 + 리스트 정렬 스플릿) */
.roadmap-box {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
}

.progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  padding: 32px;
  border-radius: 20px;
  text-align: center;
}

.progress-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: background 0.4s ease;
}

.progress-ring-wrap::after {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  background: #0f1322;
  border-radius: 50%;
  z-index: 1;
}

[data-theme="light"] .progress-ring-wrap::after {
  background: #ffffff;
}

.ring-value {
  position: relative;
  z-index: 2;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-text .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* 우측 가변 로드맵 리스트 슬롯 */
.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}

.step.primary {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.02);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.04);
}

.step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-border);
  color: var(--text-sub);
}

.step.primary .step-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
}

.step-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.step-tags .tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--card-border);
  color: var(--text-muted);
}

.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
}

.step-actions .progress {
  flex: 1;
  height: 6px;
  background: var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.step-actions .progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ============================================================
   4. 팀 프로젝트 현황 그리드 (.project-grid)
   ============================================================ */
.count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--card-border);
  color: var(--text-sub);
  padding: 4px 12px;
  border-radius: 8px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.pcard {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
}

.pcard:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.3);
}

.pcard-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.pcard-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.5;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pcard .badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--card-border);
  color: var(--text-sub);
}

.pcard .badge.status {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.pcard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--card-border);
  padding-top: 12px;
  margin-top: auto;
}

.pcard-foot .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pbtns {
  display: flex;
  gap: 6px;
}

.pbtns .action-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

.pbtns .action-btn.primary {
  background: var(--primary-color);
  color: white;
}

/* ============================================================
   5. [AI 추천 보완 기능] 실시간 인텔리전스 레이더 역량 바 스타일
   ============================================================ */
.skill-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.metric-bar-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  padding: 16px;
  border-radius: 12px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-line {
  height: 6px;
  background: var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.metric-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* ============================================================
   6. 버튼, 공용 모달 및 미디어 쿼리 가드
   ============================================================ */
.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-sub);
}

.btn-ghost:hover {
  background: var(--card-border);
  color: var(--text-main);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-danger:hover {
  background: #ef4444;
  color: white;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: rgba(255, 255, 255, 0.01);
  border: 2px dashed var(--card-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.6;
}

/* 모달 백드롭 셋업 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999 !important;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #0b0f19;
  border: 1px solid var(--card-border);
  width: min(460px, calc(100vw - 32px));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

[data-theme="light"] .modal {
  background: #ffffff;
}

.modal h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

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

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
}

@media (max-width: 960px) {
  .roadmap-box {
    grid-template-columns: 1fr;
  }

  .profile-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-actions {
    width: 100%;
  }

  .account-actions button {
    flex: 1;
  }
}