﻿/* =========================================================
   Yapay Zeka (AI) Modal ve Bileşen Stilleri
   v9.0 - Puan Tabanlı Kategori Uyarı Bantları Eklendi
   ========================================================= */

/* Modal açıkken kaydırmayı engelle */
body.modal-open, html.modal-open {
    overflow: hidden;
}

/* Modal Arka Planı */
.modal {
    display: none;
    position: fixed;
    z-index: 1050; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

/* Modal İçerik Kutusu */
.modal-icerik {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

#ai-modal .modal-icerik {
    max-height: 85vh;
    overflow-y: auto;
}

.ai-modal-heading {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-sizing: border-box;
    padding: 14px 32px;
    margin: 0 0 20px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 50%, #06b6d4 100%); /* Yeşil-Mavi gradient */
    color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
    width: fit-content;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.ai-modal-heading svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.ai-modal-heading span {
    display: inline-block;
    font-weight: 700;
    font-size: 1.05rem;
    color: inherit;
    word-spacing: 0.35em;
}

.mobile-break {
    display: none;
}

/* Kapatma Butonu */
.kapat-dugme {
    color: #999;
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 1051;
    transition: color 0.2s ease;
}

.kapat-dugme:hover,
.kapat-dugme:focus {
    color: #333;
    text-decoration: none;
}

/* Yükleme animasyonu (Spinner) */
.gemini-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c82323;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* =========================================================
   AI MODAL İÇERİK STİLLERİ
   ========================================================= */

/* =========================================================
   AI MODAL BODY - ANA KONTEYNER
   ========================================================= */
#ai-modal-body {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* =========================================================
   AI BÖLÜMLERI - BASİT, DÜZGÜN CONTAINER
   ========================================================= */
#ai-modal-body .ai-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 16px 20px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

#ai-modal-body .ai-section:nth-child(even) {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5), #ffffff);
}

#ai-modal-body .ai-section:nth-child(odd) {
    background: #ffffff;
}

/* İç içe wrapper - gerçek şekillendirme burada */
#ai-modal-body .ai-section-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), #ffffff);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

/* Tüm içerik tam genişlik */
#ai-modal-body .ai-section-wrapper > * {
    width: 100%;
    box-sizing: border-box;
}

/* Alt bölüm kartları */
#ai-modal-body .ai-subsection-card {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

#ai-modal-body .ai-subsection-card.highlight {
    background: transparent;
    border-color: transparent;
}

/* =========================================================
   AI BÖLÜM BAŞLIKLARı
   ========================================================= */
/* Force all modal section headings to be centered */
#ai-modal-body h3,
#ai-modal-body h4,
#ai-modal-body .ai-section-title {
    text-align: center !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#ai-modal-body .ai-section h4,
#ai-modal-body .ai-section-title {
    color: #0891b2;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    position: relative;
    padding: 8px 16px;
    border-radius: 999px;
    /* Yeşil-Mavi tint to match main title */
    background: rgba(16, 185, 129, 0.08);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.12);
    width: fit-content;
}

/* Highly specific overrides to ensure all headings inside subsection-cards and wrappers are centered
   Some themes or other CSS files may set headings left; these rules force-center inside the AI modal. */
#ai-modal-body .ai-subsection-card h4,
#ai-modal-body .ai-subsection-card .ai-section-title,
#ai-modal-body .ai-section-wrapper h4,
#ai-modal-body .ai-section-wrapper .ai-section-title {
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    width: auto !important;
}

/* Decorative underline (hidden by default on small headings) */
#ai-modal-body .ai-section h4::after,
#ai-modal-body .ai-section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 100%;
    max-width: 90%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #0ea5e9);
}

/* Hide underlines in kategori uyarı banners */
.ai-section-wrapper.kategori-uyari h4::after {
    display: none !important;
}

/* Rozet Sistemi başlığı stiline özel uyarı kutusu */
.ai-section-wrapper.rozet-section.kategori-risk_altinda h4,
.ai-section-wrapper.rozet-section.kategori-acil_destek h4,
.ai-section-wrapper.rozet-section.kategori-sinirda_basarili h4 {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: none !important;
}

