/* ========================================
   마이페이지 CSS
   mypage.html
   ======================================== */

/* 포인트 & 추천코드 섹션 */
.points-referral-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.points-card,
.referral-card {
    background: #fff;
    border: 2px solid #5d4037;
    border-radius: 12px;
    padding: 24px;
}

.points-header,
.referral-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.points-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8d6e63, #5d4037);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.referral-icon {
    font-size: 32px;
}

.points-label,
.referral-label {
    font-size: 14px;
    color: #8d6e63;
    font-weight: 600;
}

.points-amount {
    font-size: 36px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 8px;
}

.points-amount::after {
    content: 'P';
    font-size: 20px;
    margin-left: 4px;
}

.points-hint,
.referral-hint {
    font-size: 12px;
    color: #8d6e63;
}

/* 포인트 내역 보기 버튼 */
.points-history-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: #efebe9;
    color: #5d4037;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.points-history-btn:hover {
    background: #d7ccc8;
}

.points-history-btn .toggle-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.points-history-btn .toggle-arrow.open {
    transform: rotate(180deg);
}

/* 포인트 내역 섹션 */
.point-history-section {
    margin-bottom: 24px;
    animation: slideDown 0.3s ease-out;
}

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

.point-history-box {
    background: #fff;
    border: 2px solid #d7ccc8;
    border-radius: 12px;
    overflow: hidden;
}

.point-history-list {
    max-height: 300px;
    overflow-y: auto;
}

.point-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #efebe9;
}

.point-history-item:last-child {
    border-bottom: none;
}

.point-history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.point-history-icon.earn {
    background: #e8f5e9;
}

.point-history-icon.spend {
    background: #ffebee;
}

.point-history-content {
    flex: 1;
    min-width: 0;
}

.point-history-title {
    font-size: 14px;
    font-weight: 500;
    color: #5d4037;
    margin-bottom: 2px;
}

.point-history-email {
    font-size: 12px;
    color: #8d6e63;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-history-date {
    font-size: 11px;
    color: #a1887f;
}

.point-history-amount {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.point-history-amount.earn {
    color: #4caf50;
}

.point-history-amount.earn::before {
    content: '+';
}

.point-history-amount.spend {
    color: #e53935;
}

.point-history-amount.spend::before {
    content: '-';
}

.point-history-empty {
    padding: 40px 20px;
    text-align: center;
    color: #8d6e63;
    font-size: 14px;
}

.referral-code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #efebe9;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.referral-code-display .code {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #5d4037;
}

.referral-code-display .copy-btn {
    background: #5d4037;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.referral-code-display .copy-btn:hover {
    background: #8d6e63;
}

/* 카카오톡 공유 버튼 */
.referral-share-btns {
    margin-bottom: 12px;
}

.kakao-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #FEE500;
    color: #3C1E1E;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.kakao-share-btn:hover {
    background: #F5DC00;
    transform: translateY(-1px);
}

.kakao-share-btn svg {
    flex-shrink: 0;
}

.referral-stats {
    font-size: 14px;
    color: #5d4037;
    margin-bottom: 8px;
}

.referral-stats strong {
    color: #5d4037;
    font-weight: 700;
}

/* 메뉴 카드 섹션 */
.menu-cards-section {
    margin-bottom: 32px;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 2px solid #efebe9;
    border-radius: 12px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.menu-card:hover {
    border-color: #5d4037;
    box-shadow: 0 4px 12px rgba(93, 64, 55, 0.1);
    transform: translateY(-2px);
}

.menu-card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.menu-card-content {
    flex: 1;
}

.menu-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 4px;
}

.menu-card-desc {
    font-size: 13px;
    color: #8d6e63;
}

.menu-card-arrow {
    font-size: 24px;
    color: #8d6e63;
    flex-shrink: 0;
}

/* 메인 컨테이너 */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

/* 컨텐츠 영역 */
.content {
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.content-title {
    font-size: 24px;
    font-weight: 700;
}

.favorite-count {
    font-size: 14px;
    color: #8d6e63;
}

/* 찜한 선생님 그리드 */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.favorite-card {
    background: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.favorite-card:hover {
    transform: translateY(-4px);
}

.favorite-photo {
    width: 100%;
    height: 160px;
    background-color: #efebe9;
    overflow: hidden;
}

.favorite-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-info {
    padding: 16px;
}

.favorite-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.favorite-name {
    font-size: 16px;
    font-weight: 600;
}

.unfavorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #e53935;
    transition: transform 0.2s;
}

.unfavorite-btn:hover {
    transform: scale(1.2);
}

.favorite-subject {
    font-size: 13px;
    color: #8d6e63;
    margin-bottom: 8px;
}

.favorite-schedule {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.favorite-actions {
    display: flex;
    gap: 8px;
}

.favorite-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 13px;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border: 2px solid #d7ccc8;
    border-radius: 8px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: #8d6e63;
    margin-bottom: 24px;
}

/* 알림 섹션 */
.notifications-section {
    margin-top: 40px;
}

.notification-list {
    background: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    overflow: hidden;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #d7ccc8;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #fff8e1;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #efebe9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 14px;
    color: #5d4037;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: #8d6e63;
}

/* 알림 타입별 스타일 */
.notification-item.cancelled {
    border-left: 4px solid #e53935;
}

.notification-item.cancelled .notification-icon {
    background-color: #ffebee;
}

.notification-item.modified {
    border-left: 4px solid #ff9800;
}

.notification-item.modified .notification-icon {
    background-color: #fff3e0;
}

.notification-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #faf8f5;
}

