/* =========================================
   5. 프로필 화면 (profile.css)
   ========================================= */

.profile-container {
    /* [중요] 스크롤을 위해 높이를 내용에 맞춤 */
    height: auto !important;
    min-height: 100%;
    
    width: 100%; 
    max-width: 500px;
    margin: 0 auto;
    padding: 30px 20px;
    padding-bottom: 50px; /* 하단 여백 추가 */
    
    color: #e2e8f0;
    animation: fadeInUp 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box; /* 패딩 포함 크기 계산 */
}

/* 프로필 헤더 */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(30, 41, 59, 0.6);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
    box-sizing: border-box;
}

.profile-img-wrapper {
    position: relative;
    display: inline-block;
    width: 120px; height: 120px;
    margin-bottom: 15px;
}

#profile-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 4px solid #6366f1;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    background-color: #1e293b;
}

.camera-icon {
    position: absolute; bottom: 5px; right: 5px;
    background: #6366f1; color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border: 2px solid #1e293b;
    transition: 0.2s;
    font-size: 1.2rem;
}
.camera-icon:hover { transform: scale(1.1); background: #4f46e5; }

.user-email {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem; margin: 0;
    color: #fff;
    letter-spacing: 1px;
}

.admin-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-top: 5px;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* 섹션 박스 공통 */
.section-box {
    background: rgba(30, 41, 59, 0.6);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #334155;
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #94a3b8;
    letter-spacing: 1px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
    text-align: left;
}

/* 아이템 리스트 */
#my-items-list {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.item-tag {
    background: #334155;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #475569;
}
.empty-msg { font-size: 0.9rem; color: #64748b; font-style: italic; }

/* 선물하기 폼 */
.gift-form { display: flex; flex-direction: column; gap: 12px; }
.gift-input {
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-family: 'Exo 2', sans-serif;
    width: 100%;
    box-sizing: border-box;
}
.gift-input:focus { outline: none; border-color: #10b981; }

.gift-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white; border: none;
    padding: 14px; border-radius: 8px;
    font-weight: 800; cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    width: 100%;
}
.gift-btn:hover { transform: translateY(-2px); }

/* 로그아웃 버튼 */
.logout-btn {
    width: 100%; margin-top: 10px;
    background: transparent;
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 14px; border-radius: 12px;
    cursor: pointer; font-weight: bold;
    transition: 0.2s;
}
.logout-btn:hover { background: rgba(239, 68, 68, 0.1); }

/* 가이드 버튼 */
.guide-btn {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border: none;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    box-shadow: 0 2px 5px rgba(251, 191, 36, 0.4);
    transition: transform 0.2s;
}
.guide-btn:hover { transform: scale(1.05); }

/* 모달 팝업 오버레이 (기본 숨김) */
.modal-overlay {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}

/* 모달 내용 박스 */
.modal-content {
    background: #1e293b;
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 25px;
    width: 90%; max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
    text-align: center;
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.2);
    position: relative;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-title { font-family: 'Orbitron'; color: #fbbf24; margin-bottom: 15px; font-size: 1.4rem; }
.modal-section { text-align: left; margin-bottom: 20px; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; }
.modal-subtitle { color: #94a3b8; font-size: 0.85rem; margin-bottom: 8px; font-weight: bold; letter-spacing: 1px; }

.xp-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 5px; }
.xp-val { color: #4ade80; font-weight: bold; }

.level-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.level-table th { text-align: left; color: #64748b; padding: 5px; border-bottom: 1px solid #475569; }
.level-table td { padding: 5px; border-bottom: 1px solid #334155; }
.high-rank { color: #fbbf24; font-weight: bold; }

.close-modal-btn {
    width: 100%;
    padding: 12px;
    background: #334155;
    border: none; color: white;
    font-weight: bold; border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal-btn:hover { background: #475569; }

/* 애니메이션 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 프레임 선택 버튼 */
.frame-selector {
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    background: #222;
    margin-right: 5px;
}
