/* ========================================
   🔥 COMMUNITY PAGE STYLES
   ======================================== */
/* 메인 컨테이너 레이아웃 */
.main-container {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 커뮤니티 레이아웃 */
.community-layout {
    display: flex;
    height: calc(100vh - 65px); /* 새로운 헤더 높이에 맞춤 */
    width: 100%;
    overflow: hidden;
}

/* 커뮤니티 레이아웃 내부 */
.community-layout-inner {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: hidden;
}
/* ========================================
   차트는 chart.css 파일에서 관리
   ======================================== */

   /* 🔥 고래 탐지와 채팅 컨테이너 */
   .whale-chat-container {
    width: 450px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    background-color: var(--bg-color);
}
/* 🔥 실시간 고래 탐지 섹션 */
.whale-tracking-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 50%;
    min-height: 0;
    background-color: var(--bg-color);
}
/* 🔥 고래 탐지 헤더 */
.whale-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 3px solid var(--border-color);
    background-color: var(--card-bg);
    flex-shrink: 0;
    height: 40px;
}

.whale-section-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.whale-section-header h2::before {
    content: "";
    font-size: 18px;
}

.whale-status-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.whale-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    animation: pulse 2s infinite;
}

.whale-status-indicator.connected {
    background-color: #10b981;
}

.whale-status-indicator.disconnected {
    background-color: #ef4444;
}

.whale-status-indicator.error {
    background-color: #ef4444;
}

.whale-status-text {
    font-size: 12px;
    color: var(--text-color-secondary);
    font-weight: 500;
}
/* 🔥 고래 탐지 섹션은 whale-tracker.css 파일에서 관리 */

/* 🔥 구분선 */
.section-divider {
    height: 1px;
    background-color: var(--border-color);
    flex-shrink: 0;
}

/* 채팅 영역 */
.chat-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    height: 50%;
    min-height: 0;
    background-color: var(--bg-color);
}

.chat-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 3px solid var(--border-color);
    background-color: var(--card-bg);
    flex-shrink: 0;
    height: 40px;
}

.chat-section-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-section-header h2::before {
    content: "";
    font-size: 18px;
}

.chat-users-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-color-secondary);
    font-size: 12px;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ========================================
   🔥 모바일 반응형 스타일
   ======================================== */
@media (max-width: 768px) {

    /* 모바일에서 레이아웃을 세로로 변경 */
    .community-layout-inner {
        flex-direction: column;
    }
    
    /* 모바일에서 고래탐지 섹션 숨기기 */
    .whale-tracking-section {
        display: none !important;
    }
    
    /* 모바일에서 구분선 숨기기 */
    .section-divider {
        display: none !important;
    }
    
    /* 모바일에서 chart-layout-header 숨기기 */
    .chart-layout-header {
        display: none !important;
    }
    
    /* 모바일에서 고래-채팅 컨테이너 전체 너비로 변경 */
    .whale-chat-container {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    /* 모바일에서 차트 섹션 높이 조정 */
    .chart-section {
        height: 50%;
        min-height: 400px;
    }
    
    /* 모바일에서 채팅 섹션 전체 높이로 변경 */
    .chat-section {
        height: 100%;
        flex: 1;
    }
    
    /* 모바일에서 채팅 헤더 높이 조정 */
    .chat-section-header {
        height: 50px;
        padding: 16px 12px;
    }
    
    .chat-section-header h2 {
        font-size: 16px;
    }
    
    /* 모바일에서 채팅 메시지 영역 패딩 조정 */
    #chat-messages {
        padding: 12px;
        -webkit-overflow-scrolling: touch; /* iOS 스크롤 개선 */
    }
    
    /* 모바일에서 차트 컨테이너 높이 조정 */
    #chart-container-wrapper {
        height: 100%;
    }
    
    /* 모바일에서 TradingView 차트 높이 조정 */
    #tradingview_chart {
        height: 100% !important;
    }
    
    /* 모바일에서 차트 로딩 상태 개선 */
    .chart-loading {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        font-size: 16px;
        color: var(--text-color-secondary);
    }
    
    /* 모바일에서 채팅 입력 폼 개선 */
    .chat-input-form {
        padding: 12px;
        border-top: 1px solid var(--border-color);
    }
    
    .chat-input-form input {
        font-size: 16px; /* iOS에서 줌 방지 */
        padding: 12px;
        border-radius: 8px;
    }
    
    .chat-input-form button {
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
    }
    
    /* 모바일에서 전체 레이아웃 높이 조정 */
    .community-layout {
        height: calc(100vh - 65px);
    }
    
    /* 모바일에서 스크롤 개선 */
    .community-layout-inner {
        overflow: hidden;
    }
    
    /* 모바일에서 채팅 메시지 스크롤 개선 */
    .chat-wrapper {
        overflow: hidden;
    }
    
    #chat-messages {
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }
    
    #chat-messages::-webkit-scrollbar {
        width: 4px;
    }
    
    #chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }
    
    #chat-messages::-webkit-scrollbar-thumb {
        background-color: var(--border-color);
        border-radius: 2px;
    }
}