/* ==========================================================================
   BOZKURT ORTAOKULU - ÖĞRETMEN PANELİ STİLLERİ
   v6.3 - Grafik modalı için kapsamlı stiller eklendi.
   ========================================================================== */

/* === Panel Ana Yapısı === */
.panel {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  margin-top: 15px;
}

.student-list, .exam-list {
  flex: 1;
  min-width: 0;
}

/* === Liste Başlıkları === */
.student-list h3, .exam-list h3 {
    margin-bottom: 15px;
}

/* === Sınıf Ortalaması Gösterge Kutusu === */
#classAverageContainer {
    margin-top: 20px;
    margin-bottom: -20px;
}
.class-average-box {
    background: linear-gradient(135deg, #ca2323, #cc1616cc);
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(230, 47, 47, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.class-average-box .label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    display: block;
}
.class-average-box .score {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.class-average-box.clickable {
    cursor: pointer;
}
.class-average-box.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 47, 47, 0.6);
}

/* === Öğrenci ve Sınav Kartları Tasarımı === */
.student, .exam {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid #e9ecef;
  background-color: #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.student:hover, .exam:hover {
  box-shadow: 0 7px 14px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

.student.green {
  background-color: #f0fff4;
  border-left: 5px solid #28a745;
}
.student.red {
  background-color: #fff5f5;
  border-left: 5px solid #dc3545;
}
.student.gray {
  background-color: #f8f9fa;
  border-left: 5px solid #6c757d;
}

.exam {
  background-color: #fffcf5;
  border-left: 5px solid #ffc107;
}

.student-name, .exam-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #343a40;
  text-align: center;
  margin-bottom: 8px;
}

.student-details {
  display: flex;
  align-items: center;
  width: 100%;
}

.student.gray .student-details .student-info {
  width: 100%;
  text-align: center;
}

.student-info.rank {
  flex: 1;
  text-align: left;
  font-weight: 600;
  color: #495057;
}

.star-rating {
  flex: 2;
  text-align: center;
  font-size: 1.2rem;
  color: #ffc107;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.student-info.score {
  flex: 1;
  text-align: right;
  font-size: 0.9rem;
  color: #6c757d;
}


.exam-details {
  margin-top: 8px;
}

.exam-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-arrow {
  font-weight: bold;
  margin-left: 4px;
}
.trend-arrow.up { color: #28a745; }
.trend-arrow.down { color: #dc3545; }

.exam {
  position: relative;
  overflow: hidden;
}
.exam.latest-exam::before {
  content: "GÜNCEL";
  position: absolute;
  top: 8px;
  right: -25px;
  background: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 30px;
  transform: rotate(45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* === YENİ EKLENEN BÖLÜM: GRAFİK MODALI STİLLERİ === */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
    -webkit-animation-name: fadeIn;
    animation-name: fadeIn;
    -webkit-animation-duration: 0.4s;
    animation-duration: 0.4s;
}

.modal-icerik {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px; /* Genişlik için */
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    -webkit-animation-name: slideIn;
    animation-name: slideIn;
    -webkit-animation-duration: 0.4s;
    animation-duration: 0.4s
}

.kapat-dugme {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.kapat-dugme:hover,
.kapat-dugme:focus {
    color: black;
    text-decoration: none;
}

#modalDersAdi {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
    line-height: 1.4;
}

#modalDersAdi .modal-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    display: block;
}

.chart-container {
    position: relative;
    height: 400px; /* Dikey genişlik için */
    width: 100%;
}

.chart-ort-bilgi {
    text-align: center;
    margin-top: 15px;
    font-size: 1rem;
    color: #555;
}

@-webkit-keyframes fadeIn { from {opacity: 0} to {opacity: 1} }
@keyframes fadeIn { from {opacity: 0} to {opacity: 1} }

@-webkit-keyframes slideIn { from {top: -300px; opacity: 0} to {top: 0; opacity: 1} }
@keyframes slideIn {
    from { margin-top: -5%; opacity: 0 }
    to { margin-top: 5%; opacity: 1 }
}


/* === Mobil ve Tablet Uyumlamaları === */
@media (max-width: 768px) {
    .modal-icerik {
        margin-top: 10%;
        padding: 15px;
        box-sizing: border-box;
    }
    .chart-container {
        height: 300px;
    }
    #modalDersAdi {
        font-size: 1.2rem;
    }
    
    .panel {
        gap: 12px;
    }
    
    .student-list, .exam-list {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .student-details {
        flex-direction: column;
        gap: 5px;
    }
    .student-name {
        margin-bottom: 10px;
        font-size: 1rem;
    }
    .student-details .star-rating { order: 1; }
    .student-details .score { order: 2; }
    .student-details .rank { order: 3; }
    
    /* Mobil modal ayarları */
    .modal-icerik {
        width: 95%;
        padding: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #modalDersAdi {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-ort-bilgi {
        font-size: 0.9rem;
    }
    
    /* Panel yanyana kalacak ama kartlar daha kompakt */
    .panel {
        flex-direction: row;
        gap: 8px;
        margin-top: 10px;
    }
    
    .student-list, .exam-list {
        flex: 1;
        min-width: 0;
    }
    
    .student, .exam {
        padding: 10px;
        margin-bottom: 6px;
        border-radius: 12px;
    }
    
    .student-name, .exam-name {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    /* Öğrenci detayları mobilde daha kompakt */
    .student-details {
        gap: 3px;
    }
    
    .student-info.rank {
        font-size: 0.85rem;
    }
    
    .star-rating {
        font-size: 1rem;
    }
    
    .student-info.score {
        font-size: 0.8rem;
    }
    
    /* Sınıf ortalaması mobilde uyumlu */
    .class-average-box {
        max-width: 90%;
        padding: 10px;
    }
    
    .class-average-box .score {
        font-size: 1.5rem;
    }
    
    .class-average-box .label {
        font-size: 0.8rem;
    }
}
