@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* =====================================================
   zzan_attendance skin — .zzan-attendance-wrap scope
   ===================================================== */
.zzan-attendance-wrap {
    --att-primary:    #4f8ef7;
    --att-primary-d:  #3a7ae0;
    --att-primary-l:  #eff6ff;
    --att-success:    #22c55e;
    --att-success-l:  #f0fdf4;
    --att-danger:     #ef4444;
    --att-danger-l:   #fff5f5;
    --att-warning:    #f59e0b;
    --att-warning-l:  #fffbeb;
    --att-bg:         #ffffff;
    --att-bg2:        #f8fafc;
    --att-border:     #e2e8f0;
    --att-border-l:   #f1f5f9;
    --att-text:       #1e293b;
    --att-text-sub:   #64748b;
    --att-text-light: #94a3b8;
    --att-radius:     14px;
    --att-radius-sm:  10px;
    --att-shadow:     0 4px 20px rgba(0,0,0,0.05);

    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    font-size: 15px;
    color: var(--att-text);
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 4px;
}

.zzan-attendance-wrap *, .zzan-attendance-wrap *::before, .zzan-attendance-wrap *::after {
    box-sizing: inherit;
    font-family: inherit;
}

/* ─── 카드 ─────────────────────────────────────────── */
.att-card {
    background: var(--att-bg);
    border: 1px solid var(--att-border-l);
    border-radius: var(--att-radius);
    box-shadow: var(--att-shadow);
    padding: 24px;
    margin-bottom: 16px;
    overflow: hidden;
}

.att-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--att-text);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-section-title-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* ─── 상단 상태바 ────────────────────────────────────── */
.att-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.att-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--att-bg2);
    border: 1px solid var(--att-border);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 13px;
    font-weight: 600;
    color: var(--att-text-sub);
    white-space: nowrap;
}

.att-badge.is-checked {
    background: var(--att-success-l);
    border-color: #86efac;
    color: #166534;
}

.att-streak-badge {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
    border: none;
    font-weight: 700;
}

/* ─── 달력 네비게이션 ────────────────────────────────── */
.att-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.att-cal-nav .month-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--att-text);
}

.att-cal-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--att-bg2);
    border: 1px solid var(--att-border);
    color: var(--att-text-sub);
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    transition: all .15s;
    line-height: 1;
}

.att-cal-nav a:hover {
    background: var(--att-primary-l);
    border-color: var(--att-primary);
    color: var(--att-primary);
}

/* ─── 달력 그리드 ────────────────────────────────────── */
.att-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.att-calendar th {
    font-size: 11px;
    font-weight: 700;
    color: var(--att-text-sub);
    text-align: center;
    padding: 6px 0 10px;
    letter-spacing: 0.3px;
}

.att-calendar th:first-child { color: var(--att-danger); }
.att-calendar th:last-child  { color: var(--att-primary); }

.att-calendar td {
    text-align: center;
    padding: 3px 2px;
}

.att-calendar .day-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    color: var(--att-text);
    position: relative;
    transition: all .15s;
    cursor: default;
}

/* 출석 완료 */
.att-calendar .day-cell.is-attended {
    background: var(--att-primary);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(79,142,247,0.35);
}

.att-calendar .day-cell.is-attended::after {
    content: '✓';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 14px; height: 14px;
    background: var(--att-success);
    color: #fff;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 미출석 (과거) */
.att-calendar .day-cell.is-missed {
    color: #d1d5db;
}

.att-calendar .day-cell.is-missed::after {
    content: '✕';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 14px; height: 14px;
    background: #fca5a5;
    color: #fff;
    border-radius: 50%;
    font-size: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    line-height: 1;
}

/* 오늘 */
.att-calendar .day-cell.is-today {
    box-shadow: 0 0 0 2px var(--att-primary);
    font-weight: 800;
}

.att-calendar .day-cell.is-attended.is-today {
    box-shadow: 0 0 0 2px var(--att-primary-d), 0 3px 8px rgba(79,142,247,0.35);
}

/* ─── 출석 버튼 영역 ─────────────────────────────────── */
.att-check-area {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--att-border-l);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.att-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--att-primary), var(--att-primary-d));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(79,142,247,0.4);
    font-family: inherit;
    letter-spacing: -0.3px;
    min-width: 200px;
}

