/* Counsel 전용 포인트 색상 - 상단바 (index.jsp와 동일하게) */
body:not(.dark-mode) .nav-tab.active,
body:not(.dark-mode) .nav-tab:hover {
    color: #4f46e5 !important;
    border-bottom-color: #4f46e5 !important;
}

body:not(.dark-mode) .nav-tab.active::after {
    background-color: #4f46e5 !important;
}

body .header-btn.login-btn {
    background: #667eea !important;
    border-color: #667eea !important;
}

body .header-btn.login-btn:hover {
    background: #5568d3 !important;
    border-color: #5568d3 !important;
}

body .header-btn.signup-btn {
    border: 1px solid #4b5563 !important;
    color: #667eea !important;
}

body .header-btn.signup-btn:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
}

body .header-credit-display .credit-value {
    color: #4f46e5 !important;
}

body .header-credit-display .credit-label {
    color: #4f46e5 !important;
}

body .guest-credit-display .credit-value {
    color: #4f46e5 !important;
}

body .guest-credit-display .credit-label {
    color: #4f46e5 !important;
}

body .user-email-display:hover {
    color: #667eea !important;
}

body .user-dropdown-item:hover {
    color: #667eea !important;
}

body .more-menu-btn:hover {
    border-color: #667eea !important;
}

body .language-option.active {
    color: #667eea !important;
}

body .language-option:hover {
    color: #667eea !important;
}

body .mega-menu-link:hover {
    color: #667eea !important;
}

body .mega-submenu-item:hover {
    color: #667eea !important;
}

/* ========================================
   CC.jsp 상담 화면 스타일 개선 - 현대적이고 깔끔한 디자인
   ======================================== */

/* 채팅 패널 - 현대적인 그라데이션과 그림자 */
.chat-panel {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 8px 32px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* 채팅 헤더 - 부드러운 그라데이션 배경 */
.chat-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 16px 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 언어 선택 헤더 - 개선된 간격과 정렬 */
.language-select-header {
    gap: 12px;
    align-items: center;
}

.language-select-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.language-select-header label img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    opacity: 0.9;
}

/* 언어 선택 드롭다운 - 현대적인 스타일 (화살표 중복 방지) */
.language-select-header select,
.language-select {
    padding: 8px 12px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: 150px !important;
    /* 브라우저 기본 화살표 완전히 제거 */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    /* 커스텀 화살표 하나만 표시 */
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 8px !important;
    padding-right: 36px !important;
}

/* IE/Edge 기본 화살표 제거 */
.language-select-header select::-ms-expand,
.language-select::-ms-expand {
    display: none !important;
}

/* Chrome/Safari 기본 화살표 제거 */
.language-select-header select::-webkit-appearance,
.language-select::-webkit-appearance {
    -webkit-appearance: none !important;
}

.language-select-header select:hover,
.language-select:hover {
    border-color: #ffffff;
    background-color: #f8fafc;
}

.language-select-header select:focus,
.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 번역 상태 표시 - 잔잔하고 부드러운 색상 */
.translation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f4ff;
    border: 1px solid #e0e7ff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
}

.translation-status .status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.translation-status .status-text {
    color: #667eea;
    font-weight: 500;
}

/* 상담 시작 버튼 */
.counsel-start-btn {
    background: #667eea;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: none;
    white-space: nowrap;
    box-shadow: none;
    letter-spacing: -0.2px;
    text-shadow: none;
}

.counsel-start-btn:hover {
    background: #5568d3;
    transform: none;
    box-shadow: none;
    text-shadow: none;
}

.counsel-start-btn:active {
    transform: none;
    box-shadow: none;
}

.counsel-start-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* 상담 종료 버튼 - 세련된 빨간색 */
.end-counsel-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
    letter-spacing: -0.2px;
}

