/* =========================================================
   Hatay Yapay Zeka ve Robotik Kodlama Egitimi Dernegi
   Tasarim Sistemi - tek dosya, harici bagimliligi olmayan CSS
   ========================================================= */

:root {
  --navy-950: #0f172a;
  --navy-900: #1a2744;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-950: #022c22;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-950: #451a03;

  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --shadow-xs: 0 1px 2px 0 rgb(15 23 42 / 0.06), 0 1px 3px 0 rgb(15 23 42 / 0.04);
  --shadow-md: 0 4px 12px -2px rgb(15 23 42 / 0.10), 0 2px 6px -2px rgb(15 23 42 / 0.06);
  --shadow-xl: 0 20px 40px -12px rgb(15 23 42 / 0.25);
  --font-sans: "Segoe UI", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: light; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background: var(--slate-100);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
main { flex: 1 0 auto; width: 100%; }
::selection { background: var(--amber-400); color: var(--slate-950); }

.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ---------- Utility: flex / grid ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.w-full { width: 100%; }
.hidden { display: none !important; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
@media (min-width: 768px) { .hide-desktop { display: none !important; } }

.space-y > * + * { margin-top: 1.25rem; }
.space-y-sm > * + * { margin-top: .75rem; }

/* ---------- Typography helpers ---------- */
.text-xs { font-size: .75rem; }
.text-sm { font-size: .8125rem; }
.text-base { font-size: .95rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.4rem; }
.text-2xl { font-size: 1.8rem; }
.text-3xl { font-size: 2.2rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.text-muted { color: var(--slate-500); }
.text-white { color: #fff; }
.uppercase { text-transform: uppercase; letter-spacing: .04em; }
.text-center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1.2rem;
  border-radius: .85rem;
  font-weight: 700;
  font-size: .8rem;
  border: 1px solid transparent;
  transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-sm { padding: .45rem .8rem; font-size: .72rem; border-radius: .6rem; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--blue-700); }
.btn-success { background: var(--emerald-600); color: #fff; }
.btn-success:hover { background: var(--emerald-700); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); }
.btn-amber { background: var(--amber-500); color: var(--slate-950); }
.btn-amber:hover { background: var(--amber-400); }
.btn-purple { background: var(--purple-600); color: #fff; }
.btn-purple:hover { background: var(--purple-700); }
.btn-outline { background: #fff; color: var(--slate-700); border-color: var(--slate-300); }
.btn-outline:hover { background: var(--slate-100); }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xs);
  padding: 1.5rem;
}
.card-sm { padding: 1rem; border-radius: var(--radius-lg); }
.stat-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-2xl); padding: 1.5rem; box-shadow: var(--shadow-xs); }
.stat-card .stat-label { font-size: .72rem; font-weight: 700; color: var(--slate-500); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--slate-900); margin-top: .25rem; }
.stat-card .stat-hint { font-size: .72rem; font-weight: 600; margin-top: .5rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700;
}
.badge-blue { background: var(--blue-100); color: var(--blue-900); }
.badge-emerald { background: var(--emerald-100); color: var(--emerald-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-red { background: var(--red-100); color: var(--red-700); }
.badge-purple { background: var(--purple-100); color: var(--purple-700); }
.badge-slate { background: var(--slate-200); color: var(--slate-700); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
label.form-label, .form-group label { display: block; font-weight: 700; font-size: .78rem; color: var(--slate-700); margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=url],
select, textarea {
  width: 100%;
  padding: .7rem .85rem;
  border-radius: .85rem;
  border: 1px solid var(--slate-300);
  font-size: .85rem;
  font-family: inherit;
  background: #fff;
  color: var(--slate-900);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}
textarea { resize: vertical; min-height: 5rem; }
.form-hint { font-size: .7rem; color: var(--slate-500); margin-top: .3rem; }
.form-error { font-size: .7rem; color: var(--red-600); margin-top: .3rem; font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; }
.checkbox-row input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--purple-600); }

/* ---------- Alerts / Flash ---------- */
.alert { padding: .9rem 1.1rem; border-radius: .9rem; font-size: .82rem; font-weight: 600; border: 1px solid transparent; margin-bottom: 1rem; }
.alert-success { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-100); }
.alert-error { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }
.alert-info { background: var(--blue-50); color: var(--blue-900); border-color: var(--blue-100); }
.alert-warn { background: var(--amber-50); color: var(--amber-600); border-color: var(--amber-100); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: .78rem; text-align: left; min-width: 620px; }
table.table thead tr { background: var(--slate-100); color: var(--slate-700); }
table.table th, table.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--slate-100); }
table.table tbody tr:hover { background: var(--slate-50); }

