/*
 * 마이페이지 개요(대시보드) 전용 스타일. WEB-INF/views/mypage/dashboard.jsp 와 짝을 이룬다.
 *
 * mili-home-v3 시안의 MyPageContent 화면을 옮긴 것이다. 수치(폰트 크기·라운드·그라디언트
 * 각도와 스톱)는 시안 실측값을 그대로 쓴다 — 홈(css/home.css)과 같은 방침이다.
 *
 * 흰색 알파(rgba(255,255,255,.02) 등)는 브랜드 색이 아니라 시안이 지정한 표면 값이라
 * 토큰화하지 않고 그대로 둔다(home.css 상단 주석과 같은 이유).
 *
 * 셀렉터는 전부 .mypage-dash 접두사다. 같은 파일 아래쪽 "옛 위젯" 영역은
 * css/theme/components.css 의 재사용 컴포넌트(.widget-card 등)를 그대로 쓰므로 새 클래스를
 * 만들지 않는다 — --mili-* 시맨틱 토큰을 쓰는 컴포넌트라 <body class="mili-theme-dark"> 만으로
 * 다크로 재배색된다.
 */

/* ---------- 셸 ----------
   얼개(.app-frame / .app-frame__body / .app-topbar / .app-page)는
   theme/components.css §8 공용이다. 여기에는 개요 화면만 다른 점 하나만 남긴다 —
   아래 여백이 공용값(56px)보다 조금 좁다. */
.mypage-dash-main {
    padding-bottom: 48px;
}

/* ---------- 프로필 카드 ---------- */
.mypage-dash-profile {
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(146deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.01) 60%,
        rgba(170, 255, 25, 0.02) 100%);
    overflow: hidden;
    margin-bottom: 24px;
}

.mypage-dash-profile__body {
    padding: 20px 24px;
}

.mypage-dash-profile__head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.mypage-dash-profile__avatar {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(170, 255, 25, 0.25);
    background: rgba(0, 0, 0, 0.6);
    object-fit: cover;
    object-position: top;
}

.mypage-dash-profile__main {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 2px;
}

.mypage-dash-profile__name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mypage-dash-profile__name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--mili-ink);
}

/* 원본: bg rgba(81,162,255,.12) border rgba(81,162,255,.2) 글자 #51a2ff */
.mypage-dash-tag {
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid rgba(81, 162, 255, 0.2);
    background: rgba(81, 162, 255, 0.12);
    color: var(--mili-stat-time);
    font-size: 11px;
}

.mypage-dash-profile__summary {
    margin: 4px 0 0;
    font-size: 12px;
    color: #737373;
}

.mypage-dash-level {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.mypage-dash-level__tier {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    color: var(--mili-ink);
}

.mypage-dash-level__value {
    font-family: var(--mili-font-metric);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.mypage-dash-level__hint {
    margin: 6px 0 0;
    font-size: 10px;
    color: #8a948d;
}

/* 시안은 진행률을 얇은 선이 아니라 굵은 막대로 둔다 — 화면에서 "얼마나 남았는지"가
   프로필 다음으로 먼저 읽혀야 하는 정보라서다. 각진 시안이라 알약이 아니라 직각이다. */
.mypage-dash-bar {
    flex: 1 1 auto;
    height: 10px;
    background: rgba(var(--mili-fg-rgb), 0.1);
    overflow: hidden;
}

.mypage-dash-bar__fill {
    height: 100%;
    background: var(--mili-brand);
}

/* ---------- 스탯 미니 타일(원본: 색 점 + 라벨/값/설명) ---------- */
.mypage-dash-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .mypage-dash-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.mypage-dash-stat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: linear-gradient(146deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.mypage-dash-stat__dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
}

.mypage-dash-stat--streak .mypage-dash-stat__dot { background: var(--mili-stat-streak); }
.mypage-dash-stat--cert .mypage-dash-stat__dot { background: var(--mili-stat-badge); }
.mypage-dash-stat--mission .mypage-dash-stat__dot { background: var(--mili-stat-mission); }
.mypage-dash-stat--weekly .mypage-dash-stat__dot { background: var(--mili-stat-time); }

.mypage-dash-stat__label {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.mypage-dash-stat__value {
    font-family: var(--mili-font-metric);
    font-variant-numeric: tabular-nums;
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--mili-ink);
}

.mypage-dash-stat__note {
    margin: 0;
    font-size: 9px;
    color: #555;
}

/* ---------- 온보딩(역량진단 유도) 배너 ---------- */
/* 시안은 이 배너를 브랜드 라임 단색으로 채우고 글자를 어둡게 둔다 —
   화면에서 가장 먼저 처리해야 할 행동이라 유일하게 채움을 쓰는 자리다.
   예전에는 초록 그라디언트였는데 시안의 라임 단색과 인상이 달랐다. */
.mypage-dash-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--mili-brand);
    color: var(--mili-brand-on);
}

.mypage-dash-banner__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mili-brand-on);
}

