/* ==========================================================================
   Dark Mode Theme Styles
   - Top Controls Dark Mode
   - Sidebars Dark Mode
   - Community Section Dark Mode
   ========================================================================== */

/* ==========================================
   Top Controls Dark Mode Styling
   ========================================== */

/* Top Controls Container */
body.theme-dark #top-controls {
    background: linear-gradient(135deg, #1f2937, #111827) !important;
    border-bottom: 1px solid #374151 !important;
}

/* Buttons in Top Controls */
body.theme-dark #top-controls .btn-outline-primary {
    color: #e5e7eb;
    border-color: #4b5563;
    background-color: transparent;
}

body.theme-dark #top-controls .btn-outline-primary:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

/* 다크 모드에서 선택된 interval 버튼 스타일 (더 구체적인 선택자 + !important) */
body.theme-dark #top-controls #interval-controls .btn-outline-primary.active,
body.theme-dark #interval-controls .btn-outline-primary.active,
body.theme-dark #top-controls .btn-outline-primary.active {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* Select Box */
body.theme-dark #top-controls .form-select {
    background-color: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e5e7eb' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

body.theme-dark #top-controls .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* View Mode Group */
body.theme-dark .view-mode-group {
    background: #1f2937;
    border-color: #374151;
}

/* View Mode Labels (Unchecked) */
body.theme-dark .view-mode-label {
    background: #374151;
    border-color: #4b5563;
}

body.theme-dark .view-mode-label i,
body.theme-dark .view-mode-label span {
    color: #9ca3af;
}

body.theme-dark .view-mode-label:hover {
    background: #4b5563;
    border-color: #60a5fa;
}

body.theme-dark .view-mode-label:hover i,
body.theme-dark .view-mode-label:hover span {
    color: #e5e7eb;
}

/* View Mode Labels (Checked) */
body.theme-dark .view-mode-options input[type="radio"]:checked + .view-mode-label {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
}

body.theme-dark .view-mode-options input[type="radio"]:checked + .view-mode-label i,
body.theme-dark .view-mode-options input[type="radio"]:checked + .view-mode-label span {
    color: #ffffff;
}


/* Other Buttons (Success, Warning, Info) */
body.theme-dark #top-controls .btn-success {
    background-color: #059669;
    border-color: #059669;
}
body.theme-dark #top-controls .btn-success:hover {
    background-color: #047857;
    border-color: #047857;
}

body.theme-dark #top-controls .btn-warning {
    background-color: #d97706;
    border-color: #d97706;
    color: #ffffff;
}
body.theme-dark #top-controls .btn-warning:hover {
    background-color: #b45309;
    border-color: #b45309;
}

body.theme-dark #top-controls .btn-info {
    background-color: #0891b2;
    border-color: #0891b2;
    color: #ffffff;
}
body.theme-dark #top-controls .btn-info:hover {
    background-color: #0e7490;
    border-color: #0e7490;
}

/* Sidebar Toggle Button */
body.theme-dark #sidebar-toggle-btn {
    color: #e5e7eb;
    border-color: #4b5563;
}
body.theme-dark #sidebar-toggle-btn:hover {
    background-color: #374151;
    color: #ffffff;
}

/* ==========================================
   Top Controls Additional Dark Mode Styles
   ========================================== */

/* 모든 텍스트를 흰색으로 */
body.theme-dark #top-controls,
body.theme-dark #top-controls .form-label,
body.theme-dark #top-controls label,
body.theme-dark #top-controls .btn {
    color: #ffffff !important;
}

/* 캔들 유형 선택 드롭다운 */
body.theme-dark #chart-type-select {
    background-color: #374151;
    color: #ffffff !important; /* 기본 흰색 */
    border-color: #4b5563;
}

/* 선택된 캔들 유형은 밝은 노랑 */
body.theme-dark #chart-type-select option:checked,
body.theme-dark #chart-type-select:focus {
    background-color: #fbbf24 !important;
    color: #111827 !important;
}

/* OHLC 가격 표시 스타일 */
body.theme-dark #ohlcv-display {
    color: #ffffff;
}

/* 상승 가격 - 밝은 파랑 */
body.theme-dark #ohlcv-display .price-up,
body.theme-dark #ohlcv-display .high,
body.theme-dark #ohlcv-display .close.up {
    color: #60a5fa !important; /* Bright Blue */
}