/* Rozet Sistemi Risk Altında */
.ai-section-wrapper.rozet-section.kategori-risk_altinda h4 {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 100%);
    color: #e65100;
    border: 2px solid #ff9800;
}

/* Rozet Sistemi Acil Destek */
.ai-section-wrapper.rozet-section.kategori-acil_destek h4 {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

/* Rozet Sistemi Sınırda Başarılı */
.ai-section-wrapper.rozet-section.kategori-sinirda_basarili h4 {
    background: linear-gradient(135deg, #fffde7 0%, #fff59d 100%);
    color: #f57f17;
    border: 2px solid #fdd835;
}

/* Hide underline for Rozet Sistemi başlığı */
.ai-section-wrapper.rozet-section h4::after {
    display: none !important;
}

/* =========================================================
   NORMAL BÖLÜMLER - GRADIENT BORDER WRAPPER
   ========================================================= */

/* Normal bölümler (Genel Değerlendirme, Güçlü Yönlerin, vb.) */
.ai-section-wrapper.gradient-border {
    border: 2px solid !important;
    border-image: linear-gradient(135deg, #10b981 0%, #0ea5e9 50%, #06b6d4 100%) 1 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 24px;
    border-radius: 12px;
}

/* Normal bölüm başlıkları - kutu stili */
.ai-section-wrapper.gradient-border h4 {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #d1fae5 100%);
    color: #0e7490;
    border: 2px solid #06b6d4;
    animation: none !important;
}

/* Altındaki çizgiyi kaldır */
.ai-section-wrapper.gradient-border h4::after {
    display: none !important;
}

/* Kategori Uyarı başlıkları - kırmızı border */
.ai-section-wrapper.kategori-uyari.kategori-acil_destek h4::before {
    content: "";
    display: inline-block;
    width: 100%;
    position: absolute;
    left: 0;
    right: 0;
}

/* Kategori uyarı başlık container'ı */
.uyari-icerik h4 {
    position: relative;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: none !important;
}

/* Acil Destek başlığı - kırmızı border */
.ai-section-wrapper.kategori-uyari.kategori-acil_destek .uyari-icerik h4 {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
    color: #c62828 !important;
    border: 2px solid #f44336 !important;
    box-shadow: none !important;
}

/* Risk Altında başlığı - turuncu border */
.ai-section-wrapper.kategori-uyari.kategori-risk_altinda .uyari-icerik h4 {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 100%) !important;
    color: #e65100 !important;
    border: 2px solid #ff9800 !important;
    box-shadow: none !important;
}

/* =========================================================
   AI MODAL METİN STİLLERİ
   ========================================================= */
#ai-modal-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    font-weight: 500;
    text-align: justify;
    text-justify: inter-word;
    margin: 0 0 12px 0;
}

.bilgi-mesaji {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 20px;
    font-style: italic;
}

/* =========================================================
   YENİ: KATEGORİ UYARI BANTLARI
   ========================================================= */

.kategori-uyari {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 24px;
    border-radius: 16px;
    border: none;
    border-left: 6px solid;
    margin-bottom: 12px;
    animation: slideInAlert 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.kategori-uyari::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.kategori-uyari .uyari-ikon {
    font-size: 1.4rem;
    line-height: 1;
    display: inline;
    animation: none;
    filter: none;
    margin: 0 4px 0 0;
}

.kategori-uyari .uyari-icerik {
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kategori-uyari .uyari-icerik h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    text-transform: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ai-section-wrapper ile kategori-uyari birlikte kullanıldığında */
.ai-section-wrapper.kategori-uyari {
    padding: 24px;
    border-left: 6px solid;
    margin-bottom: 0;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.ai-section-wrapper.kategori-uyari .uyari-icerik h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    text-transform: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.kategori-uyari .uyari-icerik p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    text-align: center;
    font-weight: 500;
    width: 100%;
}

/* Risk Altında - Turuncu Tema */
.kategori-uyari.kategori-risk_altinda,
.ai-section-wrapper.kategori-uyari.kategori-risk_altinda {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 50%, #ffcc80 100%) !important;
    border: 2px solid #ff9800 !important;
    box-shadow: 0 12px 32px rgba(255, 152, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.kategori-uyari.kategori-risk_altinda .uyari-icerik h4,
.ai-section-wrapper.kategori-uyari.kategori-risk_altinda .uyari-icerik h4 {
    color: #e65100 !important;
    background: rgba(255, 152, 0, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 152, 0, 0.25) !important;
}

.kategori-uyari.kategori-risk_altinda .uyari-icerik p,
.ai-section-wrapper.kategori-uyari.kategori-risk_altinda .uyari-icerik p {
    color: #5d4037 !important;
}

/* Acil Destek - Kırmızı Tema */
.kategori-uyari.kategori-acil_destek,
.ai-section-wrapper.kategori-uyari.kategori-acil_destek {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 50%, #ef9a9a 100%) !important;
    border: 2px solid #f44336 !important;
    box-shadow: 0 12px 32px rgba(244, 67, 54, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.kategori-uyari.kategori-acil_destek .uyari-icerik h4,
.ai-section-wrapper.kategori-uyari.kategori-acil_destek .uyari-icerik h4 {
    color: #c62828 !important;
    background: rgba(244, 67, 54, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(244, 67, 54, 0.25) !important;
}

.kategori-uyari.kategori-acil_destek .uyari-icerik p,
.ai-section-wrapper.kategori-uyari.kategori-acil_destek .uyari-icerik p {
    color: #5d2c2c !important;
}

/* Sınırda Başarılı - Sarı Tema */
.kategori-uyari.kategori-sinirda_basarili,
.ai-section-wrapper.kategori-uyari.kategori-sinirda_basarili {
    background: linear-gradient(135deg, #fffde7 0%, #fff59d 50%, #fff176 100%) !important;
    border: 2px solid #fdd835 !important;
    box-shadow: 0 12px 32px rgba(253, 216, 53, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.kategori-uyari.kategori-sinirda_basarili .uyari-icerik h4,
.ai-section-wrapper.kategori-uyari.kategori-sinirda_basarili .uyari-icerik h4 {
    color: #f57f17 !important;
    background: rgba(253, 216, 53, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(253, 216, 53, 0.25) !important;
}

.kategori-uyari.kategori-sinirda_basarili .uyari-icerik p,
.ai-section-wrapper.kategori-uyari.kategori-sinirda_basarili .uyari-icerik p {
    color: #664d00 !important;
}

/* Uyarı İkonu Animasyonu */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.15);
        opacity: 0.9;
    }
}

/* Uyarı Bantı Giriş Animasyonu */
@keyframes slideInAlert {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   HEDEF OKUL ANALİZİ STİLLERİ
   ========================================================= */
#hedefAnalizi {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.hedef-kutu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 25px 20px;
    border-radius: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.hedef-icon {
    margin-bottom: 4px;
}

.hedef-kutu.hedef-ust .hedef-icon svg { stroke: #C70039; }
.hedef-kutu.hedef-alt .hedef-icon svg { stroke: #1E8449; }
.hedef-kutu.hedef-tebrik .hedef-icon svg { stroke: #007bff; }


.hedef-kutu-baslik,
.okul-adi,
.hedef-puan {
    text-align: center;
}

.hedef-kutu-baslik {
    font-weight: bold;
    font-size: 1.2rem;
    color: #343a40;
}

.hedef-kutu.hedef-tebrik .hedef-kutu-baslik {
    color: #007bff;
}

.okul-adi {
    font-weight: bold;
    font-size: 1.2rem;
    color: #495057;
    margin: 0;
}

#hedefAnalizi .aciklama {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    text-align: center;
    width: 100%;
    margin-top: 4px;
    margin-bottom: 4px;
}

.aciklama strong {
    color: #212529;
}

.hedef-puan {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.hedef-kutu.hedef-tebrik {
    background-color: #e7f5ff;
    border-color: #b3dfff;
}

/* =========================================================
   ROZETLER BÖLÜMÜ STİLLERİ
   ========================================================= */
#ai-modal-body .rozet-section { 
  padding: 0.75rem 0.5rem;
  margin-bottom: 15px;
}

/* Düşük Performanslı Öğrenciler için Rozet Bölümü Özel Stili */
#ai-modal-body .rozet-section.kategori-risk_altinda,
#ai-modal-body .rozet-section.kategori-acil_destek {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 1.5rem;
}

#ai-modal-body .rozet-section.kategori-acil_destek {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    border-color: #d32f2f;
}

#ai-modal-body .rozet-section.kategori-risk_altinda h4,
#ai-modal-body .rozet-section.kategori-acil_destek h4 {
    color: #d32f2f;
}

#ai-modal-body .rozet-section.kategori-risk_altinda p,
#ai-modal-body .rozet-section.kategori-acil_destek p {
    color: #4e342e;
    font-weight: 500;
    font-size: 1rem;
}

#ai-modal-body .rozetler-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1rem;
  row-gap: 1rem;
  margin: 0.75rem 0 1rem 0;
  grid-auto-rows: auto;
}

#ai-modal-body .rozet-item {
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 0.4rem;
  border-radius: 8px;
  transition: background 0.2s ease;
  height: auto;
  min-height: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
#ai-modal-body .rozet-item:hover { background: #f1f3f5; }

#ai-modal-body .rozet-baslik-grup {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
}

#ai-modal-body .rozet-emoji {
  font-size: 1.2rem;
  line-height: 1;
  margin-right: 0.5rem;
}

#ai-modal-body .rozet-baslik {
  color: #343a40;
  font-size: 0.95rem;
  font-weight: 600;
}

#ai-modal-body .rozet-aciklama {
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

#ai-modal-body .rozet-section p {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-style: italic;
  text-align: center;
}

/* =========================================================
   ÖNE ÇIKAN ÖĞRENCİ GRUPLARI STİLLERİ
   ========================================================= */

.student-groups-section {
    padding-top: 4px;
}

.student-groups-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.student-group-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.6), #ffffff);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.student-group-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    border: 1px solid transparent;
    transition: border-color 0.25s ease;
}

.student-group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.student-group-card:hover::after {
    border-color: rgba(15, 23, 42, 0.18);
}

.student-group-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.student-group-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.group-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.student-group-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.student-group-titles .group-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kategori-spesifik başlık renkleri */
.student-group-card.kategori-yuksek_performans .group-title {
    color: #0e7490;
}

.student-group-card.kategori-iyi_performans .group-title {
    color: #1e40af;
}

.student-group-card.kategori-guvenli_bolge .group-title {
    color: #047857;
}

.student-group-card.kategori-sinirda_basarili .group-title {
    color: #b45309;
}

.student-group-card.kategori-risk_altinda .group-title {
    color: #b91c1c;
}

.student-group-card.kategori-acil_destek .group-title {
    color: #c41f3b;
}

.student-group-titles .group-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.35;
}

