/* --- css/mypage.css --- */

.active-link { color: #2563EB !important; font-weight: 700 !important; }  

/* 1. 전체 레이아웃 (Layout) */
.mypage-container {
    display: flex;
    max-width: 1200px; 
    margin: 50px auto;
    padding: 0 20px;
    gap: 30px;
    align-items: flex-start;
}

.content-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 40px;
    min-height: 600px;
    max-width: 100%; 
}

/* 2. 왼쪽 사이드바 (Profile Sidebar) */
.profile-summary {
    width: 300px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    flex-shrink: 0; 
    position: relative;
    transition: all 0.3s ease;
}

.profile-pic-area {
    position: relative;
    width: 120px; height: 120px;
    margin: 0 auto 15px;
}

.profile-img {
    width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover;
    border: 3px solid #f1f5f9;
}

.edit-pic-btn {
    position: absolute; bottom: 0; right: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background-color: #2563EB; color: white;
    border: 2px solid white; cursor: pointer;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
}

/* 기초조사서 상태 배지 */
.status-badge {
    display: inline-block; padding: 6px 16px; border-radius: 20px;
    font-weight: bold; font-size: 0.85rem; margin: 15px 0;
}
.status-badge.incomplete { background-color: #fee2e2; color: #991b1b; } 
.status-badge.partial { background-color: #fef3c7; color: #92400e; }
.status-badge.complete { background-color: #dcfce7; color: #166534; }

.status-detail { padding: 0; margin-bottom: 20px; }
.status-detail li { margin-bottom: 5px; color: #64748b; font-size: 0.9rem; list-style: none; }

.mypage-link-box { margin-top: 15px; }
.btn-go-survey {
    display: block; width: 100%; padding: 12px; 
    background-color: #eff6ff; color: #2563eb; 
    text-decoration: none; border-radius: 6px;
    font-weight: bold; font-size: 0.9rem;
    border: 1px solid #bfdbfe; 
    transition: all 0.2s;
}
.btn-go-survey:hover { 
    background-color: #dbeafe; 
    transform: translateY(-2px); 
}
.btn-go-survey i { 
    margin-right: 6px; 
}

.btn-go-analysis {
    display: block; width: 100%; padding: 12px;
    background-color: #f5f3ff; color: #7c3aed; /* 보라색 계열 */
    text-decoration: none; border-radius: 6px;
    font-weight: bold; font-size: 0.9rem;
    border: 1px solid #ddd6fe;
    transition: all 0.2s;
}
.btn-go-analysis:hover { background-color: #ede9fe; transform: translateY(-2px); }
.btn-go-analysis i { margin-right: 6px; }

/* 계정 삭제(회원탈퇴) 버튼 */
.account-actions { margin-top: 40px; padding-top: 20px; border-top: 1px solid #e2e8f0; text-align: right; }
.btn-delete-account { background: none; border: none; color: #94a3b8; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.btn-delete-account:hover { color: #ef4444; font-weight: bold; }

/* --- 회원 탈퇴 모달 전용 스타일 --- */
.delete-modal .warning-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.9rem;
    line-height: 1.6;
}
.delete-modal .warning-box strong { 
    color: #7f1d1d; 
    display: block; 
    margin-bottom: 5px; 
    font-size: 1.05rem; 
}
.delete-modal .warning-box i {
    margin-right: 5px;
}
.delete-modal .highlight { 
    font-weight: bold; 
    color: #dc2626; 
    text-decoration: underline; 
}
.danger-btn { 
    background: #ef4444 !important; 
    color: white; 
}
.danger-btn:hover { 
    background: #dc2626 !important; 
}

/* 멤버십 티어 스타일 */
.premium-badge {
    position: absolute; top: -12px; right: 20px;
    padding: 5px 12px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 800;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    letter-spacing: 0.5px; z-index: 10;
}
.profile-summary.tier-basic { border: 2px solid #3B82F6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.15); }
.profile-summary.tier-basic .premium-badge { background: linear-gradient(135deg, #3B82F6, #60A5FA); color: white; }
.profile-summary.tier-standard { border: 2px solid #64748B; box-shadow: 0 0 15px rgba(100, 116, 139, 0.2); }
.profile-summary.tier-standard .premium-badge { background: linear-gradient(135deg, #94A3B8, #CBD5E1); color: #0F172A; }
.profile-summary.tier-pro { border: 2px solid #F59E0B; box-shadow: 0 0 20px rgba(245, 158, 11, 0.25); }
.profile-summary.tier-pro .premium-badge { background: linear-gradient(135deg, #F59E0B, #FCD34D); color: #78350f; }

/* 1. 사이드바 튜터 버튼 (청록색 계열로 차별화) */
.btn-view-tutor {
    display: block; width: 100%; padding: 12px;
    background-color: #ecfdf5; color: #059669; /* Emerald Green */
    text-decoration: none; border-radius: 6px;
    font-weight: bold; font-size: 0.9rem;
    border: 1px solid #a7f3d0;
    transition: all 0.2s;
}
.btn-view-tutor:hover {
    background-color: #d1fae5;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-view-tutor i { margin-right: 6px; }

/* 2. 튜터 모달 (프로필 카드 디자인) */
.tutor-card {
    background: white;
    width: 90%;
    max-width: 420px; /* 모바일에서 너무 넓지 않게 조정 */
    
    /* 모바일 스크롤 해결을 위한 설정 */
    max-height: 85vh; /* 화면 높이의 85%까지만 차지 */
    display: flex;    /* 내부 요소를 flex로 배치 */
    flex-direction: column; /* 위(헤더) 아래(바디)로 정렬 */
    
    border-radius: 20px; /* 둥근 모서리 강화 */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden; /* 자식 요소가 둥근 모서리 뚫고 나오는 것 방지 */
    position: relative; /* 닫기 버튼 위치 기준점 */
}

/* 상단 헤더 (배경색 + 프로필 사진) - 고정 영역 */
.tutor-header {
    background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
    padding: 30px 20px 20px; /* 하단 패딩 약간 줄임 */
    text-align: center;
    flex-shrink: 0; /* 스크롤 시에도 헤더가 찌그러지지 않게 고정 */
    position: relative;
}

/* 닫기 버튼 스타일 개선 (헤더 우측 상단 고정) */
.tutor-card .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #64748b;
    font-size: 2rem;
    font-weight: normal;
    z-index: 10;
    transition: color 0.2s;
}
.tutor-card .close-btn:hover {
    color: #1e293b;
}

.tutor-img-wrapper {
    width: 90px; height: 90px; /* 사이즈 약간 조정 */
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* 그림자 부드럽게 */
    overflow: hidden;
    background: white;
}
.tutor-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
}

.tutor-badge {
    background: #3b82f6; /* 색상 약간 밝게 */
    color: white;
    font-size: 0.7rem; font-weight: 700;
    padding: 4px 10px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tutor-title h3 {
    margin: 12px 0 4px;
    font-size: 1.3rem; 
    color: #0f172a;
    font-weight: 800;
}
.tutor-nick {
    margin: 0; color: #64748b; font-size: 0.9rem;
}

/* 하단 상세 정보 - 스크롤 영역 */
.tutor-body {
    padding: 25px;
    overflow-y: auto; /* 내용이 넘치면 스크롤 발생 */
    background: #fff;
    
    /* 모바일 터치 스크롤 부드럽게 */
    -webkit-overflow-scrolling: touch; 
}

/* 스크롤바 디자인 (크롬, 사파리 등) - 선택사항 */
.tutor-body::-webkit-scrollbar {
    width: 6px;
}
.tutor-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}
.tutor-body::-webkit-scrollbar-track {
    background-color: transparent;
}

/* 하단 상세 정보 */
.tutor-body { padding: 25px 30px 35px; }

.tutor-info-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 8px;
    color: #334155; font-weight: 500; font-size: 1rem;
}
.tutor-info-row i { color: #94a3b8; }

.tutor-section { margin-top: 25px; }
.tutor-section label {
    display: block; font-size: 0.85rem; font-weight: bold;
    color: #94a3b8; margin-bottom: 8px; text-transform: uppercase;
}

.info-box {
    background: #f8fafc; padding: 12px;
    border-radius: 8px; border: 1px solid #e2e8f0;
    color: #334155; font-size: 0.95rem; margin: 0;
    line-height: 1.5;
}

.message-quote {
    position: relative; margin: 0;
    padding: 15px 20px;
    background: #fdf2f8; /* 옅은 핑크 포인트 */
    border-left: 4px solid #db2777;
    border-radius: 4px;
    color: #be185d; font-style: italic;
    font-size: 0.95rem; line-height: 1.5;
}

/* 공통 폼 및 기타 */
.content-header { text-align: center; }
.content-header h2 { margin-top: 0; color: #1e293b; }
.content-header p { color: #64748b; margin-bottom: 30px; }
.form-container { max-width: 480px; margin: 0 auto; }
.form-container h3 { margin-top: 30px; margin-bottom: 15px; font-size: 1.1rem; color: #2563eb; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; }
.form-container h3:first-child { margin-top: 0; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 8px; color: #334155; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"] { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; font-size: 1rem; }
input:focus { outline: none; border-color: #2563EB; }

/* 폼 그룹 가로 배치 (라벨/인풋 + 버튼) */
.row-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}
.input-wrapper {
    flex: 1;
}
.edit-btn {
    padding: 10px 15px;
    height: 46px; /* 인풋 높이와 맞춤 (padding + border) */
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
}
.edit-btn:hover {
    background-color: #e2e8f0;
}
.edit-btn.saving {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}
.divider { margin: 40px 0; border: 0; border-top: 1px solid #e2e8f0; }

/* 계정 정보 링크 스타일 */
.account-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}
.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.link-item .label { font-weight: bold; color: #334155; width: 80px; }
.link-item .value { flex: 1; color: #64748b; font-size: 0.95rem; }
.text-link {
    color: #2563eb;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.text-link:hover { color: #1d4ed8; font-weight: 500; }

/* 모달 스타일 */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
}
.modal.hidden { display: none; }
.modal-content {
    background: white; padding: 30px; border-radius: 12px;
    width: 400px; max-width: 90%; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.modal-content h3 { margin-top: 0; margin-bottom: 10px; color: #1e293b; font-size: 1.25rem; }
.modal-desc { margin-bottom: 20px; color: #64748b; font-size: 0.9rem; }
.close-btn {
    position: absolute; top: 15px; right: 20px;
    font-size: 1.5rem; cursor: pointer; color: #94a3b8;
    line-height: 1;
}
.close-btn:hover { color: #ef4444; }
.modal-action-btn {
    width: 100%; padding: 12px; margin-top: 20px;
    background: #2563eb; color: white; border: none;
    border-radius: 6px; font-weight: bold; cursor: pointer;
    transition: background 0.2s;
}
.modal-action-btn:hover { background: #1d4ed8; }
.verify-row { display: flex; gap: 10px; align-items: center; }
.timer { color: #ef4444; font-weight: bold; font-size: 0.9rem; width: 50px; text-align: center; }


/* 삭제 버튼 스타일 (프로필 사진) */
.delete-pic-btn {
    position: absolute; bottom: 0; left: 0;
    width: 35px; height: 35px; border-radius: 50%;
    background-color: #ef4444; color: white; border: 3px solid white;
    cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: all 0.2s ease;
}
.delete-pic-btn:hover { background-color: #dc2626; transform: scale(1.1); }
.delete-pic-btn i { font-size: 14px; }
.hidden { display: none !important; }

/* =========================================
   모바일 반응형 (다이어트 적용)
   ========================================= */
@media (max-width: 768px) {
    /* 1. 전체 컨테이너 및 섹션 정렬 다이어트 */
    .mypage-container { 
        flex-direction: column; 
        padding: 0 15px; 
        margin-top: 20px; 
        gap: 15px; /* 30px -> 15px: 사이드바와 본문 사이 간격 축소 */
    }
    
    .profile-summary { 
        width: 100%; 
        padding: 20px; /* 30px -> 20px */
        margin-bottom: 0; /* gap으로 제어하므로 margin 제거 */
    }
    
    .content-area { 
        width: 100%; 
        padding: 25px 20px; /* 40px -> 25px/20px */
        min-height: auto; 
    }

    /* 2. 프로필 이미지 크기 및 텍스트 축소 */
    .profile-pic-area { width: 100px; height: 100px; margin-bottom: 10px; }
    .status-badge { padding: 4px 12px; font-size: 0.8rem; margin: 10px 0; }
    
    /* 3. 본문 폼 영역 및 타이틀 크기 조정 */
    .form-container { max-width: 100%; }
    .content-header h2 { font-size: 1.5rem; margin-bottom: 5px; }
    .content-header p { font-size: 0.95rem; margin-bottom: 20px; }
    
    .form-container h3 { font-size: 1rem; margin-top: 25px; margin-bottom: 12px; }
    .form-group { margin-bottom: 15px; }
    .form-group label { font-size: 0.9rem; margin-bottom: 6px; }
    input[type="text"], input[type="tel"], input[type="email"], input[type="password"] { 
        padding: 10px; font-size: 0.95rem; 
    }
    
    /* 4. 가로 배치 폼 (인풋 + 버튼) 버튼 크기 최적화 */
    .edit-btn { height: 41px; padding: 8px 12px; font-size: 0.85rem; }
    .password-section { display: block; }
    
    /* 5. 계정 링크 박스 다이어트 */
    .account-links { gap: 10px; margin-bottom: 20px; }
    .link-item { padding: 12px; }
    .link-item .label { width: 70px; font-size: 0.9rem; }
    .link-item .value { font-size: 0.9rem; }
    
    /* 6. 모달(튜터 및 일반 팝업) 여백 다이어트 */
    .tutor-card {
        width: 95%; 
        max-height: 90vh; 
    }
    .tutor-header { padding: 20px 15px 15px; }
    .tutor-img-wrapper { width: 80px; height: 80px; }
    .tutor-title h3 { font-size: 1.15rem; }
    .tutor-body { padding: 15px 20px 25px; }
    
    .modal-content { padding: 25px 20px; }
    .modal-content h3 { font-size: 1.15rem; }
    .modal-action-btn { padding: 10px; font-size: 0.95rem; }
}

@media (min-width: 769px) {
    .mypage-container { display: flex; flex-direction: row; align-items: flex-start; gap: 30px; max-width: 1200px; margin: 40px auto; padding: 0 20px; }
    .profile-summary { width: 300px; min-width: 300px; flex-shrink: 0; position: sticky; top: 20px; overflow: visible; }
    .content-area { flex-grow: 1; min-width: 0; width: 100%; }
    .password-section { display: flex; gap: 20px; }
    .password-section .form-group { flex: 1; }
}