.notification-item.unread .notification-title::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #e53935;
    border-radius: 50%;
    margin-left: 8px;
}

/* ========================================
   반응형 - 모바일 (768px 이하)
   ======================================== */
@media (max-width: 768px) {
    .main-container {
        padding: 20px 16px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .content-title {
        font-size: 20px;
    }

    /* 포인트 & 추천 섹션 */
    .points-referral-section {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 32px;
    }

    .points-card,
    .referral-card {
        padding: 20px;
    }

    .points-header,
    .referral-header {
        gap: 10px;
        margin-bottom: 12px;
    }

    .points-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .referral-icon {
        font-size: 28px;
    }

    .points-amount {
        font-size: 32px;
    }

    .referral-code-display {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    .referral-code-display .code {
        font-size: 20px;
        text-align: center;
    }

    .referral-code-display .copy-btn {
        width: 100%;
        padding: 10px 16px;
    }

    .kakao-share-btn {
        width: 100%;
        justify-content: center;
    }

    /* 추천인 코드 입력 */
    .referrer-input-box {
        padding: 16px;
    }

    .referrer-input-row {
        flex-direction: column;
    }

    .referrer-input-row input {
        text-align: center;
    }

    .referrer-input-row .apply-btn {
        width: 100%;
    }

    /* 메뉴 카드 */
    .menu-card {
        padding: 16px 18px;
        gap: 14px;
    }

    .menu-card-icon {
        font-size: 28px;
    }

    .menu-card-title {
        font-size: 15px;
    }

    .menu-card-desc {
        font-size: 12px;
    }

    /* 찜한 선생님 그리드 */
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .favorite-card {
        border-radius: 10px;
    }

    .favorite-photo {
        height: 140px;
    }

    .favorite-info {
        padding: 14px;
    }

    .favorite-name {
        font-size: 15px;
    }

    .favorite-subject {
        font-size: 12px;
    }

    .favorite-schedule {
        font-size: 13px;
    }

    .favorite-actions {
        flex-direction: column;
        gap: 6px;
    }

    .favorite-actions .btn {
        padding: 10px 8px;
        font-size: 12px;
    }

    /* 빈 상태 */
    .empty-state {
        padding: 60px 20px;
    }

    .empty-icon {
        font-size: 56px;
    }

    .empty-title {
        font-size: 16px;
    }

    .empty-desc {
        font-size: 13px;
    }

    /* 알림 섹션 */
    .notifications-section {
        margin-top: 32px;
    }

    .notification-item {
        padding: 14px 16px;
        gap: 10px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
    }

    .notification-title {
        font-size: 14px;
    }

    .notification-message {
        font-size: 13px;
    }

    .notification-time {
        font-size: 11px;
    }
}

/* ========================================
   반응형 - 작은 모바일 (480px 이하)
   ======================================== */
@media (max-width: 480px) {
    .main-container {
        padding: 16px 12px;
    }

    .content-title {
        font-size: 18px;
    }

    /* 포인트 & 추천 섹션 */
    .points-card,
    .referral-card {
        padding: 16px;
    }

    .points-amount {
        font-size: 28px;
    }

    .points-amount::after {
        font-size: 16px;
    }

    .referral-code-display .code {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .referral-stats {
        font-size: 13px;
    }

    /* 찜한 선생님 그리드 - 1열 */
    .favorites-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .favorite-card {
        display: flex;
        flex-direction: row;
    }

    .favorite-photo {
        width: 120px;
        height: auto;
        min-height: 140px;
        flex-shrink: 0;
    }

    .favorite-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .favorite-actions {
        flex-direction: row;
        gap: 8px;
    }

    .favorite-actions .btn {
        flex: 1;
        padding: 8px;
    }

    /* 메뉴 카드 */
    .menu-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .menu-card-icon {
        font-size: 24px;
    }

    .menu-card-title {
        font-size: 14px;
    }

    .menu-card-desc {
        font-size: 11px;
    }

    .menu-card-arrow {
        font-size: 20px;
    }

    /* 알림 */
    .notification-item {
        padding: 12px 14px;
    }

    .notification-icon {
        width: 32px;
        height: 32px;
    }

    .notification-title {
        font-size: 13px;
    }

    .notification-message {
        font-size: 12px;
    }

    /* 빈 상태 */
    .empty-state {
        padding: 50px 16px;
    }

    .empty-icon {
        font-size: 48px;
    }

    .empty-title {
        font-size: 15px;
    }

    .empty-desc {
        font-size: 12px;
        margin-bottom: 20px;
    }
}

/* ========================================
   Safe Area 지원
   ======================================== */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .main-container {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}