.student-group-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.student-group-card-meta .meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: rgba(148, 163, 184, 0.18);
}

.student-group-card-meta .meta-pill.average {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.student-group-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.student-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.45);
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    width: 100%;
    box-sizing: border-box;
}

.student-chip-rank {
    font-weight: 700;
    color: #0f172a;
}

.student-chip-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-chip-trend {
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.student-chip-badges {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
}

.student-chip-badge {
    font-size: 0.9rem;
    display: inline-flex;
}

.student-group-card-empty {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.student-group-card[data-group-key="YUKSEK_PERFORMANS"],
.student-group-card.kategori-yuksek_performans {
    background: linear-gradient(135deg, #e0f2fe 0%, #d1fae5 100%);
    border: 2px solid #06b6d4;
}

.student-group-card[data-group-key="IYI_PERFORMANS"],
.student-group-card.kategori-iyi_performans {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 2px solid #3b82f6;
}

.student-group-card[data-group-key="GUVENLI_BOLGE"],
.student-group-card.kategori-guvenli_bolge {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
    border: 2px solid #10b981;
}

.student-group-card[data-group-key="SINIRDA_BASARILI"],
.student-group-card.kategori-sinirda_basarili {
    background: linear-gradient(135deg, #fffde7 0%, #fff59d 100%);
    border: 2px solid #fdd835;
}

.student-group-card[data-group-key="RISK_ALTINDA"],
.student-group-card.kategori-risk_altinda {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
}

.student-group-card[data-group-key="ACIL_DESTEK"],
.student-group-card.kategori-acil_destek {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #f44336;
}

.student-group {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.student-group-title {
    margin-bottom: 12px;
}

.student-group-title .main-title {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #343a40;
}

.student-group-title .sub-title {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

.student-group-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 5px;
    justify-content: center;
}

.student-list-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

/* Her grup için farklı renk teması */
.student-group[data-group-type="Performans Artışı Gösterenler"] .student-list-chip {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #a3cfbb;
}

.student-group[data-group-type="Performans Düşüşü Gözlemlenenler"] .student-list-chip {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.student-group[data-group-type="Akademik Liderler"] .student-list-chip {
    background-color: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

.student-group[data-group-type="Öncelikli Destek Grubu"] .student-list-chip {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

/* =========================================================
   KRİTİKLER BÖLÜMÜ STİLİ
   ========================================================= */

.critical-insights p {
    margin: 0 0 12px;
    color: #1f2937;
    line-height: 1.65;
}

.critical-insights p:last-child {
    margin-bottom: 0;
}

.recommendations-container .recommendation-item {
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1em;
    padding: 12px 14px;
    line-height: 1.7;
    border-radius: 8px;
    border-left: 4px solid #cbd5e1;
    background: #f8fafc;
}

.recommendations-container .recommendation-item.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.3), rgba(255, 231, 181, 0.2));
}

.recommendations-container .recommendation-item.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(209, 250, 229, 0.3), rgba(167, 243, 208, 0.2));
}

.recommendations-container .recommendation-item.critical {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.3), rgba(252, 165, 165, 0.2));
}

.recommendations-container .recommendation-item:last-child {
    margin-bottom: 0;
}


/* =========================================================
   MOBİL UYUMLULUK VE ANİMASYONLAR
   ========================================================= */

@media screen and (max-width: 768px) {
  .modal-icerik {
    width: 92%;
    margin: 10% auto;
    padding: 15px;
    box-sizing: border-box;
  }
  #ai-modal .modal-icerik {
      max-height: 80vh;
      overflow-y: auto;
  }
  h1, h2, h3, h4 {
    font-size: 1.15rem;
  }
  .ai-modal-heading {
    font-size: 1.2rem;
  }
  .distribution-bar-label-group {
    min-width: 80px;
  }
  .distribution-bar-category {
    font-size: 0.64rem;
    padding: 2px 4px;
  }
  #ai-modal-body .ai-section h4,
  .ai-section-title {
    font-size: 1.3rem;
  }
  
  /* Mobil: AI bölümleri */
  #ai-modal-body .ai-section {
    padding: 12px;
  }
  
  #ai-modal-body .ai-section-wrapper {
    padding: 16px 14px;
    border-radius: 12px;
  }
  
  /* Grafikler tablet'te kompakt */
  .distribution-visuals {
    gap: 14px;
  }

  .distribution-boxplot {
    padding: 50px 14px 32px;
  }

  .distribution-curve-card {
    padding: 12px 14px;
  }

  .distribution-histogram {
    gap: 8px;
  }

  .distribution-bar-label-group {
    min-width: 90px;
  }

  .student-groups-grid {
    grid-template-columns: 1fr;
  }
  .student-group-card {
    padding: 16px 18px;
  }
  .student-chip {
    font-size: 0.82rem;
  }
  
  /* Mobilde Kategori Uyarıları */
  .kategori-uyari {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    text-align: center;
  }
  
  .kategori-uyari .uyari-ikon {
    font-size: 2rem;
  }
  
  .kategori-uyari .uyari-icerik h4 {
    text-align: center !important;
    justify-content: center;
  }
  
  .kategori-uyari .uyari-icerik p {
    text-align: center;
  }
  
  /* Mobilde Rozetler Tek Sütun */
  #ai-modal-body .rozetler-container {
    grid-template-columns: 1fr;
  }
  
  /* Mobil: Trend */
  .trend-container {
    gap: 12px;
  }
  
  .trend-history-items {
    margin-top: 8px;
  }
  
  .trend-year-card {
    flex: 1 1 70px;
    min-width: 70px;
  }
}

