/* ============================================
   스텝업 챌린지 - 헤어미용사 앱 스타일
   ============================================ */

/* 기본 리셋 및 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-orange: #FF6600;
    --primary-orange-light: #FFB380;
    --primary-orange-lighter: #FFCC99;
    --text-dark: #2C3E50;
    --text-gray: #5A6C7D;
    --text-light: #8B95A1;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    --success: #FF6600;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EEF3 100%);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 60px;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   헤더 스타일
   ============================================ */
.header {
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE6CC 100%);
    color: var(--text-dark);
    padding: 10px 0;
    box-shadow: 0 2px 12px rgba(255, 102, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 102, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FF6600;
}

.stage-badge-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.stage-badge-header i {
    font-size: 12px;
}

/* FAQ 버튼 (모바일 우선) */
.faq-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: white;
    color: #FF6600;
    border: 2px solid #FF6600;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.1);
}

.faq-button:hover {
    background: #FF6600;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.faq-button i {
    font-size: 13px;
}

.faq-button {
    font-size: 12px;
}

/* ============================================
   사용자 정보 (로그인 후 표시)
   ============================================ */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 10px;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-id {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-id i {
    color: #FF6600;
    font-size: 15px;
}

.user-id.admin {
    color: #FF6600;
    font-weight: 700;
}

.user-id.admin i {
    color: #FF6600;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    background: #FFF5E6;
    padding: 4px 10px;
    border-radius: 10px;
}

.user-stage {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-stage i {
    font-size: 14px;
}

.admin-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-dashboard-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Noto Sans KR', sans-serif;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
}

.admin-dashboard-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.logout-button {
    padding: 8px 16px;
    background: #F8F9FA;
    color: var(--text-gray);
    border: 1px solid #E8EEF3;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Noto Sans KR', sans-serif;
}

.logout-button:hover {
    background: #E8EEF3;
    color: var(--text-dark);
}

/* ============================================
   알림 섹션
   ============================================ */
.notification-section {
    padding: 16px 0 0 0;
}

/* 중간 정산 완료 알림 */
.midterm-notification {
    background: linear-gradient(135deg, #FFC107 0%, #FFA000 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
    animation: slideDown 0.5s ease;
    font-weight: 600;
    font-size: 15px;
}

.midterm-notification i {
    font-size: 24px;
}

/* 검수 완료 알림 */
.review-notification {
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    animation: slideDown 0.5s ease;
    font-weight: 600;
    font-size: 15px;
}

.review-notification i {
    font-size: 24px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 전체 진행률 (하단) */
.progress-section-bottom {
    padding: 24px 0 40px 0;
}

.progress-section-top {
    padding: 24px 0;
}

.progress-card {
    background: var(--white);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title i {
    color: #FF6600;
    font-size: 14px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF6600 0%, #FF8800 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.progress-text {
    color: var(--white);
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
}

.progress-info {
    text-align: center;
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 500;
}

.progress-info span {
    color: #FF6600;
    font-weight: 700;
    font-size: 13px;
}

/* ============================================
   메인 콘텐츠
   ============================================ */
.main-content {
    padding: 0 0 40px 0;
}

/* ============================================
   단계 섹션
   ============================================ */
.stage-section {
    margin-bottom: 32px;
}

.stage-header {
    border-radius: var(--border-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.stage-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.stage-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-badge {
    display: none;
    background: var(--white);
    color: var(--success);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: bounceIn 0.6s;
}

.stage-badge i {
    margin-right: 6px;
}

.stage-funding {
    color: var(--white);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
}

.stage-funding i {
    font-size: 18px;
}

.stage-funding strong {
    font-size: 18px;
    font-weight: 700;
}

/* ============================================
   미션 그룹 (접기/펼치기)
   ============================================ */
.mission-group {
    margin-bottom: 20px;
}

.mission-group-header {
    background: var(--white);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.mission-group-header:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.mission-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.mission-group-title i {
    color: #FF6600;
    font-size: 14px;
}

.mission-count {
    display: none;
}

.toggle-icon {
    color: var(--text-gray);
    font-size: 14px;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(-90deg);
}

/* ============================================
   미션 그리드
   ============================================ */
.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    transition: all 0.3s ease;
}

/* ============================================
   미션 카드
   ============================================ */
.mission-card {
    background: var(--white);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mission-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mission-card.completed {
    border-color: var(--success);
    background: linear-gradient(135deg, #F0FFF4 0%, #E8F5E9 100%);
}

.mission-card.mission-disabled {
    opacity: 0.5;
    background: linear-gradient(135deg, #F5F5F5 0%, #E8E8E8 100%);
    pointer-events: none;
    position: relative;
}

.mission-card.mission-disabled::after {
    content: '🔒 비활성화됨';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #999;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.mission-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.mission-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    flex: 1;
    text-align: left;
}

.mission-number {
    color: var(--primary);
    font-weight: 700;
    margin-right: 4px;
}

.mission-card.completed .mission-title {
    color: var(--success);
    text-decoration: line-through;
    opacity: 0.7;
}

.mission-description {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 12px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mission-description i {
    color: var(--text-light);
    margin-top: 2px;
    flex-shrink: 0;
}

.mission-reward {
    background-color: #FFF5F7;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid var(--primary-pink);
    margin-top: auto;
}

.mission-reward i {
    color: #FFD700;
    font-size: 16px;
}

/* ============================================
   커스텀 체크박스
   ============================================ */
.checkbox-container {
    display: block;
    position: relative;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: block;
    width: 28px;
    height: 28px;
    border: 2.5px solid #D1D5DB;
    border-radius: 8px;
    background-color: #F9FAFB;
    transition: var(--transition);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.checkbox-container:hover .checkmark {
    border-color: #FF6600;
    background-color: #FFF5E6;
    transform: scale(1.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.checkbox-container input:checked ~ .checkmark {
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    border-color: #FF6600;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 9px;
    top: 5px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* ============================================
   리셋 버튼
   ============================================ */
.reset-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.reset-button {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: 'Noto Sans KR', sans-serif;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reset-button:active {
    transform: translateY(0);
}

.reset-button i {
    margin-right: 8px;
}

/* ============================================
   텍스트 입력 & 사진 제출 섹션
   ============================================ */

.text-input-section {
    margin-top: 15px;
    padding: 15px;
    background: #FFF5E6;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.text-input-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input-section textarea:focus {
    outline: none;
    border-color: #FF8800;
}

.submit-text-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-text-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.4);
}

.submit-text-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.photo-submit-section {
    margin-top: 15px;
}

.photo-submit-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #F093FB 0%, #F5576C 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.photo-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.photo-submit-button i {
    font-size: 16px;
}

/* ============================================
   애니메이션
   ============================================ */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   반응형 디자인
   ============================================ */

/* 태블릿 */
/* 모바일 반응형 */
/* ============================================
   반응형 디자인 (PC에서 크게 보이도록)
   ============================================ */

/* 태블릿 이상 (768px~) */
@media (min-width: 768px) {
    body {
        font-size: 15px;
        padding-bottom: 80px;
    }
    
    .container {
        padding: 0 24px;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .app-title {
        font-size: 18px;
        gap: 8px;
    }
    
    .stage-badge-header {
        font-size: 14px;
        padding: 6px 16px;
    }
    
    .faq-button {
        padding: 7px 14px;
        font-size: 13px;
    }
    
    .user-info {
        padding: 14px 18px;
    }
    
    .user-id {
        font-size: 14px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .progress-card {
        padding: 14px 16px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .section-title i {
        font-size: 16px;
    }
    
    .progress-bar-container {
        height: 24px;
    }
    
    .progress-text {
        font-size: 12px;
    }
    
    .progress-info {
        font-size: 12px;
    }
    
    .progress-info span {
        font-size: 14px;
    }
    
    .mission-group-header {
        padding: 12px 16px;
    }
    
    .mission-group-title {
        font-size: 14px;
        gap: 10px;
    }
    
    .mission-group-title i {
        font-size: 16px;
    }
    
    .toggle-icon {
        font-size: 15px;
    }
    
    .mission-card {
        padding: 16px;
    }
    
    .mission-title {
        font-size: 15px;
    }
    
    .mission-description {
        font-size: 13px;
    }
}

/* PC (데스크톱) 1024px~ */
@media (min-width: 1024px) {
    body {
        font-size: 16px;
        padding-bottom: 100px;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .stage-badge-header {
        font-size: 14px;
        padding: 6px 16px;
        gap: 8px;
    }
    
    .faq-button {
        padding: 8px 16px;
        font-size: 14px;
        gap: 6px;
    }
    
    .faq-button i {
        font-size: 16px;
    }
    
    .user-info {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .user-id {
        font-size: 15px;
        gap: 8px;
    }
    
    .user-id i {
        font-size: 18px;
    }
    
    .user-name {
        font-size: 14px;
        padding: 4px 12px;
    }
    
    .progress-card {
        padding: 16px 20px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 10px;
        gap: 8px;
    }
    
    .section-title i {
        font-size: 18px;
    }
    
    .progress-bar-container {
        height: 26px;
        margin-bottom: 8px;
    }
    
    .progress-bar {
        padding-right: 12px;
    }
    
    .progress-text {
        font-size: 13px;
    }
    
    .progress-info {
        font-size: 12px;
    }
    
    .progress-info span {
        font-size: 15px;
    }
    
    .mission-group-header {
        padding: 14px 18px;
    }
    
    .mission-group-title {
        font-size: 15px;
        gap: 10px;
    }
    
    .mission-group-title i {
        font-size: 17px;
    }
    
    .toggle-icon {
        font-size: 16px;
    }
    
    .mission-card {
        padding: 20px;
    }
    
    .mission-header {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .mission-title {
        font-size: 16px;
    }
    
    .mission-description {
        font-size: 14px;
        margin-bottom: 16px;
        gap: 8px;
    }
}

/* ============================================
   새로운 UI 요소 (phase 배지, 텍스트 입력, 사진 제출)
   ============================================ */

/* Phase 배지 (중간 정산) */
.phase-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFC107 0%, #FFA000 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.phase-badge-disabled {
    background: linear-gradient(135deg, #999 0%, #666 100%) !important;
}

.phase-badge-small {
    display: inline-block;
    background: #FFC107;
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

/* 텍스트 입력 미션 */
.mission-text-input {
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.text-submission-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
}

.text-submission-input:focus {
    outline: none;
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.text-submission-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.text-submit-button {
    align-self: flex-end;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Noto Sans KR', sans-serif;
}

.text-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.text-submit-button:active {
    transform: translateY(0);
}

/* 사진 제출 미션 */
.mission-photo-submit {
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.photo-submit-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Noto Sans KR', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.photo-submit-button:active {
    transform: translateY(0);
}

.photo-submit-button i {
    font-size: 16px;
}