/* ============================================
   출석체크 스킨 - Toss Style
   ============================================ */

/* === Base Reset === */
.at-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', sans-serif; color: #191f28; max-width: 100%; }
.at-wrap *, .at-wrap *::before, .at-wrap *::after { box-sizing: border-box; }

/* === Header Section === */
.at-header { background: linear-gradient(135deg, #3182f6 0%, #1b64da 100%); border-radius: 20px; padding: 32px 28px; margin-bottom: 20px; color: #fff; position: relative; overflow: hidden; }
.at-header::after { content: ''; position: absolute; top: -30px; right: -30px; width: 160px; height: 160px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.at-header::before { content: ''; position: absolute; bottom: -40px; right: 60px; width: 100px; height: 100px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.at-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; position: relative; z-index: 1; }
.at-header-title { font-size: 22px; font-weight: 700; }
.at-header-date { font-size: 13px; opacity: 0.8; }
.at-stats-row { display: flex; gap: 12px; position: relative; z-index: 1; }
.at-stat-card { flex: 1; background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); border-radius: 14px; padding: 16px; text-align: center; }
.at-stat-label { font-size: 12px; opacity: 0.85; margin-bottom: 6px; }
.at-stat-value { font-size: 26px; font-weight: 800; }
.at-stat-value small { font-size: 14px; font-weight: 500; }

/* === Check-in Card === */
.at-checkin-card { background: #fff; border-radius: 20px; padding: 28px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.at-checkin-done { text-align: center; }
.at-checkin-done-icon { font-size: 48px; margin-bottom: 12px; }
.at-checkin-done-text { font-size: 18px; font-weight: 700; color: #191f28; margin-bottom: 4px; }
.at-checkin-done-sub { font-size: 14px; color: #8b95a1; }
.at-checkin-done-badge { display: inline-flex; align-items: center; gap: 6px; background: #e8f3ff; color: #3182f6; padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; margin-top: 12px; }

.at-checkin-form { display: flex; flex-direction: column; gap: 14px; }
.at-checkin-label { font-size: 16px; font-weight: 700; }
.at-checkin-label span { color: #3182f6; }
.at-checkin-input-row { display: flex; gap: 10px; }
.at-checkin-input { flex: 1; border: 1.5px solid #e5e8eb; border-radius: 12px; padding: 14px 16px; font-size: 15px; outline: none; transition: border-color 0.2s; background: #f9fafb; }
.at-checkin-input:focus { border-color: #3182f6; background: #fff; }
.at-checkin-input::placeholder { color: #aeb5bc; }
.at-checkin-btn { border: none; background: #3182f6; color: #fff; font-size: 15px; font-weight: 700; padding: 14px 28px; border-radius: 12px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.at-checkin-btn:hover { background: #1b64da; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(49,130,246,0.35); }
.at-checkin-btn:active { transform: scale(0.97); }
.at-checkin-btn:disabled { background: #d1d6db; cursor: not-allowed; transform: none; box-shadow: none; }

/* === Quick Messages === */
.at-quick-msgs { display: flex; flex-wrap: wrap; gap: 8px; }
.at-quick-msg { background: #f2f4f6; border: none; padding: 8px 14px; border-radius: 20px; font-size: 13px; color: #4e5968; cursor: pointer; transition: all 0.15s; }
.at-quick-msg:hover { background: #e8f3ff; color: #3182f6; }

/* === Calendar Section === */
.at-calendar-card { background: #fff; border-radius: 20px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.at-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.at-cal-title { font-size: 18px; font-weight: 700; }
.at-cal-nav { display: flex; gap: 8px; }
.at-cal-nav button { width: 36px; height: 36px; border: 1.5px solid #e5e8eb; border-radius: 10px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #4e5968; transition: all 0.15s; }
.at-cal-nav button:hover { border-color: #3182f6; color: #3182f6; background: #f0f7ff; }

.at-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.at-cal-dow { text-align: center; font-size: 12px; font-weight: 600; color: #8b95a1; padding: 8px 0; }
.at-cal-dow:first-child { color: #f04452; }
.at-cal-dow:last-child { color: #3182f6; }

.at-cal-day { text-align: center; padding: 8px 4px; border-radius: 12px; cursor: default; position: relative; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.at-cal-day-num { font-size: 14px; font-weight: 500; color: #333; line-height: 1; }
.at-cal-day.empty .at-cal-day-num { color: transparent; }
.at-cal-day.sun .at-cal-day-num { color: #f04452; }
.at-cal-day.sat .at-cal-day-num { color: #3182f6; }
.at-cal-day.other .at-cal-day-num { color: #d1d6db; }

.at-cal-day.checked { background: #e8f3ff; }
.at-cal-day.checked .at-cal-day-num { color: #3182f6; font-weight: 700; }
.at-cal-day.today { background: #3182f6; border-radius: 12px; }
.at-cal-day.today .at-cal-day-num { color: #fff; font-weight: 700; }
.at-cal-day.today.checked { background: #3182f6; box-shadow: 0 4px 12px rgba(49,130,246,0.4); }

.at-cal-dot { width: 5px; height: 5px; border-radius: 50%; background: #3182f6; margin-top: 3px; }
.at-cal-day.today .at-cal-dot { background: #fff; }
.at-cal-day.other .at-cal-dot { display: none; }

/* === Tab Section === */
.at-tab-bar { display: flex; gap: 4px; background: #f2f4f6; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.at-tab { flex: 1; padding: 12px 0; border: none; background: transparent; font-size: 14px; font-weight: 600; color: #8b95a1; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.at-tab.active { background: #fff; color: #191f28; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* === Today's List === */
.at-today-card { background: #fff; border-radius: 20px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.at-today-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.at-today-title { font-size: 18px; font-weight: 700; }
.at-today-count { font-size: 14px; color: #3182f6; font-weight: 600; }

.at-list { list-style: none; padding: 0; margin: 0; }
.at-list-item { display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #f2f4f6; gap: 14px; transition: background 0.15s; }
.at-list-item:last-child { border-bottom: none; }
.at-list-item:hover { background: #fafbfc; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }

.at-rank { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.at-rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.at-rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #fff; }
.at-rank-3 { background: linear-gradient(135deg, #CD7F32, #B87333); color: #fff; }
.at-rank-n { background: #f2f4f6; color: #8b95a1; }

.at-avatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0; }
.at-info { flex: 1; min-width: 0; }
.at-nick { font-size: 15px; font-weight: 600; color: #191f28; }
.at-memo { font-size: 13px; color: #8b95a1; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-meta { text-align: right; flex-shrink: 0; }
.at-time { font-size: 13px; color: #8b95a1; }
.at-point-badge { display: inline-block; background: #fff8e1; color: #f59f00; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; margin-top: 4px; }
.at-point-badge.top { background: #e8f3ff; color: #3182f6; }

/* === Ranking Section === */
.at-ranking-card { background: #fff; border-radius: 20px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.at-ranking-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.at-ranking-tab { padding: 8px 16px; border: 1.5px solid #e5e8eb; border-radius: 20px; background: #fff; font-size: 13px; font-weight: 600; color: #8b95a1; cursor: pointer; transition: all 0.15s; }
.at-ranking-tab.active { border-color: #3182f6; background: #e8f3ff; color: #3182f6; }
.at-ranking-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #f2f4f6; gap: 12px; }
.at-ranking-item:last-child { border-bottom: none; }
.at-ranking-count { font-size: 14px; color: #191f28; font-weight: 700; }
.at-ranking-point { font-size: 12px; color: #8b95a1; }

/* === Empty / Loading State === */
.at-empty { text-align: center; padding: 48px 20px; }
.at-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.at-empty-text { font-size: 15px; color: #8b95a1; }

.at-loading { text-align: center; padding: 32px; }
.at-spinner { width: 32px; height: 32px; border: 3px solid #e5e8eb; border-top-color: #3182f6; border-radius: 50%; animation: atSpin 0.7s linear infinite; margin: 0 auto 12px; }
@keyframes atSpin { to { transform: rotate(360deg); } }

/* === More Button === */
.at-more-btn { display: block; width: 100%; padding: 14px; border: 1.5px solid #e5e8eb; border-radius: 12px; background: #fff; font-size: 14px; font-weight: 600; color: #4e5968; cursor: pointer; text-align: center; transition: all 0.15s; margin-top: 12px; }
.at-more-btn:hover { border-color: #3182f6; color: #3182f6; background: #f0f7ff; }

/* === Login Prompt === */
.at-login-card { background: #fff; border-radius: 20px; padding: 48px 28px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.at-login-icon { font-size: 56px; margin-bottom: 16px; }
.at-login-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.at-login-sub { font-size: 14px; color: #8b95a1; margin-bottom: 24px; }
.at-login-btn { display: inline-block; background: #3182f6; color: #fff; font-size: 15px; font-weight: 700; padding: 14px 32px; border-radius: 12px; text-decoration: none; transition: all 0.2s; }
.at-login-btn:hover { background: #1b64da; color: #fff; text-decoration: none; transform: translateY(-1px); }

/* === Confetti Animation === */
.at-confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; overflow: hidden; }
.at-confetti-piece { position: absolute; width: 10px; height: 10px; top: -10px; border-radius: 2px; animation: atConfettiFall 2.5s ease-out forwards; }
@keyframes atConfettiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.3); opacity: 0; }
}

/* === Success Animation === */
.at-success-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 9998; display: flex; align-items: center; justify-content: center; animation: atFadeIn 0.3s ease; }
.at-success-modal { background: #fff; border-radius: 24px; padding: 40px 32px; text-align: center; max-width: 340px; width: 90%; animation: atPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.at-success-icon { font-size: 64px; margin-bottom: 16px; }
.at-success-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #191f28; }
.at-success-sub { font-size: 15px; color: #4e5968; margin-bottom: 6px; }
.at-success-point { font-size: 28px; font-weight: 800; color: #3182f6; margin: 16px 0; }
.at-success-streak { font-size: 14px; color: #8b95a1; }
.at-success-close { margin-top: 24px; background: #3182f6; color: #fff; border: none; padding: 14px 48px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.at-success-close:hover { background: #1b64da; }

@keyframes atFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes atPopIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* === Responsive === */
@media (max-width: 768px) {
    .at-header { padding: 24px 20px; border-radius: 16px; }
    .at-header-title { font-size: 18px; }
    .at-stat-value { font-size: 22px; }
    .at-stats-row { gap: 8px; }
    .at-stat-card { padding: 12px 8px; }
    .at-checkin-card, .at-calendar-card, .at-today-card, .at-ranking-card { padding: 20px 16px; border-radius: 16px; }
    .at-checkin-input-row { flex-direction: column; }
    .at-checkin-btn { width: 100%; }
    .at-cal-day { min-height: 38px; padding: 6px 2px; }
    .at-cal-day-num { font-size: 13px; }
}