/* Çok küçük mobil ekranlar (480px ve altı) */
@media screen and (max-width: 480px) {
  .modal-icerik {
    width: 95%;
    margin: 15% auto;
    padding: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }

  #ai-modal-body {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  /* AI bölümleri mobilde daha kompakt padding */
  #ai-modal-body .ai-section {
    padding: 8px 12px;
  }

  .ai-modal-heading {
    font-size: 0.95rem;
    padding: 10px 16px;
    gap: 8px;
    margin: 0 0 15px 0;
    flex-wrap: wrap;
    width: auto;
    max-width: 100%;
  }

  .ai-modal-heading svg {
    width: 18px;
    height: 18px;
  }

  .ai-modal-heading span {
    font-size: 0.9rem;
    white-space: normal;
    display: block;
    max-width: 220px;
    margin: 0 auto;
    text-transform: uppercase;
    word-spacing: normal;
  }

  .mobile-break {
    display: block;
  }

  /* AI section wrapper mobilde kompakt */
  #ai-modal-body .ai-section-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin: 0;
    box-sizing: border-box;
    border-radius: 10px;
    gap: 10px;
  }

  /* Gradient border wrapper'ı mobilde daha geniş */
  #ai-modal-body .ai-section-wrapper.gradient-border {
    padding: 12px;
    border-radius: 10px;
  }

  /* ai-subsection-card mobilde görünmez */
  #ai-modal-body .ai-subsection-card {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* İçerik tam genişlik ve overflow yok */
  #ai-modal-body .ai-section-wrapper > * {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
  }

  #ai-modal-body .ai-subsection-card {
    padding: 10px;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* Kategorı uyarıları mobilde daha kompakt */
  .kategori-uyari {
    padding: 12px;
    gap: 0.5rem;
    margin-bottom: 12px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .kategori-uyari .uyari-ikon {
    font-size: 1.8rem;
    flex-shrink: 0;
  }

  .kategori-uyari .uyari-icerik {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .kategori-uyari .uyari-icerik h4 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    padding: 6px 12px;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
  }

  .kategori-uyari .uyari-icerik p {
    font-size: 0.95rem;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Yazı boyutları mobilde */
  #ai-modal-body h4 {
    font-size: 1rem;
  }

  #ai-modal-body h3 {
    font-size: 1.1rem;
  }

  /* Rozet yazı boyutları mobilde */
  #ai-modal-body .rozet-baslik {
    font-size: 0.9rem;
  }

  #ai-modal-body .rozet-aciklama {
    font-size: 0.8rem;
  }

  #ai-modal-body .rozet-section p {
    font-size: 0.85rem;
  }

  /* Strong metinler mobilde */
  #ai-modal-body strong {
    font-weight: 600;
    font-size: 0.9rem;
  }

  /* Bilgi mesajı mobilde */
  .bilgi-mesaji {
    font-size: 0.85rem;
    padding: 12px;
  }

  /* Başlıklar mobilde ufalt */
  h1 { font-size: 1.1rem; }
  h2 { font-size: 1rem; }
  h3 { font-size: 0.95rem; }

  /* Rozetler mobilde tek sütun */
  #ai-modal-body .rozetler-container {
    grid-template-columns: 1fr;
    gap: 10px;
    row-gap: 5px;
    margin: 0.5rem 0;
    grid-auto-rows: auto;
  }

  #ai-modal-body .rozet-item {
    padding: 8px;
    margin-bottom: 8px;
    height: auto;
    min-height: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Hedef analizi mobilde daha dar */
  #hedefAnalizi {
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
  }

  .hedef-kutu {
    padding: 15px;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .hedef-kutu-baslik {
    font-size: 1rem;
  }

  .okul-adi {
    font-size: 1rem;
    word-break: break-word;
  }

  /* Öğrenci grupları mobilde tek sütun */
  .student-groups-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .student-group-card {
    padding: 12px;
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .student-group-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .student-group-titles {
    min-width: 0;
    width: 100%;
  }
  
  .group-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .student-group-titles .group-title {
    font-size: 0.95rem;
    word-break: break-word;
  }

  .student-group-titles .group-description {
    font-size: 0.85rem;
  }

  /* Öğrenci grubu yazı boyutları mobilde */
  .student-group-emoji {
    font-size: 1.3rem;
  }

  .student-chip {
    font-size: 0.8rem;
  }

  .student-group-container {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .student-list-chip {
    font-size: 0.85rem;
    padding: 5px 10px;
    white-space: normal;
    word-break: break-word;
  }

  /* Trend bölümü mobilde daha kompakt */
  .trend-container {
    gap: 8px;
    padding: 0 5px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .trend-year-card {
    flex: 1 1 60px;
    min-width: 60px;
    padding: 8px 4px;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.8rem;
  }

  .trend-history-items {
    font-size: 0.85rem;
  }

  .trend-history-items p {
    font-size: 0.85rem;
  }

  /* Grafik bölümleri mobilde genişletildi */
  .distribution-visuals {
    gap: 12px;
  }

  .distribution-boxplot {
    padding: 50px 12px 32px;
    border-radius: 10px;
    margin: 0;
  }

  .distribution-track {
    height: 14px;
  }

  .distribution-marker {
    top: 35px;
  }

  .distribution-marker.marker-min,
  .distribution-marker.marker-max,
  .distribution-marker.marker-median {
    left: clamp(8%, var(--marker-pos, 50%), 92%);
  }

  .distribution-marker .label {
    font-size: 0.65rem;
    max-width: 65px;
    padding: 3px 5px;
  }

  .distribution-marker .value {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .distribution-curve-card {
    padding: 10px 12px;
    border-radius: 10px;
    gap: 10px;
  }

  .distribution-curve-canvas {
    min-height: 200px;
  }

  .distribution-curve-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .distribution-curve-title {
    font-size: 0.95rem;
    font-weight: 700;
  }

  .distribution-curve-subtitle {
    font-size: 0.8rem;
  }

  .distribution-curve-legend {
    gap: 10px;
    font-size: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .distribution-curve-legend .legend-item {
    gap: 4px;
  }

  .distribution-curve-legend .legend-item .dot {
    width: 8px;
    height: 8px;
  }

  .distribution-histogram {
    gap: 8px;
  }

  .distribution-histogram-title {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .distribution-bar-label-group {
    min-width: 70px;
    gap: 3px;
  }

  .distribution-note {
    font-size: 0.8rem;
    padding: 8px 10px;
    text-align: center;
  }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================================
   Geçmiş Yıl Trendleri Bölümü Stilleri
   ========================================================= */

.distribution-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.distribution-visuals {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.distribution-boxplot {
    position: relative;
    padding: 58px 18px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.distribution-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Sol ve sağ dolgu (medyandan kaç öğrenci düşük/yüksek göstermek için) */
.distribution-fill {
    height: 12px;
    border-radius: 999px;
    pointer-events: none;
    flex-shrink: 0;
}

.distribution-fill-left {
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
    opacity: 0.85;
    width: var(--left-fill, 25%);
}

.distribution-fill-right {
    background: linear-gradient(90deg, #10b981, #34d399);
    opacity: 0.85;
    width: var(--right-fill, 25%);
}

/* Medyanı sabit ortada tutan container */
.distribution-boxplot.centered-median .distribution-median {
    left: 50%;
}

.distribution-median {
    position: absolute;
    top: calc(50% - 5px);
    height: 28px;
    width: 3px;
    border-radius: 2px;
    background: #f97316;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.distribution-marker {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    top: 54px;
    left: var(--marker-pos, 50%);
    transform: translate(-50%, -150%);
    width: max-content;
    max-width: 120px;
}

.distribution-marker .label {
    font-size: 0.7rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: normal;
    max-width: 72px;
    text-align: center;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 6px;
    border-radius: 4px;
    order: -1;
}

.distribution-marker .value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 0;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.distribution-marker.marker-min,
.distribution-marker.marker-max {
    left: clamp(6%, var(--marker-pos, 50%), 92%);
}

.distribution-marker.marker-min .label {
    background: #dc2626;
}

.distribution-marker.marker-min .value {
    color: #dc2626;
}

.distribution-marker.marker-max .label {
    background: #059669;
}

.distribution-marker.marker-max .value {
    color: #059669;
}

.distribution-marker.marker-median {
    left: clamp(15%, var(--marker-pos, 50%), 85%);
}

.distribution-marker.marker-median .label {
    background: #f59e0b;
    color: #ffffff;
}

.distribution-marker.marker-median .value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f59e0b;
    line-height: 0;
}





.distribution-summary-item .summary-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 6px;
}

.distribution-summary-item .summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.distribution-note {
    font-size: 0.82rem;
    color: #475569;
    background: #fff7ec;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 14px;
}

.distribution-histogram {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.distribution-histogram-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #12425a;
    padding: 4px 10px;
}

.distribution-bar-label-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 110px;
}

.distribution-bar-label {
    font-size: 0.85rem;
    color: #334155;
    font-weight: 600;
}

.distribution-bar-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: rgba(255,255,255,0.5);
    align-self: flex-start;
}

.distribution-bar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.distribution-bar-fill {
    flex: 1;
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.distribution-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--fill-percent, 0%);
    max-width: 100%;
    border-radius: inherit;
    background: var(--category-color, #2563eb);
}

.distribution-bar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 90px;
}

.distribution-bar-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f2937;
}

.distribution-bar-percent {
    font-size: 0.72rem;
    color: #64748b;
}

.distribution-curve-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.distribution-curve-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.distribution-curve-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #12425a;
    background: rgba(125, 211, 252, 0.25);
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 999px;
    padding: 4px 10px;
}

.distribution-curve-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #12425a;
    background: rgba(125, 211, 252, 0.25);
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 999px;
    padding: 4px 10px;
}

.distribution-curve-canvas {
    position: relative;
    height: 220px;
}

.distribution-curve-canvas canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.distribution-curve-legend {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: #0f172a;
    font-weight: 600;
    flex: 1 1 auto;
    justify-content: center;
    min-width: max-content;
}

.distribution-curve-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.distribution-curve-legend .legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.distribution-curve-legend .legend-mean .dot {
    background: #2563eb;
    border: 2px solid rgba(37, 99, 235, 0.35);
}

.distribution-curve-legend .legend-median .dot {
    background: #f97316;
    border: 2px solid rgba(249, 115, 22, 0.3);
}

@media (max-width: 600px) {
    .distribution-boxplot {
        padding: 48px 14px 26px;
    }

    .distribution-marker {
        top: 40px;
    }

    .distribution-marker.marker-min,
    .distribution-marker.marker-max,
    .distribution-marker.marker-median {
        left: clamp(10%, var(--marker-pos, 50%), 90%);
    }

    .distribution-marker .label {
        font-size: 0.6rem;
        max-width: 60px;
        padding: 3px 4px;
    }

    .distribution-marker .value {
        font-size: 0.82rem;
    }

    
    .distribution-curve-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .distribution-curve-canvas {
        height: 200px;
    }

    .distribution-curve-legend {
        gap: 12px;
        padding: 6px 12px;
        font-size: 0.72rem;
    }

    .distribution-bar {
        gap: 10px;
    }

    .distribution-bar-label {
        min-width: 70px;
        font-size: 0.8rem;
    }

    .distribution-bar-meta {
        min-width: 70px;
    }
}

/* =========================================================
   Gecmis Yil Trendleri Bölümü Stilleri
   ========================================================= */

.trend-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.trend-graph-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.trend-text-section {
    width: 100%;
    text-align: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.trend-change-sentence {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.trend-sparkline-section {
    flex: 0 1 auto;
    min-width: 240px;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.trend-history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 0 0;
    padding: 0;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.trend-card .trend-change-sentence {
    font-size: 1rem;
    font-weight: 600;
}

.trend-year-card {
    flex: 1 1 85px;
    min-width: 75px;
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
    box-sizing: border-box;
    margin: 0;
}

.trend-year-card.down {
    border-color: #b91c1c;
    background: #fff5f5;
}

.trend-year-card.up {
    border-color: #047857;
    background: #f0fdf4;
}

.trend-year-label {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 4px 0;
    padding: 0;
}

.trend-year-card.down .trend-year-label {
    color: #7f1d1d;
}

.trend-year-card.up .trend-year-label {
    color: #166534;
}

.trend-year-value {
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    padding: 0;
}

@media screen and (max-width: 768px) {
    .trend-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .trend-graph-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .trend-text-section,
    .trend-sparkline-section {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .trend-history-items {
        gap: 8px;
        margin-top: 0;
    }
    
    .trend-year-card {
        flex: 1 1 70px;
        min-width: 70px;
        padding: 6px;
    }
    
    .trend-year-label {
        font-size: 0.7rem;
    }
    
    .trend-year-value {
        font-size: 0.9rem;
    }
}