.att-check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,142,247,0.5);
}

.att-check-btn:active { transform: scale(.97); }

.att-check-btn:disabled,
.att-check-btn.is-done {
    background: var(--att-bg2);
    color: var(--att-text-sub);
    border: 1px solid var(--att-border);
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    font-weight: 700;
}

.att-check-info {
    font-size: 13px;
    color: var(--att-text-light);
    text-align: center;
}

/* 출석 완료 상세 정보 */
.att-checked-result {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px 20px;
    background: var(--att-success-l);
    border: 1px solid #86efac;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.att-checked-result .cr-label {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
}

.att-checked-result .cr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #86efac;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #166534;
}

/* ─── 오늘 출석 랭킹 카드 ───────────────────────────── */

/* 포디움 */
.att-podium-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    margin-bottom: 24px;
}

.att-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 160px;
}

.att-podium-crown {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
}

.att-podium-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}

.att-podium-item.rank-1 .att-podium-avatar { background: linear-gradient(135deg, #f59e0b, #d97706); width: 60px; height: 60px; font-size: 22px; box-shadow: 0 4px 16px rgba(245,158,11,0.5); }
.att-podium-item.rank-2 .att-podium-avatar { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 3px 10px rgba(100,116,139,0.4); }
.att-podium-item.rank-3 .att-podium-avatar { background: linear-gradient(135deg, #cd7c2f, #b25b1a); box-shadow: 0 3px 10px rgba(180,100,50,0.4); }

.att-podium-profile-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.65);
    display: block;
}

.att-rank-row .rr-avatar img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0,0,0,0.08);
    display: block;
}

.att-podium-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--att-text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.att-podium-point {
    font-size: 12px;
    font-weight: 700;
    color: var(--att-primary);
    white-space: nowrap;
}

.att-podium-base {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    padding: 10px 4px 6px;
}

.att-podium-item.rank-1 .att-podium-base {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    height: 90px;
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.3);
}

.att-podium-item.rank-2 .att-podium-base {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    height: 66px;
}

.att-podium-item.rank-3 .att-podium-base {
    background: linear-gradient(180deg, #d4975a, #b87333);
    height: 56px;
}

.att-podium-medal { font-size: 18px; }
.att-podium-rank-text { font-size: 11px; opacity: 0.9; }

/* 포디움 순서: 2위(좌) - 1위(중) - 3위(우) */
.att-podium-wrap > *:nth-child(1) { order: 1; } /* 2위 */
.att-podium-wrap > *:nth-child(2) { order: 0; } /* 1위 */
.att-podium-wrap > *:nth-child(3) { order: 2; } /* 3위 */

/* 4위 이하 리스트 */
.att-rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.att-rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--att-bg2);
    border-radius: 10px;
    transition: background .15s;
}

.att-rank-row.is-me {
    background: var(--att-primary-l);
    border: 1px solid #bfdbfe;
}

.att-rank-row .rr-num {
    width: 26px;
    font-size: 13px;
    font-weight: 800;
    color: var(--att-text-sub);
    text-align: center;
    flex-shrink: 0;
}

.att-rank-row .rr-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--att-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--att-text-sub);
    flex-shrink: 0;
}

.att-rank-row .rr-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--att-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.att-rank-row .rr-streak {
    font-size: 12px;
    color: #c2410c;
    font-weight: 700;
    white-space: nowrap;
}

.att-rank-row .rr-point {
    font-size: 13px;
    font-weight: 800;
    color: var(--att-primary);
    white-space: nowrap;
}

.att-today-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--att-text-light);
    font-size: 14px;
}

/* ─── 포인트 안내 ─────────────────────────────────────── */
.att-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.att-guide-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--att-bg2);
    border-radius: 12px;
    border: 1px solid var(--att-border-l);
}