.mypage-dash-banner__desc {
    margin: 2px 0 0;
    font-size: 12px;
    /* 라임 위에 얹는 보조 문구. 흰색 알파를 쓰면 오히려 대비가 떨어져 어두운 쪽으로 흐린다. */
    color: rgba(var(--mili-brand-on-rgb), 0.7);
}

/* 라임 위의 버튼이라 채움을 한 번 더 쓰지 않고 어두운 테두리만 두른다. */
.mypage-dash-banner__cta {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid rgba(var(--mili-brand-on-rgb), 0.35);
    background: transparent;
    color: var(--mili-brand-on);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease;
}

.mypage-dash-banner__cta:hover,
.mypage-dash-banner__cta:focus {
    background: rgba(var(--mili-brand-on-rgb), 0.12);
    color: var(--mili-brand-on);
}

/* ---------- 6칸 개요 그리드 ---------- */
.mypage-dash-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .mypage-dash-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .mypage-dash-overview {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.mypage-dash-overview__tile {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}

.mypage-dash-overview__value {
    font-family: var(--mili-font-metric);
    font-variant-numeric: tabular-nums;
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--mili-ink);
}

.mypage-dash-overview__label {
    margin: 4px 0 0;
    font-size: 11px;
    color: #737373;
}

/* ---------- 2단 카드 공통 ---------- */
.mypage-dash-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .mypage-dash-2col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- 위젯 카드 배치 그리드(.widget-card 를 담는 컨테이너) ----------
   design-system.md 가 "화면 전용 배치 보정은 css/mypage/dashboard.css 에 둔다"고
   지정한 클래스인데 정의가 빠져 있어, dashboard.jsp 의 위젯 7개가 2열·3열이 아니라
   전부 1열로 늘어져 있었다. 브레이크포인트는 위 .mypage-dash-2col·.mypage-dash-overview
   와 같은 값(768/960)을 쓴다 — 새 폭을 만들지 않는다. */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .dashboard-grid--2,
    .dashboard-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .dashboard-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.mypage-dash-card {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.02);
}

.mypage-dash-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mypage-dash-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mili-ink);
}

.mypage-dash-card__action {
    font-size: 12px;
    font-weight: 600;
    color: var(--mili-brand);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.mypage-dash-card__action:hover,
.mypage-dash-card__action:focus {
    color: var(--mili-brand-strong);
}

/* ---------- 이어서 학습하기 ---------- */
.mypage-dash-continue {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.03);
}

.mypage-dash-continue__flags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mypage-dash-pill {
    padding: 2px 8px;
    border-radius: 0;
    background: rgba(var(--mili-brand-rgb), 0.1);
    color: var(--mili-brand);
    font-size: 10px;
    font-weight: 700;
}

.mypage-dash-continue__type {
    font-size: 10px;
    color: #555;
}

.mypage-dash-continue__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mili-ink);
}

.mypage-dash-continue__subtitle {
    margin: 0 0 12px;
    font-size: 11px;
    color: #737373;
}

.mypage-dash-continue__progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mypage-dash-continue__progress-label {
    font-size: 10px;
    color: #737373;
}

.mypage-dash-continue__progress-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--mili-ink);
}

.mypage-dash-continue .mypage-dash-bar {
    margin-bottom: 12px;
}

.mypage-dash-continue__cta {
    display: block;
    width: 100%;
    padding: 8px 0;
    border: 1px solid rgba(var(--mili-brand-rgb), 0.2);
    border-radius: 0;
    background: rgba(var(--mili-brand-rgb), 0.1);
    color: var(--mili-brand);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease;
}

.mypage-dash-continue__cta:hover,
.mypage-dash-continue__cta:focus {
    background: rgba(var(--mili-brand-rgb), 0.18);
    color: var(--mili-brand);
}

/* ---------- 추천 학습 ---------- */
.mypage-dash-reco-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mypage-dash-reco {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.mypage-dash-reco:hover,
.mypage-dash-reco:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.mypage-dash-reco__icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
}

.mypage-dash-reco__icon--0 { background: linear-gradient(135deg, #7c3aed, #c026d3, #ec4899); }
.mypage-dash-reco__icon--1 { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.mypage-dash-reco__icon--2 { background: linear-gradient(135deg, #059669, #10b981, #34d399); }

.mypage-dash-reco__title {
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    font-size: 12px;
    font-weight: 600;
    color: var(--mili-ink);
}

.mypage-dash-reco__meta {
    margin: 2px 0 0;
    font-size: 11px;
    color: #555;
}

/* ---------- 바로가기 ---------- */
.mypage-dash-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mypage-dash-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.mypage-dash-shortcut:hover,
.mypage-dash-shortcut:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.mypage-dash-shortcut__icon {
    font-size: 18px;
    line-height: 1;
}

.mypage-dash-shortcut__label {
    font-size: 10px;
    line-height: 1.3;
    color: #a6a6aa;
    text-align: center;
}

/* ---------- 옛 위젯 섹션 제목(간단 구분선) ---------- */
.mypage-dash-section-title {
    margin: 8px 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
