/* ============== 마이페이지 전용 CSS ============== */


/* 기본 컨테이너 */

.mypage-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 40px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    text-align: center;
    /* 추가 */
}

.mypage-header {
    text-align: center;
    margin-bottom: 3rem;
}

.mypage-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}


/* 사용자 정보 카드 */

.user-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    font-weight: 900;
}

.user-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.user-email {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}


/* 🔥 쿠폰보관함 버튼 스타일 추가 */

.coupon-vault-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.coupon-vault-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.logout-btn {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* 🔥 사용자 액션 버튼 그룹 */

.user-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 1rem;
}


/* 쿠폰 보관함 */

.coupon-vault {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.coupon-vault h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coupon-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.coupon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.coupon-icon {
    font-size: 1.8rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.coupon-info {
    flex: 1;
}

.coupon-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.coupon-amount {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.coupon-expire {
    color: #999;
    font-size: 0.85rem;
}

.coupon-use-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.coupon-use-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.no-coupons {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-coupons p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}


/* 챌린지 카드 */

.challenge-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* 추가되는 부분 */
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.challenge-card h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}


/* 챌린지 정보 그리드 */

.challenge-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-items: center;
    /* 추가 */
}

.info-item {
    text-align: center;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.info-label {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 700;
    font-size: 1.1rem;
}


/* 진행률 섹션 */

.progress-section {
    margin-top: 2rem;
    text-align: center;
}

.progress-circle-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#667eea 0deg, #667eea var(--progress-deg), rgba(102, 126, 234, 0.2) var(--progress-deg));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.progress-circle-large::before {
    content: '';
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.progress-text-large {
    font-size: 1.8rem;
    font-weight: 900;
    z-index: 1;
    color: #667eea;
}

.progress-section p {
    color: #666;
    font-size: 1rem;
    margin-top: 1rem;
}

.progress-section strong {
    color: #667eea;
    font-weight: 700;
}


/* 챌린지 없음 상태 */

.no-challenge {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-challenge h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.no-challenge p {
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}


/* 액션 버튼들 */

.action-buttons {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.cta-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.cta-button-white {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 1rem 2rem;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 200px;
}

.cta-button-white:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}


/* 상태 메시지들 */

.status-message {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.status-message p {
    margin-bottom: 0.5rem;
    color: #856404;
    line-height: 1.5;
}

.completion-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.completion-message p {
    margin-bottom: 0.5rem;
    color: #155724;
    line-height: 1.5;
    font-weight: 600;
}

.failure-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.failure-message p {
    margin-bottom: 0.5rem;
    color: #721c24;
    line-height: 1.5;
}


/* 모달 스타일 */

.status-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.status-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-title {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.status-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.status-description p {
    margin-bottom: 0.5rem;
}

.status-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.status-info p {
    margin-bottom: 0.3rem;
    color: #495057;
}

.status-actions {
    margin-top: 1.5rem;
}


/* 반응형 디자인 */

@media (max-width: 768px) {
    .mypage-container {
        padding: 100px 15px 20px;
    }
    .mypage-header h1 {
        font-size: 2rem;
    }
    .user-info,
    .coupon-vault,
    .challenge-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .challenge-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .info-item {
        padding: 1rem;
    }
    .progress-circle-large {
        width: 120px;
        height: 120px;
    }
    .progress-circle-large::before {
        width: 95px;
        height: 95px;
    }
    .progress-text-large {
        font-size: 1.5rem;
    }
    .action-buttons {
        gap: 0.8rem;
    }
    .cta-button,
    .cta-button-white {
        min-width: 160px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    .coupon-item {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    .coupon-use-btn {
        align-self: stretch;
    }
    .status-card {
        padding: 2rem;
        margin: 20px;
    }
    /* 🔥 모바일에서 버튼 스타일 조정 */
    .user-actions {
        flex-direction: column;
        gap: 8px;
    }
    .coupon-vault-btn,
    .logout-btn {
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .challenge-info {
        grid-template-columns: 1fr;
    }
    .mypage-header h1 {
        font-size: 1.8rem;
    }
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .progress-circle-large {
        width: 100px;
        height: 100px;
    }
    .progress-circle-large::before {
        width: 80px;
        height: 80px;
    }
    .progress-text-large {
        font-size: 1.3rem;
    }
}


/* 애니메이션 */

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


/* 로딩 및 알림 스타일 개선 */

.alert {
    animation: slideIn 0.3s ease;
}


/* 추가적인 상태별 스타일링 */

.info-value[style*="color: #ffc107"] {
    color: #f39c12 !important;
}

.info-value[style*="color: #fd7e14"] {
    color: #e67e22 !important;
}

.info-value[style*="color: #20c997"] {
    color: #16a085 !important;
}

.info-value[style*="color: #0d6efd"] {
    color: #3498db !important;
}

.info-value[style*="color: #198754"] {
    color: #27ae60 !important;
}

.info-value[style*="color: #dc3545"] {
    color: #e74c3c !important;
}


/* 호버 효과 강화 */

.user-info:hover,
.coupon-vault:hover,
.challenge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}


/* 스크롤바 스타일링 */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4a96);
}


/* ============== 🆕 mypage.css에 추가할 프로필 사진 스타일 ============== */


/* ============== 🆕 프로필 사진 업로드 관련 스타일 (선택 메뉴 방식) ============== */


/* 프로필 선택 모달 */

.profile-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.profile-menu-content {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 280px;
    max-width: 90%;
    animation: modalSlideIn 0.3s ease;
}

.profile-menu-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
}

.profile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.profile-menu-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-menu-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.profile-menu-btn.danger {
    background: #dc3545;
}

.profile-menu-btn.danger:hover {
    background: #c82333;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.profile-menu-btn.cancel {
    background: #6c757d;
}

.profile-menu-btn.cancel:hover {
    background: #5a6268;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}


/* 모달 애니메이션 */

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* 프로필 아바타 컨테이너 */

.profile-avatar-container {
    position: relative;
    display: inline-block;
}


/* 기존 user-avatar 스타일 확장 (클릭 가능 + 프로필 이미지 지원) */

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    font-weight: 900;
    cursor: pointer;
    /* 클릭 가능하다는 표시 */
    transition: all 0.3s ease;
    overflow: hidden;
    /* 프로필 이미지가 원형을 벗어나지 않도록 */
    position: relative;
    /* 설정 아이콘 위치 기준 */
}


/* 프로필 이미지가 있을 때 */

.user-avatar.has-image {
    background: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}


/* 프로필 이미지 */

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}


/* 호버 효과 */

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.user-avatar.has-image:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}


/* 설정 아이콘 (프로필 사진이 없을 때만 표시) */

.profile-settings-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid white;
}

.profile-settings-icon:hover {
    background: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


/* 숨겨진 파일 입력 */

.profile-photo-input {
    display: none;
}


/* 프로필 사진 업로드 로딩 */

.profile-upload-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    display: none;
    z-index: 1000;
    white-space: nowrap;
}


/* 프로필 사진 업로드 중일 때 아바타 오버레이 */

.user-avatar.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar.uploading {
    pointer-events: none;
}


/* 모바일 반응형 */

@media (max-width: 768px) {
    .user-avatar:active {
        transform: scale(0.95);
    }
    .profile-settings-icon:active {
        transform: scale(0.9);
    }
}

@media (max-width: 480px) {
    .profile-menu-content {
        margin: 1rem;
        padding: 1.2rem;
    }
    .profile-menu-buttons {
        gap: 0.6rem;
    }
    .profile-menu-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}


/* 회원탈퇴 링크 */

.account-delete-link {
    color: #1842cc;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.account-delete-link:hover {
    color: #dc3545;
    text-decoration: underline;
}