/**
 * KKU Web — Modal dark mode (kku-modal, share, etkinlik/yayın, istatistik)
 */

/* —— KKU Modal sistemi —— */
html[data-color-mode="dark"] .kku-modal-content,
html[data-color-mode="dark"] [class$="-modal-content"]:not(.personel-qr-modal-content):not(.personel-biyografi-modal-content) {
    background: linear-gradient(135deg, var(--kku-cm-surface) 0%, var(--kku-cm-surface-2) 100%) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}

html[data-color-mode="dark"] .kku-modal-body,
html[data-color-mode="dark"] .modal-body {
    background: var(--kku-cm-surface) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] #stats-modal.stats-modal-rich .kku-modal-body {
    background: linear-gradient(180deg, var(--kku-cm-surface-2) 0%, var(--kku-cm-surface) 28%) !important;
}

html[data-color-mode="dark"] .kku-modal-footer,
html[data-color-mode="dark"] .modal-footer {
    background: var(--kku-cm-surface-2) !important;
    border-top-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .kku-modal-btn.secondary,
html[data-color-mode="dark"] .modal-footer .btn:not(.btn-primary):not(.btn-danger):not(.btn-success) {
    background: var(--kku-cm-surface-3) !important;
    color: var(--kku-cm-text-secondary) !important;
    border: 1px solid var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .kku-modal-btn.secondary:hover {
    background: var(--kku-cm-border) !important;
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .kku-modal-detail {
    border-bottom-color: var(--kku-cm-border-soft) !important;
}

html[data-color-mode="dark"] .kku-modal-detail:hover {
    background: var(--kku-cm-surface-2) !important;
}

html[data-color-mode="dark"] .kku-modal-detail-label {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .kku-modal-detail-value {
    background: none !important;
    -webkit-text-fill-color: #f87171 !important;
    color: #f87171 !important;
}

html[data-color-mode="dark"] .kku-modal-list-item {
    border-bottom-color: var(--kku-cm-border-soft) !important;
}

html[data-color-mode="dark"] .kku-modal-loading,
html[data-color-mode="dark"] .kku-modal-loading p {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .kku-modal-body::-webkit-scrollbar-track {
    background: var(--kku-cm-surface-2);
}

html[data-color-mode="dark"] .kku-modal-body::-webkit-scrollbar-thumb {
    background: var(--kku-cm-border);
}

html[data-color-mode="dark"] .modal-content {
    background: linear-gradient(135deg, var(--kku-cm-surface) 0%, var(--kku-cm-surface-2) 100%) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}

/* —— İstatistik kaynak banner —— */
html[data-color-mode="dark"] .stats-source-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(30, 64, 175, 0.12) 100%) !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
    color: var(--kku-cm-text-secondary) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

html[data-color-mode="dark"] .stats-source-banner i {
    color: #60a5fa !important;
}

/* —— Stats rich modal —— */
html[data-color-mode="dark"] .stats-rich-hero {
    border-color: var(--kku-cm-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-color-mode="dark"] .stats-rich-hero-text {
    background: var(--kku-cm-surface-2) !important;
}

html[data-color-mode="dark"] .stats-rich-hero-kicker {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-hero-title {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .stats-rich-section-title {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-metrics {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .stats-rich-metric {
    border-bottom-color: var(--kku-cm-border-soft) !important;
}

html[data-color-mode="dark"] .stats-rich-metric:nth-child(even) {
    background: var(--kku-cm-surface-3) !important;
}

html[data-color-mode="dark"] .stats-rich-metric--empty {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-metric--prose {
    background: var(--kku-cm-surface-3) !important;
}

html[data-color-mode="dark"] .stats-rich-metric-prose,
html[data-color-mode="dark"] .stats-rich-metric-prose span {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .stats-rich-metric-prose strong {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-metric-ic {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, var(--kku-cm-surface-2) 100%) !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
    color: #f87171 !important;
}

html[data-color-mode="dark"] .stats-rich-metric-lbl {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .stats-rich-metric-val {
    color: #f87171 !important;
}

html[data-color-mode="dark"] .stats-rich-foot {
    background: var(--kku-cm-surface-3) !important;
    border-color: var(--kku-cm-border) !important;
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-foot i {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-source {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .stats-rich-source-title {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .stats-rich-source-title i,
html[data-color-mode="dark"] .stats-rich-source-dl dt {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-rich-source-dl dd,
html[data-color-mode="dark"] .stats-rich-source-jobs {
    color: var(--kku-cm-text-secondary) !important;
}

/* —— Fakülte listesi —— */
html[data-color-mode="dark"] .fakulte-list-container {
    background: var(--kku-cm-surface) !important;
}

html[data-color-mode="dark"] .fakulte-list-grid {
    background: var(--kku-cm-surface-2) !important;
}

html[data-color-mode="dark"] .fakulte-list-loading,
html[data-color-mode="dark"] .fakulte-list-empty,
html[data-color-mode="dark"] .fakulte-list-error,
html[data-color-mode="dark"] .fakulte-list-loading p,
html[data-color-mode="dark"] .fakulte-list-empty p,
html[data-color-mode="dark"] .fakulte-list-error p {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .fakulte-list-empty i {
    color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .fakulte-list-card {
    background: var(--kku-cm-surface) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .fakulte-list-card:hover {
    background: var(--kku-cm-surface-3) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .fakulte-list-card-title {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .fakulte-list-card:hover .fakulte-list-card-title {
    color: #fca5a5 !important;
}

html[data-color-mode="dark"] .fakulte-list-card-kod,
html[data-color-mode="dark"] .fakulte-list-card-kod i,
html[data-color-mode="dark"] .fakulte-stat-item {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .fakulte-list-card-icon {
    border-color: rgba(248, 113, 113, 0.35) !important;
    color: #f87171 !important;
}

/* —— Bölüm / program ağaçları —— */
html[data-color-mode="dark"] .bolum-tree-container,
html[data-color-mode="dark"] .program-tree-container {
    background: var(--kku-cm-surface) !important;
}

html[data-color-mode="dark"] .bolum-tree-list,
html[data-color-mode="dark"] .program-tree-list {
    background: var(--kku-cm-surface-2) !important;
}

html[data-color-mode="dark"] .bolum-tree-fakulte,
html[data-color-mode="dark"] .program-tree-fakulte {
    background: var(--kku-cm-surface) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .bolum-tree-item,
html[data-color-mode="dark"] .program-tree-item {
    background: var(--kku-cm-surface) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .bolum-tree-item:hover,
html[data-color-mode="dark"] .program-tree-item:hover {
    background: rgba(220, 38, 38, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.45) !important;
}

html[data-color-mode="dark"] .bolum-tree-item.is-keyboard-active,
html[data-color-mode="dark"] .bolum-tree-item.is-keyboard-active:hover {
    background: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(248, 113, 113, 0.75) !important;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

html[data-color-mode="dark"] .bolum-tree-item-title,
html[data-color-mode="dark"] .bolum-tree-item-name,
html[data-color-mode="dark"] .program-tree-item-title,
html[data-color-mode="dark"] .program-tree-item-name {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .bolum-tree-item-kod,
html[data-color-mode="dark"] .program-tree-item-kod,
html[data-color-mode="dark"] .bolum-tree-item-stats,
html[data-color-mode="dark"] .program-tree-item-stats {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .program-tree-bolum {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .program-tree-direct {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

html[data-color-mode="dark"] .program-tree-direct-header {
    color: #fbbf24 !important;
}

/* —— Etkinlik / yayın / duyuru görüntüleme modalı —— */
html[data-color-mode="dark"] .etkinlik-modal-content {
    background: var(--kku-cm-surface) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}

html[data-color-mode="dark"] .etkinlik-modal-body {
    background: var(--kku-cm-surface) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .etkinlik-modal-description,
html[data-color-mode="dark"] .etkinlik-modal-meta-section {
    color: var(--kku-cm-text-secondary) !important;
    border-bottom-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .etkinlik-modal-footer {
    background: var(--kku-cm-surface-2) !important;
    border-top-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .yayin-detay-label {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .yayin-detay-value {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .yayin-detay-ozet {
    background: var(--kku-cm-surface-2) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .duyuru-view-modal .duyuru-detay-card {
    background: var(--kku-cm-surface) !important;
}

html[data-color-mode="dark"] .duyuru-view-modal .duyuru-detay-title,
html[data-color-mode="dark"] .duyuru-view-modal .duyuru-detay-title-link {
    color: #fca5a5 !important;
}

html[data-color-mode="dark"] .duyuru-view-modal .duyuru-detay-meta,
html[data-color-mode="dark"] .duyuru-view-modal .duyuru-modal-giris {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .duyuru-view-modal .duyuru-modal-icerik {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .duyuru-view-modal .duyuru-modal-icerik a {
    color: #fca5a5 !important;
}

/* —— Paylaşım modalı —— */
html[data-color-mode="dark"] .share-modal-content {
    background: var(--kku-cm-surface) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55) !important;
}

html[data-color-mode="dark"] .share-modal-body {
    background: var(--kku-cm-surface) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .share-preview-card {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

html[data-color-mode="dark"] .share-card-content {
    background: var(--kku-cm-surface) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .share-card-title {
    color: #fca5a5 !important;
}

html[data-color-mode="dark"] .share-card-description {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .meta-item {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .share-card-footer {
    border-top-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .share-card-website {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .share-card-cta {
    color: #fca5a5 !important;
}

html[data-color-mode="dark"] .share-options h4,
html[data-color-mode="dark"] .share-text-preview h4 {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .share-text-preview {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .share-text-content {
    background: var(--kku-cm-surface-3) !important;
    border-color: var(--kku-cm-border) !important;
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .share-text-formatted,
html[data-color-mode="dark"] .share-text-formatted .text-section {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .share-text-formatted strong {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .share-text-formatted em {
    color: var(--kku-cm-text-muted) !important;
}

/* —— Personel biyografi modalı —— */
html[data-color-mode="dark"] .personel-biyografi-modal-content {
    background: var(--kku-cm-surface) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}

html[data-color-mode="dark"] .personel-biyografi-modal-header {
    border-bottom-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .personel-biyografi-modal-title {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .personel-biyografi-modal-close {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .personel-biyografi-modal-close:hover {
    background: var(--kku-cm-surface-2) !important;
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .personel-biyografi-modal-body,
html[data-color-mode="dark"] .personel-biyografi-modal-body p {
    color: var(--kku-cm-text-secondary) !important;
}

/* —— Öğrenci istatistik modal grafik panelleri —— */
html[data-color-mode="dark"] #stats-modal.stats-modal-rich .kku-modal-body {
    background: linear-gradient(180deg, var(--kku-cm-surface-2) 0%, var(--kku-cm-surface) 28%) !important;
}

/* İstatistik modal sekmeleri — dark: track + aktif kırmızı net */
html[data-color-mode="dark"] #stats-modal .stats-modal-tab-nav {
    background: #1a2332 !important;
    border-color: #3d4f66 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

html[data-color-mode="dark"] #stats-modal .stats-modal-tab-btn {
    color: #c5d0de !important;
    background: transparent !important;
    border-color: transparent !important;
}

html[data-color-mode="dark"] #stats-modal .stats-modal-tab-btn:hover {
    color: #f3f6fb !important;
    background: #243044 !important;
    border-color: #4a5d77 !important;
}

html[data-color-mode="dark"] #stats-modal .stats-modal-tab-btn.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #E30613 0%, #c0141c 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 10px rgba(227, 6, 19, 0.45) !important;
}

html[data-color-mode="dark"] #stats-modal .stats-modal-tab-btn:focus-visible {
    outline-color: #f87171 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-chart-panel {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .stats-ogrenci-chart-panel__title {
    color: var(--kku-cm-text) !important;
}

html[data-color-mode="dark"] .stats-ogrenci-chart-panel__legend,
html[data-color-mode="dark"] .stats-ogrenci-chart-panel__map-foot {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stats-ogrenci-chart-panel__chart--map {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-legend {
    color: #e2e8f0 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-legend-hint {
    color: #94a3b8 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip strong {
    color: #94a3b8 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip--erkek {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
    color: #93c5fd !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip--erkek strong {
    color: #bfdbfe !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip--kadin {
    background: rgba(236, 72, 153, 0.16) !important;
    border-color: rgba(244, 114, 182, 0.4) !important;
    color: #f9a8d4 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-map-summary__chip--kadin strong {
    color: #fbcfe8 !important;
}

html[data-color-mode="dark"] .stats-ogrenci-chart-panel__legend strong {
    color: var(--kku-cm-text-secondary) !important;
}

html[data-color-mode="dark"] .stat-modal-search-results {
    background: var(--kku-cm-surface-2) !important;
    border-color: var(--kku-cm-border) !important;
}

html[data-color-mode="dark"] .stat-modal-search-empty {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .stat-modal-search-sort option {
    color: var(--kku-cm-text) !important;
    background: var(--kku-cm-surface) !important;
}

html[data-color-mode="dark"] .stat-modal-search-footer .btn-outline-primary {
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, 0.45) !important;
    background: rgba(220, 38, 38, 0.12) !important;
}

html[data-color-mode="dark"] .stat-modal-search-footer .btn-outline-primary:hover {
    color: #fff !important;
    border-color: rgba(248, 113, 113, 0.65) !important;
    background: rgba(220, 38, 38, 0.28) !important;
}

html[data-color-mode="dark"] .stat-modal-search-item .bolum-tree-item-subtitle {
    color: var(--kku-cm-text-muted) !important;
}

html[data-color-mode="dark"] .modal-list-badge--tur {
    background: rgba(96, 165, 250, 0.14) !important;
    color: #93c5fd !important;
    border-color: rgba(96, 165, 250, 0.28) !important;
}

html[data-color-mode="dark"] .modal-list-badge--year {
    background: rgba(148, 163, 184, 0.14) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-color-mode="dark"] .modal-list-badge--atif {
    background: rgba(251, 146, 60, 0.14) !important;
    color: #fdba74 !important;
    border-color: rgba(251, 146, 60, 0.28) !important;
}

html[data-color-mode="dark"] .modal-list-badge--info {
    background: rgba(156, 163, 175, 0.12) !important;
    color: #d1d5db !important;
    border-color: rgba(156, 163, 175, 0.24) !important;
}

html[data-color-mode="dark"] #ogrenci-map-back-btn,
html[data-color-mode="dark"] #uluslararasi-map-back-btn {
    background: var(--kku-cm-surface-3) !important;
    color: var(--kku-cm-text-secondary) !important;
    border: 1px solid var(--kku-cm-border) !important;
}
