/*
Theme Name: Öğrenci Bilgi Sistemi (ÜBS)
Theme URI: https://example.com
Author: UBS Team
Description: Üniversite Öğrenci Bilgi Sistemi - Kapsamlı yönetim teması
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: ubs-theme
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a3a6b;
  --primary-light: #2d5aa0;
  --secondary: #e8a020;
  --accent: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c9a;
  --border: #dde3ea;
  --shadow: 0 2px 12px rgba(26,58,107,0.10);
  --shadow-lg: 0 8px 32px rgba(26,58,107,0.15);
  --radius: 12px;
  --radius-sm: 6px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ===== LAYOUT ===== */
.ubs-wrapper { display: flex; min-height: 100vh; }

.ubs-sidebar {
  width: 260px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: width 0.3s;
}

.ubs-sidebar.collapsed { width: 64px; }

.ubs-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s;
}

.ubs-main.expanded { margin-left: 64px; }

/* ===== SIDEBAR ===== */
.sidebar-logo {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--secondary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.sidebar-logo .logo-text { font-size: 18px; font-weight: 700; line-height: 1.2; }
.sidebar-logo .logo-sub { font-size: 11px; opacity: 0.7; }

.sidebar-user {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 12px;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}

.user-info .user-name { font-size: 14px; font-weight: 600; }
.user-info .user-role {
  font-size: 11px;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px; border-radius: 20px;
  display: inline-block; margin-top: 2px;
}

.sidebar-nav { padding: 10px 0; flex: 1; }

.nav-section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 14px 18px 6px;
  opacity: 0.5;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: var(--secondary); }
.nav-item .nav-icon { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--secondary);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}

/* ===== TOPBAR ===== */
.ubs-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.toggle-btn {
  background: none; border: none;
  cursor: pointer; font-size: 22px; color: var(--text-muted);
  padding: 6px; border-radius: 8px;
}
.toggle-btn:hover { background: var(--bg); color: var(--primary); }

