/* C# Form Stüdyosu — modern görünüm: Projelerim, Öğretmen Paneli ve kod ekranının üst çubuğu.
   Diğer ekranlar (editör, tasarımcı, araç kutusu, özellikler...) app.css'teki gibi kalır. */

:root {
  --brand-a: #ff8a00;
  --brand-b: #6a3df0;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --line: rgba(20, 30, 60, 0.08);
  --soft-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 24px rgba(16, 24, 40, 0.06);
  --lift-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 16px 40px rgba(16, 24, 40, 0.12);
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --surface: rgba(31, 34, 40, 0.78);
  --surface-solid: #1f2228;
  --line: rgba(255, 255, 255, 0.08);
  --soft-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
  --lift-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------ üst çubuk (Projelerim / Öğretmen Paneli) */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 62px; padding: 0 28px; gap: 22px;
  background: var(--surface); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="dark"] .topbar { background: var(--surface); }
.topbar .brand { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.topbar .brand-logo { width: 34px; height: 34px; filter: drop-shadow(0 2px 4px rgba(255, 120, 0, 0.25)); }
.topbar .topnav { gap: 2px; padding: 4px; border-radius: 12px; background: rgba(120, 130, 160, 0.08); }
.topbar .topnav a { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; transition: background .15s, color .15s; }
.topbar .topnav a:hover { background: rgba(120, 130, 160, 0.12); }
.topbar .topnav a.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
:root[data-theme="dark"] .topbar .topnav a.active { background: #2f333c; color: #fff; }
.topbar .user-chip { padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(120, 130, 160, 0.08); }
.topbar .user-chip .avatar { width: 30px; height: 30px; box-shadow: 0 0 0 2px var(--surface-solid); }
.topbar .user-chip .badge { margin-left: 0; }
.topbar .theme-btn, .topbar > .btn-ghost { border-radius: 10px; }

/* ------------------------------------------------------------------ sayfa */
.page-modern { padding: 28px 32px 56px; max-width: 1240px; }

.hero {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 30px 32px; margin-bottom: 26px; border-radius: 22px; color: #fff;
  background:
    radial-gradient(900px 300px at 100% 0%, rgba(255, 170, 60, 0.55), transparent 60%),
    radial-gradient(600px 300px at 0% 100%, rgba(80, 160, 255, 0.35), transparent 60%),
    linear-gradient(120deg, #4b2bd0 0%, #6a3df0 45%, #8a3fd8 75%, #d8571e 130%);
  box-shadow: 0 18px 40px rgba(90, 50, 220, 0.25);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent 30%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero-teacher {
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(40, 210, 170, 0.45), transparent 60%),
    linear-gradient(120deg, #0f4c81 0%, #1769aa 50%, #3a49c9 100%);
  box-shadow: 0 18px 40px rgba(20, 90, 170, 0.25);
}
.hero-text { position: relative; z-index: 1; min-width: 0; max-width: 680px; }
.hero-kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); margin-bottom: 10px; }
.hero h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.hero p { margin: 0; color: rgba(255,255,255,.85); font-size: 14.5px; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; text-decoration: none; border: 1px solid rgba(255,255,255,.2); }
.stat-chip b { font-weight: 700; }
.stat-chip.link { background: rgba(255,255,255,.95); color: #3b25a8; font-weight: 600; border-color: transparent; transition: transform .15s; }
.stat-chip.link:hover { transform: translateY(-1px); }
.hero .btn { border-radius: 12px; }
.hero .btn-cta { background: #fff; color: #4b2bd0; border-color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.hero .btn-cta:hover { background: #f4f0ff; }
.hero .btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-glass:hover { background: rgba(255,255,255,.24); }

/* liste başlığı: ara + sırala */
.list-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.list-bar h2 { margin: 0; font-family: var(--font-display); font-size: 20px; letter-spacing: -0.01em; }
.page-modern .input { height: 38px; border-radius: 10px; background: var(--surface-solid); }
.search-input { min-width: 240px; padding-left: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23889' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: 11px center !important; }

/* ------------------------------------------------------------------ proje kartları */
.page-modern .project-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.page-modern .project-card {
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--soft-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.page-modern .project-card:hover { transform: translateY(-3px); box-shadow: var(--lift-shadow); border-color: rgba(106, 61, 240, 0.35); }
.page-modern .project-thumb { position: relative; height: 132px; margin: 8px 8px 0; border-radius: 13px; overflow: hidden; background-color: #6a3df0; }
.page-modern .project-thumb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.35), transparent 55%); }
.page-modern .mini-window {
  position: relative; width: 132px; height: 86px; border: 0; border-radius: 7px; overflow: hidden; background: #f3f4f7;
  box-shadow: 0 10px 24px rgba(0,0,0,.25); transition: transform .25s ease;
}
.page-modern .project-card:hover .mini-window { transform: translateY(-3px) rotate(-1.5deg) scale(1.03); }
.page-modern .mini-title { height: 14px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; padding: 0 5px; background: #fff; border-bottom: 1px solid #e3e6ee; }
.page-modern .mini-title i { width: 5px; height: 5px; border-radius: 50%; background: #c8cdd8; }
.page-modern .mini-title i:last-child { background: #ff6159; }
.page-modern .mini-body { padding: 9px; gap: 6px; }
.page-modern .mini-body i { height: 9px; border-radius: 3px; border-color: #cdd2dc; }
.page-modern .mini-body b { height: 12px; width: 44%; border-radius: 3px; border: 0; background: linear-gradient(90deg, #ff8a00, #ffb347); }
.page-modern .project-info { padding: 14px 16px 2px; }
.page-modern .project-name { font-size: 15.5px; letter-spacing: -0.01em; }
.page-modern .project-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dot-time::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3cc47a; margin-right: 6px; vertical-align: 1px; }
.meta-sep { opacity: .5; }
.page-modern .note-badge { border-radius: 999px; padding: 3px 10px; margin-top: 8px; }
.page-modern .project-actions { align-items: center; padding: 12px 16px 16px; gap: 8px; flex-wrap: nowrap; }
.page-modern .project-actions .btn { border-radius: 10px; height: 32px; }
.page-modern .btn-open { padding: 0 18px; font-weight: 600; }
.btn-icon { width: 32px; padding: 0 !important; font-size: 18px; line-height: 1; }
.page-modern .project-card.skeleton { height: 248px; background: linear-gradient(100deg, var(--surface-solid) 30%, rgba(120,130,160,.10) 50%, var(--surface-solid) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.page-modern .empty { border-radius: 18px; background: var(--surface-solid); }

.pop-menu { min-width: 200px; padding: 6px; border-radius: 12px; box-shadow: var(--lift-shadow); display: flex; flex-direction: column; animation: pop .12s ease-out; }
.pop-menu .ide-dd-item { text-align: left; border-radius: 8px; padding: 8px 10px; }
.pop-menu .ide-dd-item.danger { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ öğretmen paneli */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: -8px 0 22px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; background: rgba(106, 61, 240, 0.1); }
.stat-card:nth-child(2) .stat-ico { background: rgba(255, 138, 0, 0.13); }
.stat-card:nth-child(3) .stat-ico { background: rgba(23, 105, 170, 0.12); }
.stat-card:nth-child(4) .stat-ico { background: rgba(60, 196, 122, 0.14); }
.stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12.5px; }

.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; margin-bottom: 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
.filter-bar .filter { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); font-size: 13px; padding-left: 6px; }
.filter-bar .input { min-width: 200px; }
.filter-bar .check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: auto; padding-right: 8px; }

.table-card { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--soft-shadow); padding: 0; background: var(--surface-solid); }
.table-card .table th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 16px; }
.table-card .table td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.table-card .table tr:last-child td { border-bottom: 0; }
.table-card .table tr.clickable { transition: background .12s; }
.table-card .table tr.clickable:hover td { background: rgba(106, 61, 240, 0.06); }
.table-card > .muted.small { padding: 10px 16px; border-top: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.class-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(23, 105, 170, 0.1); color: #1769aa; }
:root[data-theme="dark"] .class-pill { color: #8fc3ff; background: rgba(80, 160, 255, 0.14); }
.count-pill { display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12.5px; background: rgba(106, 61, 240, 0.12); color: #5a33d6; }
.count-pill.zero { background: rgba(120, 130, 160, 0.12); color: var(--muted); }
:root[data-theme="dark"] .count-pill { color: #c2b2ff; }

.page-modern .back-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--soft-shadow); color: var(--text); font-size: 13px; }
.student-card { padding: 22px 26px; border-radius: 20px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
.student-card h1 { font-family: var(--font-display); letter-spacing: -0.02em; }
.student-card .avatar.lg { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }

/* ------------------------------------------------------------------ kod ekranının üst çubuğu */
.ide-top {
  height: 54px; gap: 10px; padding: 0 14px;
  background: var(--surface); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}
:root[data-theme="dark"] .ide-top { background: #1c1f25; }
.ide-top .brand-logo { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(255, 120, 0, 0.25)); transition: transform .15s; }
.ide-top .brand:hover .brand-logo { transform: scale(1.06); }
.ide-top .ide-project { margin: 0 8px 0 4px; }
.ide-top .ide-project-name { font-family: var(--font-display); font-size: 15px; letter-spacing: -0.01em; }
.ide-top .ide-save { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.ide-top .ide-save::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3cc47a; }
.ide-top .ide-save.saving::before { background: #e0a030; animation: blink 1s infinite; }
.ide-top .ide-save.error::before { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }
.ide-top .btn { height: 34px; border-radius: 10px; }
.ide-group { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(120, 130, 160, 0.09); }
.ide-group .btn { height: 30px; border-radius: 9px; border-color: transparent; }
.ide-group .btn-ghost:hover, .ide-top > .btn-ghost:hover { background: rgba(120, 130, 160, 0.16); }
.ide-group-run .btn-run, .ide-group-run .btn-stop { padding: 0 16px; box-shadow: 0 4px 12px rgba(18, 161, 80, 0.3); }
.ide-group-run .btn-run { background: linear-gradient(180deg, #19b25c, #0f9a4a); }
.ide-group-run .btn-run:hover { background: linear-gradient(180deg, #1dc366, #12a150); }
.ide-group-run .btn-stop { box-shadow: 0 4px 12px rgba(217, 45, 32, 0.3); }
.ide-group-run .btn-seg { background: transparent; color: var(--text); }
.ide-group-run .btn-seg:hover { background: rgba(120, 130, 160, 0.16); }
.ide-top .user-chip { padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(120, 130, 160, 0.09); }
.ide-top .user-chip .avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.ide-top .user-name { font-size: 13px; }
.ide-top .btn-back { font-weight: 600; }

/* dar ekranlar */
@media (max-width: 1180px) {
  .ide-top .user-name { display: none; }
  .ide-top .user-chip { padding: 3px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .user-name, .topbar .user-chip .badge { display: none; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 25px; }
  .page-modern { padding: 18px 16px 40px; }
  .search-input { min-width: 0; flex: 1; }
}

/* Proje yükle penceresi */
.import-item { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.import-warn { margin-top: 8px; font-size: 12.5px; color: var(--warning); }
.import-warn summary { cursor: pointer; font-weight: 600; }
.import-warn ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.import-warn li { margin: 2px 0; }

/* kod ekranı üst çubuğu: dar ekranlarda sıkıştır */
@media (max-width: 1100px) {
  .ide-top .ide-project-name { max-width: 150px; }
  .ide-top .lbl { display: none; }
  .ide-top .btn { padding: 0 10px; }
}
@media (max-width: 900px) {
  .ide-top { gap: 6px; padding: 0 8px; }
  .ide-top .user-chip, .ide-top .ide-save { display: none; }
  .ide-top .ide-project-name { max-width: 110px; font-size: 14px; }
  .ide-group .btn { padding: 0 8px; }
  .ide-group-run .btn-run { padding: 0 12px; }
}
@media (max-width: 760px) {
  .ide-top .brand { display: none; }
}
