/* 챌린지 모바일 스타일 */

.streak-banner {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: var(--white);
    padding: 20px 16px;
}

.streak-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.streak-date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.date-nav-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.date-nav-btn:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.current-date {
    font-size: 1rem;
    font-weight: 700;
    min-width: 120px;
    text-align: center;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.current-date:active {
    background: rgba(255, 255, 255, 0.2);
}

.streak-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.streak-icon {
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.streak-number {
    font-size: 2rem;
    font-weight: 700;
}

.streak-label {
    font-size: 0.875rem;
    opacity: 0.95;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    white-space: nowrap;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.challenge-section {
    margin-bottom: 24px;
}

.challenge-card {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.challenge-card.completed {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 2px solid var(--primary-color);
}

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

.challenge-icon {
    font-size: 2rem;
}

.challenge-check {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.25rem;
}

.challenge-card.completed .challenge-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.challenge-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.challenge-description {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}

.btn-video {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-bottom: 8px;
}

.btn-video:active {
    background: #dc2626;
}

.challenge-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-light);
}

.challenge-stats strong {
    color: var(--primary-color);
}

.btn-delete-challenge {
    width: 100%;
    padding: 10px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: 8px;
}

.btn-delete-challenge:active {
    background: #fecaca;
}

/* 달력 토글 버튼 */
.calendar-toggle-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.calendar-toggle-btn:active {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.98);
}

/* 달력 모달 */
.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.calendar-modal-content {
    background: var(--white);
    border-radius: 24px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 달력 헤더 */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.calendar-nav-btn {
    background: var(--bg-color);
    border: none;
    color: var(--text-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-nav-btn:active {
    background: var(--border-color);
    transform: scale(0.95);
}

/* 범례 */
.calendar-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* 요일 헤더 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.calendar-weekdays div:first-child {
    color: #ef4444; /* 일요일 */
}

.calendar-weekdays div:last-child {
    color: #3b82f6; /* 토요일 */
}

/* 달력 그리드 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: var(--bg-color);
    padding: 4px;
}

.calendar-day:active {
    transform: scale(0.95);
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 700;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day-number {
    font-size: 0.75rem;
    color: var(--text-color);
    margin-bottom: 2px;
}

.calendar-day-dots {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.calendar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.calendar-dot.exercise {
    background: #14b8a6;
}

.calendar-dot.diet {
    background: #f97316;
}

.calendar-dot.sleep {
    background: #8b5cf6;
}

.calendar-dot.custom {
    background: #ec4899;
}

/* 달력 상세 정보 */
.calendar-detail {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.calendar-detail h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 12px 0;
}

.detail-category {
    margin-bottom: 12px;
}

.detail-category-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-category-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.detail-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.detail-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.detail-progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 50px;
    text-align: right;
}