/* 하락 가격 - 밝은 빨강 */
body.theme-dark #chart-ohlcv-label {
    background: transparent;
}

body.theme-dark #chart-ohlcv-label .ohlcv-label {
    color: rgba(255, 255, 255, 0.7);
}

body.theme-dark #chart-ohlcv-label .ohlcv-value {
    color: #ffffff;
}

body.theme-dark #ohlcv-display .price-down,
body.theme-dark #ohlcv-display .low,
body.theme-dark #ohlcv-display .close.down {
    color: #f87171 !important; /* Bright Red */
}

/* 패턴 토글 라벨 (다크 테마) */
body.theme-dark #top-controls label[for="pattern-toggle"] {
    color: #ffffff !important;
}

body.theme-dark .pattern-toggle-wrapper {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    border-color: #334155 !important;
}

body.theme-dark .pattern-toggle-wrapper:hover {
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    border-color: #475569 !important;
}

/* 버튼 내 아이콘 색상 */
body.theme-dark #top-controls .btn i {
    color: #ffffff !important;
}

/* Primary 버튼 */
body.theme-dark #top-controls .btn-primary {
    color: #ffffff !important;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

body.theme-dark #top-controls .btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* ==========================================
   Sidebars Dark Mode Styling
   ========================================== */

/* Right Sidebar (Coin List) */
body.theme-dark #sidebar {
    background-color: #1f2937;
    border-left-color: #374151;
}

body.theme-dark #sidebar-header {
    border-bottom-color: #374151;
}

body.theme-dark #sidebar-header h5 {
    color: #e5e7eb;
}

body.theme-dark #sidebar-close-btn::before {
    color: #9ca3af;
}

body.theme-dark #sidebar-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark #sidebar-body {
    background-color: #1f2937;
}

body.theme-dark #sidebar-body .header {
    border-bottom-color: #374151 !important;
}

body.theme-dark #coin-search {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.theme-dark #coin-search::placeholder {
    color: #9ca3af;
}

body.theme-dark .coin-tabs .nav-link {
    color: #9ca3af;
}

body.theme-dark .coin-tabs .nav-link:hover {
    color: #e5e7eb;
}

body.theme-dark .coin-tabs .nav-link.active {
    background-color: #1f2937;
    color: #e5e7eb;
    border-color: #374151 #374151 #1f2937;
}

body.theme-dark .coin-table {
    color: #e5e7eb;
    background-color: #1f2937;
}

body.theme-dark .coin-table th {
    background-color: #1f2937;
    color: #9ca3af;
    border-bottom-color: #374151;
}

body.theme-dark .coin-table td {
    background-color: #1f2937;
    color: #e5e7eb;
    border-bottom-color: #374151;
}

body.theme-dark .coin-table tbody tr:hover td {
    background-color: #374151;
    color: #ffffff;
}

/* Left Sidebar (Analysis) */
body.theme-dark #analysis-sidebar {
    background-color: #1f2937;
    border-right-color: #374151;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
}

body.theme-dark .sidebar-left-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .sidebar-left-tabs {
    background-color: #111827;
    border-bottom-color: #374151;
}

body.theme-dark .sidebar-left-tabs .nav-link {
    color: #9ca3af;
}

body.theme-dark .sidebar-left-tabs .nav-link:hover {
    color: #e5e7eb;
    background-color: rgba(255, 255, 255, 0.05);
}

