/* --- 100권 읽기 챌린지 공통 스타일 --- */
.challenge-wrap { font-family: 'Noto Sans KR', sans-serif; color: #333; max-width: 1000px; margin: 0 auto; }

/* 1. 캠페인 배너 (이미지 처리) */
.campaign-banner { margin-bottom: 30px; border-radius: 8px; overflow: hidden; }
.campaign-banner img { width: 100%; height: auto; display: block; }

/* 2. 섹션 공통 */
.challenge-section { background: #f1f2f6; padding: 25px; border-radius: 10px; margin-bottom: 30px; }
.section-title { font-size: 1.4rem; font-weight: bold; margin-bottom: 10px; }
.section-desc { font-size: 0.95rem; color: #666; margin-bottom: 20px; }

/* 3. 도전자 카드 (메인) */
.challenger-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 20px; }
.challenger-card { padding: 20px 10px; text-align: center; border-radius: 4px; color: #333; height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; }
.challenger-card:hover { transform: translateY(-3px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.challenger-card.active { background-color: #a3cf5b; /* 연두색 */ }
.challenger-card.inactive { background-color: #dcdcdc; /* 회색 */ color: #888; }
.challenger-card .name { font-size: 1.1rem; font-weight: bold; margin-bottom: 5px; }
.challenger-card .status { font-size: 0.9rem; }

/* 4. 최근 활동 로그 (메인) */
.activity-log { margin-top: 20px; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #e0e0e0; }
.log-item { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.log-item:last-child { border-bottom: none; }

/* 5. 명예의 전당 (메인) */
.success-badge-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.success-badge { width: 80px; height: 80px; background-color: #00a8ff; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 0.8rem; border-radius: 4px; text-align: center; }
.success-badge .name { font-weight: bold; font-size: 1rem; margin-bottom: 3px; }

/* 6. 상세 페이지 진행 단계 */
.step-container { display: flex; gap: 10px; margin-bottom: 30px; }
.step-box { flex: 1; padding: 15px; text-align: center; color: #fff; border-radius: 4px; position: relative; }
.step-box.done { background-color: #a3cf5b; } /* 완료/진행중 (연두) */
.step-box.future { background-color: #00a8ff; } /* 예정 (파랑) */
.step-box .label { font-size: 1.1rem; font-weight: bold; }
.step-box .date { font-size: 0.8rem; margin-top: 5px; opacity: 0.9; }

/* 7. 상세 리스트 테이블 */
.record-table { width: 100%; border-top: 2px solid #333; margin-top: 20px; }
.record-table th, .record-table td { padding: 12px; border-bottom: 1px solid #ddd; text-align: left; }
.record-table th { background: #f9f9f9; font-weight: bold; }
.btn-mini { padding: 2px 8px; font-size: 0.8rem; background: #17a2b8; color: #fff; border: none; border-radius: 3px; }

/* 8. 그래프 영역 (Placeholder) */
.graph-placeholder { background: #eee; height: 150px; display: flex; align-items: center; justify-content: center; color: #888; border-radius: 8px; margin-top: 10px; }

/* 모바일 대응 */
@media (max-width: 768px) {
    .challenger-grid { grid-template-columns: repeat(2, 1fr); }
    .step-container { flex-direction: column; }
}


/* 타일 공통 스타일 */
.step-tile { position: relative; padding: 1.5rem; border-radius: 1.2rem; color: white; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); overflow: hidden; }
.step-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }

/* 상태별 디자인 */
.step-tile.done { background: linear-gradient(135deg, #a3cf5b 0%, #7dbb42 100%); min-height: 160px; } 
.step-tile.active { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); min-height: 200px; } 

/* 텍스트 스타일 */
.step-tile .round-badge { font-size: 0.9rem; font-weight: 800; opacity: 0.9; margin-bottom: 0.5rem; display: inline-block; background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; letter-spacing: 1px; }
.step-tile.active .content .status { font-size: 2rem; font-weight: 900; margin-bottom: 5px; line-height: 1.2; }
.step-tile.active .content .desc { font-size: 1.1rem; opacity: 0.9; font-weight: 500; }
.step-tile.done .content .status { font-size: 1.3rem; font-weight: bold; }
.step-tile.done .content .date { font-size: 0.9rem; opacity: 0.9; margin-top: 4px;}
.step-tile .icon { position: absolute; top: 1.5rem; right: 1.5rem; opacity: 0.3; }

/* 버튼 스타일 */
.btn-register-tile { background-color: #ffffff; color: #2563eb; font-weight: 800; padding: 0.8rem 1.5rem; border-radius: 50px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); display: inline-flex; align-items: center; transition: all 0.2s ease; border: none; cursor: pointer; z-index: 10; }
.btn-register-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); background-color: #f8fafc; }
.btn-register-tile i { margin-right: 8px; font-size: 1.2rem; }

.btn-cert-apply { background-color: rgba(255,255,255,0.9); color: #556c32; font-size: 0.85rem; font-weight: bold; padding: 0.4rem 0.8rem; border-radius: 8px; border: none; cursor: pointer; display: inline-flex; align-items: center; margin-top: 10px; transition: 0.2s; width: fit-content; }
.btn-cert-apply:hover { background-color: #ffffff; }
.text-cert-complete { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin-top: 10px; display: inline-flex; align-items: center; font-weight: 500; }

/* 테이블 등 */
.record-table th { background-color: #f8f9fa; color: #5e6278; font-weight: 600; padding: 1rem; text-align: left; }
.record-table td { padding: 1rem; border-bottom: 1px solid #f1f1f4; color: #3f4254; vertical-align: top; } /* 상단 정렬로 변경 */
.record-table tr:last-child td { border-bottom: none; }

/* 그래프 스타일 (강제 적용) */
.analysis-graph-row { display: flex; align-items: center; width: 100%; margin-bottom: 12px; }
.analysis-label { width: 80px; font-size: 0.9rem; color: #4b5563; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.analysis-track { flex-grow: 1; height: 12px; background-color: #e5e7eb; border-radius: 999px; margin: 0 12px; overflow: hidden; position: relative; }
.analysis-bar { height: 100%; background-color: #3b82f6; border-radius: 999px; transition: width 1.5s ease-out; }
.analysis-value { width: 40px; font-size: 0.85rem; font-weight: 700; color: #2563eb; text-align: right; flex-shrink: 0; }

/* -----------------------------------------------------------------
   [토글 스위치 커스텀 스타일]
   Tailwind 빌드 없이 동작하도록 강제 스타일링
----------------------------------------------------------------- */

/* 1. 스위치 배경 (기본: 회색) */
.custom-toggle-ui {
    width: 2.75rem;  /* w-11 (44px) */
    height: 1.5rem;  /* h-6 (24px) */
    background-color: #e5e7eb; /* bg-gray-200 */
    border-radius: 9999px; /* rounded-full */
    position: relative;
    transition: all 0.3s ease-in-out;
}

/* 2. 스위치 배경 (체크되었을 때: 녹색) */
input:checked + .custom-toggle-ui {
    background-color: #10b981; /* bg-emerald-500 */
}

/* 3. 스위치 알맹이 (Knob) - 가상요소 사용 */
.custom-toggle-ui::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: white;
    border-radius: 50%;
    height: 1.25rem; /* h-5 (20px) */
    width: 1.25rem;  /* w-5 (20px) */
    border: 1px solid #d1d5db; /* gray-300 */
    transition: all 0.3s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 4. 스위치 알맹이 (체크되었을 때: 이동 및 테두리 변경) */
input:checked + .custom-toggle-ui::after {
    transform: translateX(100%); /* 오른쪽으로 이동 */
    border-color: white;
}

/* (참고) sr-only 클래스가 없는 경우를 대비한 보조 스타일 */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}
</style>
<style>
    /* [추가] 모든 kt-modal의 배경(Backdrop)에 블러 효과 강제 적용 */
.modal-backdrop, 
div[data-kt-modal-backdrop="true"] {
    background-color: rgba(17, 24, 39, 0.5) !important; /* bg-gray-900의 RGB + 50% 투명도 */
    backdrop-filter: blur(4px) !important; /* 블러 효과 */
    -webkit-backdrop-filter: blur(4px) !important; /* 사파리 호환 */
}

#custom-toast {
    visibility: hidden;
    min-width: 300px;
    background-color: #059669 !important; /* 진한 녹색 (Emerald-600) */
    color: #fff !important;
    text-align: center;
    border-radius: 12px;
    padding: 20px;
    
    position: fixed;
    z-index: 10000 !important; /* 모달보다 위에 뜨도록 */
    
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    bottom: auto !important;
    height: auto !important;
    
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* 표시될 때 클래스 */
#custom-toast.show {
    visibility: visible;
    opacity: 1;
}

/* Toast Notification Style */
#custom-toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
}

#custom-toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}