.topbar-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.topbar-breadcrumb { font-size: 13px; color: var(--text-muted); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.notif-btn {
  position: relative; background: none; border: none;
  cursor: pointer; font-size: 20px; color: var(--text-muted);
  padding: 8px; border-radius: 8px;
}
.notif-btn:hover { background: var(--bg); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
}

/* ===== CONTENT ===== */
.ubs-content { flex: 1; padding: 28px; }

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex; align-items: center; gap: 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.green { border-left-color: var(--accent); }
.stat-card.orange { border-left-color: var(--secondary); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.purple { border-left-color: #8e44ad; }

.stat-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}

.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
.ubs-table { width: 100%; border-collapse: collapse; }
.ubs-table th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.ubs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ubs-table tr:last-child td { border-bottom: none; }
.ubs-table tr:hover td { background: rgba(26,58,107,0.02); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #d4901c; }
.btn-success { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== GRADE DISPLAY ===== */
.grade-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  flex-shrink: 0;
}
.grade-a { background: #dcfce7; color: #166534; }
.grade-b { background: #dbeafe; color: #1d4ed8; }
.grade-c { background: #ffedd5; color: #9a3412; }
.grade-d { background: #fee2e2; color: #991b1b; }
.grade-f { background: #f1f5f9; color: #64748b; }

/* ===== PROGRESS ===== */
.progress-bar {
  height: 8px; background: var(--bg);
  border-radius: 10px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.6s ease;
}
.progress-fill.green { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.progress-fill.orange { background: linear-gradient(90deg, #e8a020, #f39c12); }
.progress-fill.red { background: linear-gradient(90deg, #e74c3c, #c0392b); }

/* ===== ANNOUNCEMENTS ===== */
.announcement-card {
  border-left: 4px solid var(--primary);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.announcement-card.urgent { border-left-color: var(--danger); }
.announcement-card.info { border-left-color: var(--accent); }
.announcement-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

/* ===== COURSE CARD ===== */
.course-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.course-card-header {
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.course-code { font-size: 12px; opacity: 0.8; margin-bottom: 4px; }
.course-name { font-size: 16px; font-weight: 700; }
.course-card-body { padding: 16px; }
.course-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 12px 20px;
  background: none; border: none;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== MESSAGE ===== */
.message-list { display: flex; flex-direction: column; gap: 10px; }
.message-item {
  display: flex; gap: 12px;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.message-item:hover { border-color: var(--primary); }
.message-item.unread { border-left: 3px solid var(--primary); }
.message-body { flex: 1; }
.message-sender { font-size: 14px; font-weight: 600; }
.message-preview { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.message-time { font-size: 12px; color: var(--text-muted); }

/* ===== FILE UPLOAD ===== */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}
.file-drop:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,58,107,0.02); }
.file-drop-icon { font-size: 40px; margin-bottom: 12px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 90%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9); transition: transform 0.3s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== CALENDAR ===== */
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-header { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px; }
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.cal-day:hover { background: var(--bg); }
.cal-day.today { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.has-event::after {
  content: '';
  position: absolute; bottom: 4px;
  width: 4px; height: 4px;
  background: var(--secondary); border-radius: 50%;
}

/* ===== GRADE INPUT ===== */
.grade-input-row { display: grid; grid-template-columns: 1fr 80px 80px 80px 80px 80px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.grade-input-row input[type="number"] { text-align: center; }

/* ===== CHART ===== */
.chart-bar-wrap { display: flex; flex-direction: column; gap: 12px; }
.chart-bar-item { display: flex; align-items: center; gap: 12px; }
.chart-bar-label { width: 120px; font-size: 13px; flex-shrink: 0; }
.chart-bar-track { flex: 1; }
.chart-bar-val { width: 40px; text-align: right; font-size: 13px; font-weight: 700; color: var(--primary); }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px;
}
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .ubs-sidebar { width: 64px; }
  .sidebar-logo .logo-text, .nav-item span, .user-info, .nav-section-title, .nav-badge { display: none; }
  .ubs-main { margin-left: 64px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .ubs-sidebar { display: none; }
  .ubs-main { margin-left: 0; }
  .ubs-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grade-input-row { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== UTILITIES ===== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-small { font-size: 12px; }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.w-100 { width: 100%; }

/* ===== MÜFREDAt PRINT ===== */
@media print {
  .ubs-sidebar, .ubs-topbar, footer, .btn, .sinif-tabs, .bolum-secici,
  .muf-legend, .muf-yonetim { display: none !important; }
  .ubs-main { margin-left: 0 !important; }
  .donem-grid { grid-template-columns: 1fr 1fr; }
  .sinif-blok { display: block !important; page-break-before: always; }
  .sinif-blok:first-child { page-break-before: auto; }
  .donem-kolon { box-shadow: none; border: 1px solid #ccc; }
  .muf-header { background: #1a3a6b !important; -webkit-print-color-adjust: exact; }
}

/* ===== FAKÜLTE / BÖLÜM HIYERARŞI ===== */
.hiyerarsi-kart {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.hiyerarsi-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.hiyerarsi-header.dekan-bg { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.hiyerarsi-bolum-listesi { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hiyerarsi-bolum-kart {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.hiyerarsi-bolum-kart:hover { background: #fff; box-shadow: var(--shadow); transform: translateY(-1px); }
.hiyerarsi-bolum-kart .bolum-adi { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.hiyerarsi-bolum-kart .bolum-istatistik { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== ÖĞRENCİ KARTI ===== */
.ogrenci-profil-kart {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 24px;
}
.ogrenci-profil-avatar {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 900; flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.4);
}
.ogrenci-profil-info h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.ogrenci-profil-meta { font-size: 13px; opacity: 0.85; display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== AKTS KREDİ GÖSTERGE ===== */
.kredi-ozet-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px;
}
.kredi-ozet-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.kredi-ozet-item .deger { font-size: 26px; font-weight: 900; color: var(--primary); }
.kredi-ozet-item .etiket { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
