@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fira+Code:wght@400;600&display=swap');

:root {
  --bg-main: #0b0f17;         
  --bg-card: #131b2e;           
  --bg-card-hover: #1c2744;
  --sidebar-bg: #0f1523;        
  --sidebar-text: #94a3b8;     
  
  --primary: #06b6d4;           
  --primary-hover: #0891b2;
  --primary-glow: rgba(6, 182, 212, 0.2);
  
  --accent: #6366f1;           
  --accent-pink: #ec4899;     
  --pink-glow: rgba(236, 72, 153, 0.2);

  --text-main: #f8fafc;         
  --text-muted: #64748b;        
  
  --border: rgba(255, 255, 255, 0.08); 
  --border-focus: rgba(6, 182, 212, 0.4);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* MODERN SCROLLBAR STYLES (WebKit - Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* FIREFOX SCROLLBAR STYLES */
* {
  scrollbar-width: thin;
  scrollbar-color: rgb(83 69 125) rgb(0 0 0 / 0%);
}

body {
  font-family: "Nunito", sans-serif;
  background-color: #584887;
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* CODE / FORMULA FONTS */
code, pre, .formula-list code {
  font-family: 'Fira Code', monospace !important;
}

/* LEFT SIDEBAR */
aside.left-sidebar {
  width: 200px;
  background-color: #423262;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.info-section { margin-bottom: 1.75rem; }

.info-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fbf543;
  margin-bottom: 0.85rem;
  font-weight: 800;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.83rem;
}

.info-list li {
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  line-height: 1.4;
  transition: all 0.2s;
}

.info-list li:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.info-list li strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

/* APP LAYOUT */
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* TOPBAR */
header.topbar {
  min-height: 70px;
  background: rgb(70 54 104);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(88 72 135);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
  z-index: 10;
}

.search-wrapper { 
  position: relative; 
  width: 100%; 
  max-width: 360px; 
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: #ffffff;
  color: #000000;
  outline: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.portal-tag {
  background: rgb(88 72 135);
  color: #ffffff;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid rgb(255 255 255 / 30%);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-back {
  text-decoration: none;
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* CONTENT AREAS */
.content-wrapper { 
  flex: 1; 
  display: flex; 
  overflow: hidden; 
}

main.main-content, main.content {
  flex: 1;
  padding: 5px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 620px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.page-title { font-size: 1.5rem; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; }
.page-subtitle { color: #b3c3da; font-size: 0.875rem; margin-top: 0.2rem; }

/* LOAD CONTAINER */
.load-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #3b2e54;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 5px 0px;
  text-align: center;
  width: 100%;
}

.btn-group-sub { 
  display: flex; 
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem; 
  margin-bottom: 1.5rem; 
  width: 100%;
}

.btn-sub {
  background: #ffea37;
  color: #4c3b3b;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-sub:hover:not(:disabled) {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.btn-load {
  background: linear-gradient(135deg, #cc86ff, #5c47a9);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 2.75rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px var(--primary-glow);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 100%;
}

.btn-load:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(6, 182, 212, 0.4);
}

/* LOADER & BUTTONS */
.circle-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgb(0 0 0 / 60%);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-reset {
  display: none;
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}
.btn-reset:hover { background: var(--bg-card-hover); }

/* GRID & KARE CARDS */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.25rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.6);
}

/* 1:1 KARE GÖRSEL KUTUSU */
.thumbnail-link {
  display: block;
  text-decoration: none;
  width: 100%;
}

.thumbnail-box { 
  position: relative; 
  width: 100%; 
  padding-top: 100%;
  background: var(--bg-main); 
  overflow: hidden;
}

.thumbnail-img { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  transition: transform 0.3s ease;
}

.course-card:hover .thumbnail-img {
  transform: scale(1.05);
}

.card-body { padding: 1.1rem; display: flex; flex-direction: column; flex: 1; }
.course-title { font-size: 0.925rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.4; color: #ffffff; }
.card-footer { margin-top: auto; padding-top: 0.8rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

.btn-start {
  text-decoration: none;
  background: var(--primary);
  color: #0b0f17;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-start:hover { background: #22d3ee; color: #0b0f17; }

.scroll-sentinel {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: none;
}

/* RIGHT PANEL */
aside.right-panel {
  width: 320px;
  background: #423262d6;
  border-left: 1px solid var(--border);
  padding: 5px 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-box {
  background: #131b2e61;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.panel-title {
  font-size: 0.825rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.01em;
}

.fact-box {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  line-height: 1.5;
}

.formula-list {
  list-style: none;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--sidebar-text);
}

.formula-list code {
  background: var(--primary-glow);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff89b;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

/* DETAIL PAGE CONTENT */
.lesson-container {
  width: 100%;
  height: 100%;
  background: #584887;
  border-radius: var(--radius);
  border: 0px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.banner-970x250 {
  width: 100%;
  max-width: 970px;
  height: auto;
  min-height: 150px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-start-lesson {
  background: linear-gradient(135deg, #fff858, #f8ffa8);
  color: #000000;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem 3.25rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px var(--pink-glow);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-width: 260px;
  max-width: 100%;
}

.btn-start-lesson:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(236, 72, 153, 0.4);
}

iframe.lesson-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  background: #ffffff;
}

/* AD CONTAINER RESPONSIVE FIXES */
.class_r {
  max-width: 100%;
 
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

/* ==========================================
   MEDIA QUERIES (RESPONSIVE DÜZENLEMELER)
   ========================================== */

/* Laptop ve Tablet Yatay Ekranlar (max-width: 1200px) */
@media (max-width: 1200px) {
  aside.right-panel {
    width: 260px;
  }
}

/* Tablet Ekranlar (max-width: 992px) */
@media (max-width: 992px) {
  body {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }

  aside.left-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 250px;
  }

  .content-wrapper {
    flex-direction: column;
    overflow: visible;
  }

  main.main-content, main.content {
    overflow: visible;
  }

  aside.right-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Mobil Ekranlar (max-width: 600px) */
@media (max-width: 600px) {
  header.topbar {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0.8rem;
  }

  .search-wrapper {
    max-width: 100%;
  }

  .portal-tag {
    text-align: center;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-reset {
    width: 100%;
    margin-top: 0.5rem;
  }

  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .btn-sub {
    width: 100%;
  }

  .btn-load {
    width: 100%;
    padding: 0.85rem 1.5rem;
  }

  .load-container {
    padding: 1.5rem 0.75rem;
  }
}