@import url('root.css');

/* 브라우저 호환성을 위한 추가 리셋 */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-family: 'Spoqa Han Sans Neo', 'sans-serif';
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

html,
* {
    font-family: 'Spoqa Han Sans Neo', 'sans-serif';
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    background-color: var(--key1);
    height: 100vh;
    padding: 6px 16px;
    box-sizing: border-box;
}

/*---- header 영역 ----*/
header {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 50px;
    width: 100%;
}


.mainLogo {
    width: 140px;
    height: fit-content;
    cursor: pointer;
}


.profileContainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: fit-content;
}

.buttonLogin {
    background-color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    /* width: 110px; */
    width: fit-content;
    height: 35px;
    border: 1px solid #E0E0E0;
    border-radius: var(--borderRadiusBtnSmall);
    border: none;
    text-decoration: none;
    padding: 10px;
}

.buttonLogin p {
    font-size: 15px;
    line-height: 0.4;
    color: var(--grey3);
    margin-left: 4px;
}


.buttonLogin svg {
    width: 15px;
    height: 15px;
}

.user-nickname {
    font-size: 16px;
    line-height: 0.4;
    color: var(--black);
    font-weight: 500;
}

.user-plan {
    font-size: 14px;
    line-height: 0.4;
    color: var(--grey3);
    font-weight: 400;
}

.buttonModal {
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--borderRadiusBtnSmall);
    border: none;
    margin-left: 12px;
}

.buttonModal svg {
    width: 20px;
    height: auto;
    color: var(--black);
}

.asideButtonOpen:hover,
.buttonModal:hover {
    background-color: var(--btnHover);
}

/*---- aside+chat 통합 영역 ----*/
.asideChatContainer {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    flex-grow: 1;
    /* container의 남은 세로 공간을 모두 차지하도록 설정 */
    margin: 4px 0;
    gap: 16px;
    box-sizing: border-box;
    /* 패딩과 보더가 height에 포함되도록 */
    overflow: hidden;

}

.asideOn {
    position: relative;
    /* 추천 콘텐츠 섹션의 위치 기준점으로 설정 */
    background-color: white;
    flex: 0 1 600px;
    /* 기본 너비 600px, 축소 가능, 확장 불가 */
    max-width: 600px;
    /* 최대 너비 제한 */
    height: 100%;
    /* 부모 .asideChatContainer의 높이를 100% 차지 */
    min-width: 300px;
    /* 최소 너비 설정 (50px에서 300px로 증가) */
    padding: 6px 12px;
    border-radius: var(--borderRadiusMedium);
    box-sizing: border-box;
    /* 패딩이 전체 너비/높이에 포함되도록 */
    display: flex;
    /* 내부 요소들을 Flexbox로 정렬 */
    flex-direction: column;
    /* 자식 요소들을 세로로 정렬 */
    overflow-y: hidden;
    /* 스크롤 방지 */
    overflow-x: hidden;
    transition: all 0.6s ease;

    .aside-view::-webkit-scrollbar {
        display: none;
    }

    .aside-view {
        scrollbar-width: none;
    }
}

.aside-view {
    height: 100%;
    width: 100%;
    padding: 6px 0px;
    overflow-y: auto;
    transition: opacity 0.2s ease;
    transform: translateZ(0);
    /* GPU 가속을 활성화하여 애니메이션 성능을 향상시킵니다. */
}

.aside-view-loading {
    opacity: 0;
}

.chat {
    background-color: white;
    height: 100%;
    /* 부모 .asideChatContainer의 높이를 100% 차지 */
    flex-grow: 1;
    /* .asideOn이 차지하고 남은 가로 공간을 모두 차지하도록 설정 */
    min-width: 50px;
    /* 최소 너비 설정 */
    /* max-width는 필요에 따라 추가 */
    padding: 6px;
    /* 모든 방향에 동일하게 6px 패딩 */
    border-radius: var(--borderRadiusMedium);
    box-sizing: border-box;
    /* 패딩이 전체 너비/높이에 포함되도록 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================================================================= */
/* =================== aside 접힘/펼침/확장 관련 스타일 =================== */
/* ================================================================= */

/* JS로 .hidden 클래스를 토글하여 요소를 숨깁니다. */
.hidden {
    display: none !important;
}

/* aside가 접혔을 때의 스타일 */
.asideOn.asideCollapsed {
    background-color: white;
    flex: 0 0 100px;
    /* 축소된 너비 100px, 고정 크기 */
    max-width: 100px;
    /* 최대 너비 제한 */
    min-width: 100px;
    /* 최소 너비도 100px로 고정 */
    padding-left: 6px;
    /* 축소 시 패딩 조절 */
    padding-right: 6px;
    /* 축소 시 패딩 조절 */
    overflow-y: hidden;
    /* 스크롤바 숨김 */
    border-radius: var(--borderRadiusMedium);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; */
    transition: all 0.6s ease;
    /* 부드러운 크기 변경 애니메이션 */
}

.asideButtonOpen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
    width: 36px;
    height: 36px;
    padding-bottom: 6px;
    border: 1px solid var(--grey4);
    border-radius: var(--borderRadiusBtnSmall);
    border-color: var(--grey2);
    cursor: pointer;
    /* margin-left: auto; */
    padding-top: 4px;
    margin-top: 16px;
}

.asideButtonOpen svg {
    fill: var(--grey4);
    width: 20px;
    height: 20px;
    padding-right: 3px;
}

.asideOn.aside-fully-expanded {
    flex: 0 0 1000px;
    /* 확장된 너비 1000px, 고정 크기 */
    max-width: 1000px;
    /* 최대 너비 제한 */
}

/* ================================================================= */
/* ===================== Mobile message 관련 스타일 ====================== */
/* ================================================================= */

/* Mobile message styling */
.mobile-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    color: #617dae;
}

/* 태블릿 및 소형 데스크톱 */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .asideOn {
        flex: 0 1 400px;
        max-width: 400px;
    }
}

/* 모바일 디바이스 */
@media screen and (max-width: 768px),
screen and (max-height: 500px) {
    .container {
        display: none !important;
    }

    .mobile-message {
        display: flex;
    }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .mainLogo,
    .columnThumbnail img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ================================================================= */
/* ===================== 이미지 모달 스타일 ========================== */
/* ================================================================= */

.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.image-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.image-modal-overlay.active .image-modal-content {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 36px;
    height: 36px;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: background-color 0.2s ease;
}

.image-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .image-modal-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }

    .image-modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }
}