body.theme-dark .sidebar-left-tabs .nav-link.active {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.theme-dark .sidebar-left-body {
    background-color: #111827;
}

/* Cards in Left Sidebar */
body.theme-dark .analysis-card-mini,
body.theme-dark .ai-indicator-card,
body.theme-dark .pattern-item,
body.theme-dark .signal-item {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.theme-dark .analysis-card-mini:hover,
body.theme-dark .ai-indicator-card:hover,
body.theme-dark .pattern-item:hover {
    border-color: #667eea;
    background-color: #2d3748;
}

body.theme-dark .analysis-card-mini h6,
body.theme-dark .ai-indicator-card h6,
body.theme-dark .pattern-item strong,
body.theme-dark .signal-item strong {
    color: #e5e7eb;
}

body.theme-dark .analysis-card-mini small,
body.theme-dark .ai-indicator-card small,
body.theme-dark .pattern-item small,
body.theme-dark .signal-item-body,
body.theme-dark .signal-time {
    color: #9ca3af;
}

body.theme-dark .empty-placeholder {
    background-color: #1f2937;
    color: #9ca3af;
}

/* Scrollbars in Dark Mode */
body.theme-dark .sidebar-left-body::-webkit-scrollbar-track,
body.theme-dark #sidebar-body::-webkit-scrollbar-track,
body.theme-dark .coin-list-container::-webkit-scrollbar-track {
    background: #111827;
}

body.theme-dark .sidebar-left-body::-webkit-scrollbar-thumb,
body.theme-dark #sidebar-body::-webkit-scrollbar-thumb,
body.theme-dark .coin-list-container::-webkit-scrollbar-thumb {
    background: #4b5563;
}

body.theme-dark .sidebar-left-body::-webkit-scrollbar-thumb:hover,
body.theme-dark #sidebar-body::-webkit-scrollbar-thumb:hover,
body.theme-dark .coin-list-container::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Badges */
body.theme-dark .badge.bg-light {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

/* ==========================================
   Community Section Dark Mode Styling
   ========================================== */

/* Chart Sections */
body.theme-dark .ai-competition-section,
body.theme-dark .coin-chart-section {
    background: #1f2937;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.theme-dark .ai-competition-section h4,
body.theme-dark .coin-chart-section h4 {
    color: #e5e7eb;
}

/* Dashboard Widgets */
body.theme-dark .dashboard-widget {
    background: #1f2937;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.theme-dark .widget-header {
    border-bottom-color: #374151;
}

body.theme-dark .widget-header h6 {
    color: #e5e7eb;
}

/* Widget Body Scrollbar */
body.theme-dark .widget-body::-webkit-scrollbar-track {
    background: #111827;
}

body.theme-dark .widget-body::-webkit-scrollbar-thumb {
    background: #4b5563;
}

body.theme-dark .widget-body::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Community Posts & Items */
body.theme-dark .community-post h6,
body.theme-dark .shared-analysis h6,
body.theme-dark .shared-analysis strong,
body.theme-dark .top-trader .fw-bold {
    color: #e5e7eb;
}

body.theme-dark .text-muted {
    color: #9ca3af !important;
}

body.theme-dark .shared-analysis {
    border-color: #374151 !important;
}

/* Buttons in Community */
body.theme-dark .btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
}

body.theme-dark .btn-outline-primary:hover {
    background-color: #60a5fa;
    color: #ffffff;
}

/* 다크 모드 - AI 분석 버튼 */
body.theme-dark .btn-ai-analysis-custom {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    color: #ffffff;
}

body.theme-dark .btn-ai-analysis-custom:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4);
}

/* 다크 모드 - 기술지표 추가 버튼 */
body.theme-dark .btn-add-indicator-custom {
    background-color: #14b8a6;
    border-color: #14b8a6;
    color: #ffffff;
}

body.theme-dark .btn-add-indicator-custom:hover {
    background-color: #0d9488;
    border-color: #0d9488;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(20, 184, 166, 0.4);
}

/* 다크 모드 - 버튼 클릭 시 커지는 효과 제거 */
body.theme-dark .btn-ai-analysis-custom,
body.theme-dark .btn-ai-analysis-custom:active,
body.theme-dark .btn-ai-analysis-custom:focus,
body.theme-dark .btn-ai-analysis-custom:focus-visible,
body.theme-dark .btn-ai-analysis-custom:focus-within {
    transform: scale(1) !important;
}

body.theme-dark .btn-ai-analysis-custom:hover {
    transform: translateY(-1px) scale(1) !important;
}

body.theme-dark .btn-add-indicator-custom,
body.theme-dark .btn-add-indicator-custom:active,
body.theme-dark .btn-add-indicator-custom:focus,
body.theme-dark .btn-add-indicator-custom:focus-visible,
body.theme-dark .btn-add-indicator-custom:focus-within {
    transform: scale(1) !important;
}

body.theme-dark .btn-add-indicator-custom:hover {
    transform: translateY(-1px) scale(1) !important;
}

body.theme-dark .btn-outline-secondary {
    color: #9ca3af;
    border-color: #4b5563;
}

body.theme-dark .btn-outline-secondary:hover {
    background-color: #4b5563;
    color: #ffffff;
}

/* Prediction Leaderboard Spinner */
body.theme-dark #prediction-leaderboard,
body.theme-dark #real-time-notifications {
    color: #9ca3af;
}