/* ---------- Site Header ---------- */
.top-banner { background: var(--slate-900); color: var(--slate-300); font-size: .72rem; padding: .4rem 0; }
.top-banner .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; }
.pulse-dot { width: .5rem; height: .5rem; border-radius: 999px; background: var(--emerald-600); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--slate-200); backdrop-filter: blur(6px); }
.navbar { display: flex; align-items: center; justify-content: space-between; min-height: 4.75rem; padding: .6rem 0; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand img { width: 2.75rem; height: 2.75rem; border-radius: 999px; object-fit: cover; box-shadow: var(--shadow-xs); flex-shrink: 0; }
.brand-name { font-size: .85rem; font-weight: 800; color: var(--blue-900); line-height: 1.15; white-space: nowrap; }
.brand-sub { font-size: .6rem; font-weight: 700; color: var(--amber-600); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }

.main-nav { display: none; align-items: center; gap: .1rem; flex-wrap: nowrap; }
@media (min-width: 1024px) { .main-nav { display: flex; } }
.main-nav a { display: flex; align-items: center; gap: .35rem; padding: .55rem .6rem; border-radius: .7rem; font-size: .78rem; font-weight: 700; color: var(--slate-600); white-space: nowrap; flex-shrink: 0; }
.main-nav a .icon { flex-shrink: 0; }
.main-nav a:hover { background: var(--slate-50); color: var(--slate-900); }
.main-nav a.active { background: var(--blue-50); color: var(--blue-700); }

.nav-actions { display: none; align-items: center; gap: .75rem; }
@media (min-width: 768px) { .nav-actions { display: flex; } }

.mobile-toggle { display: flex; }
@media (min-width: 1024px) { .mobile-toggle { display: none; } }
.mobile-menu { display: none; border-top: 1px solid var(--slate-200); background: #fff; padding: .75rem 1rem 1.5rem; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: flex; align-items: center; gap: .6rem; padding: .7rem .6rem; border-radius: .7rem; font-weight: 700; font-size: .85rem; color: var(--slate-700); }
.mobile-menu a.active { background: var(--blue-50); color: var(--blue-700); }

.dropdown-panel { display: none; position: absolute; right: 0; top: 2.75rem; width: 20rem; z-index: 60; padding: 0; overflow: hidden; }
.dropdown-panel.open { display: block; }
.dropdown-panel.narrow { width: 14rem; padding: .5rem; }
.icon-btn { position: relative; padding: .5rem; border-radius: 999px; background: transparent; border: none; color: var(--slate-600); }
.icon-btn:hover { background: var(--slate-100); }
.notif-dot { position: absolute; top: .1rem; right: .1rem; background: var(--red-600); color: #fff; font-size: .6rem; font-weight: 800; border-radius: 999px; width: 1.1rem; height: 1.1rem; display: flex; align-items: center; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate-950); color: var(--slate-300); padding: 3rem 0 2rem; margin-top: 3rem; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.site-footer a { color: var(--slate-300); font-size: .82rem; }
.site-footer a:hover { color: var(--blue-400, #60a5fa); }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--slate-800); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-bottom { padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .72rem; color: var(--slate-500); }

/* ---------- Hero ---------- */
/* ---------- Splash Screen ---------- */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, var(--blue-900) 0%, var(--navy-950) 65%, #020617 100%);
  transition: opacity .6s ease, visibility .6s ease;
}
.splash-screen.splash-hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; animation: splash-fade-in .7s ease both; }
.splash-logo {
  width: 6.5rem; height: 6.5rem; border-radius: 999px; object-fit: cover;
  box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 20px 60px rgba(0,0,0,.5);
  animation: splash-pop .8s cubic-bezier(.34,1.56,.64,1) both;
}
.splash-title {
  margin-top: 1.5rem; font-size: 1.3rem; font-weight: 800; letter-spacing: .08em;
  color: #fff; text-transform: uppercase;
}
.splash-sub {
  margin-top: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  color: var(--amber-400); text-transform: uppercase;
}
.splash-loader { margin-top: 2rem; display: flex; gap: .4rem; justify-content: center; }
.splash-loader span {
  width: .5rem; height: .5rem; border-radius: 999px; background: var(--amber-400);
  animation: splash-bounce 1.1s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: .15s; }
.splash-loader span:nth-child(3) { animation-delay: .3s; }

@keyframes splash-pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes splash-fade-in { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes splash-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .splash-inner, .splash-logo, .splash-loader span { animation: none; }
}

.hero { background: linear-gradient(120deg, var(--navy-950), var(--blue-900) 60%, var(--navy-900)); color: #fff; border-radius: var(--radius-2xl); padding: 3rem 2rem; box-shadow: var(--shadow-xl); position: relative; overflow: hidden; }
.hero h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; }
@media (min-width: 768px) { .hero h1 { font-size: 2.6rem; } }
.hero p { margin-top: 1rem; color: var(--slate-300); max-width: 46rem; font-size: .95rem; }
.hero .actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Role dashboard banners ---------- */
.role-banner { border-radius: var(--radius-2xl); padding: 1.75rem 2rem; box-shadow: var(--shadow-xl); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.role-banner.admin { background: var(--slate-900); }
.role-banner.teacher { background: var(--emerald-950); }
.role-banner.student { background: linear-gradient(120deg, var(--blue-900), var(--navy-900)); }
.role-banner.parent { background: var(--amber-950); }
.role-banner .icon-chip { padding: .8rem; border-radius: 1.1rem; }
.role-banner .eyebrow { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--amber-400); }
.role-banner h1 { font-size: 1.6rem; font-weight: 800; }

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.tabs a, .tabs button { padding: .65rem 1rem; border-radius: .8rem; font-size: .76rem; font-weight: 700; background: var(--slate-100); color: var(--slate-700); border: none; }
.tabs a.active, .tabs button.active { background: var(--blue-600); color: #fff; }

/* ---------- Course / Event cards ---------- */
.course-card, .event-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; }
.course-card .body, .event-card .body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.course-thumb { height: 9rem; background: linear-gradient(135deg, var(--blue-900), var(--purple-600)); display: flex; align-items: center; justify-content: center; color: #fff; }

/* ---------- Certificate card ---------- */
.cert-card { border-radius: var(--radius-2xl); padding: 1.5rem; border: 1px solid var(--slate-200); }
.cert-card.approved { background: linear-gradient(160deg, rgb(245 158 11 / .08), #fff 60%); border-color: var(--amber-500); }
.cert-card.pending { background: var(--slate-50); opacity: .8; }

/* ---------- Login / auth pages ---------- */
.auth-shell { min-height: calc(100vh - 4.75rem); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 26rem; background: #fff; border-radius: var(--radius-2xl); box-shadow: var(--shadow-xl); padding: 2.25rem; border: 1px solid var(--slate-200); }

/* ---------- Chart container ---------- */
.chart-box { background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: var(--radius-2xl); padding: 1rem; height: 18rem; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--slate-200); margin: 1.5rem 0; }
.rounded-full { border-radius: 999px; }
.shadow { box-shadow: var(--shadow-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