.att-guide-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.att-guide-text { flex: 1; min-width: 0; }
.att-guide-label {
    font-size: 12px;
    color: var(--att-text-sub);
    font-weight: 600;
    margin-bottom: 2px;
}
.att-guide-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--att-primary);
}

.att-guide-divider {
    height: 1px;
    background: var(--att-border-l);
    margin: 14px 0;
}

/* 순위 보상 바 */
.att-rank-rewards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.att-rank-reward-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid;
}

.att-rank-reward-item.rk-1 { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.att-rank-reward-item.rk-2 { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.att-rank-reward-item.rk-3 { background: #fff7ed; border-color: #fed7aa; color: #92400e; }
.att-rank-reward-item.rk-4 { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.att-rank-reward-item.rk-5 { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ─── 카운트다운 ──────────────────────────────────────── */
.att-countdown-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.att-countdown-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--att-text-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.att-countdown {
    font-size: 28px;
    font-weight: 900;
    color: var(--att-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    line-height: 1;
    font-family: 'Pretendard', monospace;
    transition: color .3s;
}

.att-countdown.is-soon {
    color: var(--att-danger);
    animation: att-pulse 1s ease-in-out infinite;
}

@keyframes att-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ─── 월별 랭킹 테이블 ───────────────────────────────── */
.att-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.att-ranking-table thead th {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--att-text-sub, #7a7f99);
    border-bottom: 2px solid var(--att-border, #e8eaf0);
    text-align: left;
    white-space: nowrap;
}
.att-ranking-table tbody tr {
    border-bottom: 1px solid var(--att-border, #e8eaf0);
    transition: background .15s;
}
.att-ranking-table tbody tr:last-child {
    border-bottom: none;
}
.att-ranking-table tbody tr:hover {
    background: var(--att-bg2, #f4f6fb);
}
.att-ranking-table tbody td {
    padding: 10px 12px;
    color: var(--att-text, #2d3250);
}
.att-ranking-table .rank-num {
    font-weight: 700;
    font-size: 13px;
    color: var(--att-text-sub, #7a7f99);
    min-width: 48px;
}
.att-ranking-table tbody tr.my-row {
    background: var(--att-primary-l, #ede9fe);
}
.att-ranking-table tbody tr.my-row td {
    color: var(--att-primary, #7c3aed);
    font-weight: 700;
}

/* ─── 랭킹 링크 ─────────────────────────────────────── */
.att-ranking-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--att-bg2);
    border: 1px solid var(--att-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--att-text-sub);
    font-size: 14px;
    font-weight: 700;
    transition: all .2s;
    margin-bottom: 24px;
}

.att-ranking-link:hover {
    background: var(--att-primary-l);
    border-color: var(--att-primary);
    color: var(--att-primary);
}

/* ─── 토스트 ─────────────────────────────────────────── */
#att-toast.att-toast {
    position: fixed !important;
    bottom: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(20px) !important;
    background: #1e293b !important;
    color: #fff !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .3s, transform .3s !important;
    z-index: 2147483647 !important;
    white-space: normal !important;
    width: max-content !important;
    max-width: min(90vw, 420px) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
    display: block !important;
}

#att-toast.att-toast.show {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}
#att-toast.att-toast.is-success { background: #22c55e !important; }
#att-toast.att-toast.is-error   { background: #ef4444 !important; }

/* ─── 반응형 ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .att-card { padding: 16px 14px; }
    .att-calendar .day-cell { width: 32px; height: 32px; font-size: 12px; }
    .att-calendar .day-cell::after { width: 12px; height: 12px; font-size: 6px; }
    .att-check-btn { width: 100%; }
    .att-guide-grid { grid-template-columns: 1fr 1fr; }
    .att-podium-item .att-podium-avatar { width: 44px; height: 44px; font-size: 17px; }
    .att-podium-item.rank-1 .att-podium-avatar { width: 52px; height: 52px; font-size: 20px; }
    .att-podium-name { font-size: 12px; }
}