.end-counsel-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.end-counsel-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.end-counsel-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* 채팅 메시지 영역 - 깔끔한 배경 */
.qa-chat-messages {
    background: #ffffff;
    padding: 20px;
    min-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.qa-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.qa-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.qa-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.qa-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 헤더 오른쪽 영역 - 개선된 간격 */
.chat-header .header-right {
    gap: 12px;
    align-items: center;
}

/* 반응형 디자인 - 모바일 최적화 */
@media (max-width: 768px) {
    .chat-header {
        padding: 12px 16px;
    }
    
    .language-select-header {
        gap: 8px;
    }
    
    .language-select-header select,
    .language-select {
        min-width: 120px;
        font-size: 13px;
        padding: 6px 32px 6px 10px;
    }
    
    .counsel-start-btn,
    .end-counsel-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .translation-status {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* 다크모드 지원 - rgb(32, 33, 37) 배경 적용 */
body.dark-mode {
    background-color: rgb(32, 33, 37);
    color: #ffffff;
}


body.dark-mode .lx_app_header {
    background-color: rgb(32, 33, 37);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .chat-panel {
    background: rgb(42, 42, 45);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .chat-header {
    background: rgb(42, 42, 45) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .qa-chat-messages {
    background: rgb(42, 42, 45);
}

body.dark-mode .polytalk-content-section {
    background: rgb(32, 33, 37);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .translation-records-section {
    background: rgb(32, 33, 37);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 다크모드 메인 콘텐츠 영역 - 배경 및 텍스트 색상 */
body.dark-mode .main-content {
    background-color: rgb(32, 33, 37);
    color: #ffffff;
}

body.dark-mode .container {
    background-color: rgb(32, 33, 37);
    color: #ffffff;
}

body.dark-mode .polytalk-main-layout {
    background: rgb(32, 33, 37);
}

/* 다크모드 텍스트 색상 - 보이게 조정 */
body.dark-mode .language-select-header label {
    color: #ffffff;
}

/* 다크모드 가입하기 버튼 - 글씨 흰색 */
body.dark-mode .header-btn.signup-btn {
    color: #ffffff !important;
    border: 1px solid #4b5563 !important;
}

body.dark-mode .header-btn.signup-btn:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #ffffff !important;
}

/* 다크모드 크레딧 표시 - index.jsp와 동일하게 */
body.dark-mode .header-credit-display {
    color: #818cf8;
}

body.dark-mode .header-credit-display .credit-value {
    color: #818cf8 !important;
}

body.dark-mode .header-credit-display .credit-label {
    color: #818cf8 !important;
}

body.dark-mode .guest-credit-display {
    color: #818cf8;
}

body.dark-mode .guest-credit-display .credit-value {
    color: #818cf8 !important;
}

body.dark-mode .guest-credit-display .credit-label {
    color: #818cf8 !important;
}

/* 다크모드 헤더 탭 색상 - index.jsp와 동일하게 */
body.dark-mode .nav-tab {
    color: #FFFFFF !important;
}

body.dark-mode .nav-tab.active {
    color: #818cf8 !important;
}

body.dark-mode .nav-tab:hover {
    color: #818cf8 !important;
}

body.dark-mode .nav-tab.active::after {
    background-color: #818cf8 !important;
}

body.dark-mode .language-select-header select,
body.dark-mode .language-select {
    background: rgb(40, 41, 45) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    /* 브라우저 기본 화살표 완전히 제거 */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    /* 다크모드에서 화살표를 흰색으로 변경 - 하나만 표시 */
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23f1f5f9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-size: 12px 8px !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
}

/* IE/Edge 기본 화살표 제거 - 다크모드 */
body.dark-mode .language-select-header select::-ms-expand,
body.dark-mode .language-select::-ms-expand {
    display: none !important;
}

body.dark-mode .language-select-header select:hover,
body.dark-mode .language-select:hover {
    background: rgb(45, 46, 50);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .language-select-header select:focus,
body.dark-mode .language-select:focus {
    border-color: #667eea;
    background: rgb(40, 41, 45);
}

/* 다크모드 상태 메시지 */
body.dark-mode .status-message-box {
    background: rgb(40, 41, 45);
    color: #ffffff;
}

body.dark-mode .status-message-text {
    color: #ffffff;
}

/* 다크모드 모달 */
body.dark-mode .modal-content.course-detail-modal {
    background: rgb(40, 41, 45);
    color: #ffffff;
}

body.dark-mode .modal-content.course-detail-modal .modal-body {
    background: rgb(40, 41, 45);
    color: #ffffff;
}

body.dark-mode .section-title-modal {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .select-all-checkbox {
    color: #ffffff;
}

body.dark-mode .select-all-checkbox:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .records-header-controls {
    background: rgb(40, 41, 45);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .translation-records-list > div,
body.dark-mode .translation-records-list > .record-item {
    background: rgb(40, 41, 45);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-mode .translation-records-list > div:hover,
body.dark-mode .translation-records-list > .record-item:hover {
    background: rgb(45, 46, 50);
    border-color: rgba(102, 126, 234, 0.3);
}

/* 다크모드에서 왼쪽 아이콘(학생)만 밝게 표시 - 오른쪽 아이콘은 원래 색상 유지 */
body.dark-mode .language-select-header label img[src*="icon-user.png"] {
    filter: brightness(0) invert(1);
    opacity: 1;
}

body.dark-mode .language-select-header label img[src*="icon-user.png"]:hover {
    opacity: 0.8;
}

/* 오른쪽 아이콘(상담자 - user1.png)은 원래 색상 유지 */
body.dark-mode .language-select-header label img[src*="user1.png"] {
    filter: none;
    opacity: 1;
}

/* 검은색 배경 제거 - 밝은 배경으로 강제 적용 */
.chat-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    background-color: #ffffff !important;
}

/* ========================================
   다크모드 토글 스타일 - counsel 색상 (#667eea) 적용
   ======================================== */

.dark-mode-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

/* 다크모드 토글 스위치 */
.dark-mode-toggle {
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 32px;
    position: relative;
}

.toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: #E5E7EB;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle.dark-mode-active .toggle-track {
    background: #374151;
}

.toggle-knob {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #9CA3AF;
    transition: all 0.3s ease;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.dark-mode-toggle.dark-mode-active .toggle-knob {
    left: calc(100% - 30px);
    background: #ffffff;
}

.toggle-icon-dark,
.toggle-icon-light {
    position: absolute;
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon-dark {
    left: 8px;
    color: #6B7280;
    opacity: 0;
}

.toggle-icon-dark i {
    color: inherit;
}

.toggle-icon-light {
    right: 8px;
    color: #FBBF24;
    opacity: 1;
}

.toggle-icon-light i {
    color: inherit;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-dark {
    opacity: 1;
    color: #ffffff;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-dark i {
    color: #ffffff;
}

.dark-mode-toggle.dark-mode-active .toggle-icon-light {
    opacity: 0;
}

.dark-mode-toggle:hover .toggle-track {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}
