/* ======================================
   CSS Variables for Theme Configuration
   ====================================== */

/* Light Theme Variables */
[data-bs-theme=light][data-skin=bordered] {
    --bs-logo-box-bg: #fff;
    --bs-text-dark-rgb: 107, 108, 157;
}

/* Dark Theme Variables */
[data-bs-theme=dark][data-skin=bordered] {
    --bs-body-bg: #0c0e19;
    --bs-logo-box-bg: #393a5a;
    --bs-text-dark-rgb: #f5f5f9;
}

/* ======================================
   Background Components
   ====================================== */

/* Section Background */
[data-bs-theme=light][data-skin=bordered] .bg-vasanta-section {
    background-color: #f5f5f9;
}

[data-bs-theme=dark][data-skin=bordered] .bg-vasanta-section {
    background-color: #232333;
}

/* ======================================
   Logo Components
   ====================================== */

/* Logo Box */
.vasanta-logo-box {
    background-color: var(--bs-logo-box-bg);
    transition: box-shadow 0.3s ease;
}

.vasanta-logo-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Logo Image Filter */
.logo-img {
    filter: none;
    transition: filter 0.3s ease;
    height: 27px;
}

/* ======================================
   Bootstrap Select Dropdown Scroll Enhancement
   ====================================== */

/* Bootstrap Select 드롭다운 스크롤 최적화 */
.bootstrap-select .dropdown-menu {
    max-height: 250px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; /* 모바일 부드러운 스크롤 */
    scrollbar-width: thin; /* Firefox용 얇은 스크롤바 */
    scrollbar-color: #c1c1c1 #f1f1f1; /* Firefox용 스크롤바 색상 */
}

/* 웹킷 기반 브라우저 스크롤바 스타일링 */
.bootstrap-select .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 드롭다운 항목 스타일 최적화 */
.bootstrap-select .dropdown-menu li {
    white-space: normal !important; /* 긴 텍스트 줄바꿈 허용 */
    word-break: break-word; /* 긴 단어 줄바꿈 */
}

.bootstrap-select .dropdown-menu li a {
    padding: 8px 16px; /* 터치 친화적인 패딩 */
    line-height: 1.4; /* 가독성 향상 */
}

[data-bs-theme="dark"] .logo-img {
    filter: grayscale(1) brightness(10) contrast(0.4);
    transition: filter 0.3s ease;
}

/* ======================================
   Text Components
   ====================================== */

.vasanta-text-dark {
    --bs-text-opacity: 1;
    color: rgba(var(--bs-text-dark-rgb), var(--bs-text-opacity)) !important;
}

/* ======================================
   Third-party Library Customizations
   ====================================== */

/* ApexCharts Dark Theme */
[data-bs-theme="dark"] .apexcharts-xaxis .apexcharts-xaxis-texts-g text,
[data-bs-theme="dark"] .apexcharts-xaxis .apexcharts-xaxis-title text,
[data-bs-theme="dark"] .apexcharts-yaxis .apexcharts-yaxis-texts-g text,
[data-bs-theme="dark"] .apexcharts-yaxis .apexcharts-yaxis-title text {
    fill: #d5d5e2 !important;
}

/* Bootstrap Select 드롭다운 최적화 */
.bootstrap-select .dropdown-menu {
    max-height: 200px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin; /* Firefox용 얇은 스크롤바 */
    scrollbar-color: #c1c1c1 #f1f1f1; /* Firefox용 스크롤바 색상 */
}

/* Webkit 기반 브라우저 (Chrome, Safari, Edge) 스크롤바 커스터마이징 */
.bootstrap-select .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 다크 테마용 스크롤바 */
[data-bs-theme="dark"] .bootstrap-select .dropdown-menu::-webkit-scrollbar-track {
    background: #2b2c40;
}

[data-bs-theme="dark"] .bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb {
    background: #5a5c75;
}

[data-bs-theme="dark"] .bootstrap-select .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #6d6f88;
}

[data-bs-theme="dark"] .bootstrap-select .dropdown-menu {
    scrollbar-color: #5a5c75 #2b2c40; /* Firefox 다크 테마 */
}

/* 드롭다운 내부 옵션 호버 효과 개선 */
.bootstrap-select .dropdown-menu li:not(.disabled) a:hover {
    background-color: #f8f9fa;
    transition: background-color 0.15s ease;
}

[data-bs-theme="dark"] .bootstrap-select .dropdown-menu li:not(.disabled) a:hover {
    background-color: #393a5a;
}