/* ==========================================================================
   MENTAL MATEMATİK ANSİKLOPEDİSİ - BAĞIMSIZ MODÜL STİL DOSYASI (SCOPED CSS)
   Ana sayfanızın stillerini bozmaması için tüm sınıflar .mm-atlas-module
   kapsayıcısı altında izole edilmiştir.
   ========================================================================== */

:root {
  --mm-turq-50: #f0fdfa;
  --mm-turq-100: #ccfbf1;
  --mm-turq-500: #14b8a6;
  --mm-turq-600: #0d9488;
  --mm-turq-700: #0f766e;
  --mm-red-50: #fff1f2;
  --mm-red-100: #ffe4e6;
  --mm-red-500: #f43f5e;
  --mm-red-600: #e11d48;
  --mm-slate-50: #f8fafc;
  --mm-slate-100: #f1f5f9;
  --mm-slate-200: #e2e8f0;
  --mm-slate-300: #cbd5e1;
  --mm-slate-600: #475569;
  --mm-slate-700: #334155;
  --mm-slate-800: #1e293b;
  --mm-slate-900: #0f172a;
  --mm-white: #ffffff;
  --mm-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --mm-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --mm-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  --mm-radius: 12px;
  --mm-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mm-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.mm-atlas-module.mm-dark-mode {
  --mm-slate-50: #0f172a;
  --mm-slate-100: #1e293b;
  --mm-slate-200: #334155;
  --mm-slate-300: #475569;
  --mm-slate-600: #94a3b8;
  --mm-slate-700: #cbd5e1;
  --mm-slate-800: #e2e8f0;
  --mm-slate-900: #f8fafc;
  --mm-white: #1e293b;
  --mm-turq-50: rgba(20, 184, 166, 0.12);
  --mm-turq-100: rgba(20, 184, 166, 0.22);
  --mm-red-50: rgba(244, 63, 94, 0.12);
  --mm-red-100: rgba(244, 63, 94, 0.22);
}

.mm-atlas-module {
  font-family: var(--mm-font-sans);
  background-color: var(--mm-slate-50);
  color: var(--mm-slate-800);
  line-height: 1.65;
  box-sizing: border-box;
  display: flex;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.mm-atlas-module *, .mm-atlas-module *::before, .mm-atlas-module *::after {
  box-sizing: inherit;
}

/* SIDEBAR NAVIGATION */
.mm-sidebar {
  width: 290px;
  background-color: var(--mm-white);
  border-right: 1px solid var(--mm-slate-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

.mm-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--mm-slate-200);
  background: linear-gradient(135deg, var(--mm-turq-700), var(--mm-slate-900));
  color: #ffffff;
}

.mm-brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: var(--mm-red-600);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.mm-brand h1 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.mm-brand p {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}

.mm-search-box {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mm-slate-200);
}

.mm-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--mm-slate-300);
  border-radius: 8px;
  font-size: 13px;
  background-color: var(--mm-slate-50);
  color: var(--mm-slate-900);
  outline: none;
  transition: border-color 0.2s;
}

.mm-search-input:focus {
  border-color: var(--mm-turq-600);
  box-shadow: 0 0 0 3px var(--mm-turq-100);
}

.mm-nav-list {
  list-style: none;
  padding: 12px;
  margin: 0;
  flex: 1;
}

.mm-nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--mm-slate-600);
  padding: 12px 10px 6px;
}

.mm-nav-item {
  margin-bottom: 4px;
}

.mm-nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mm-slate-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.mm-nav-btn:hover {
  background-color: var(--mm-slate-100);
  color: var(--mm-turq-600);
}

.mm-nav-btn.active {
  background-color: var(--mm-turq-50);
  color: var(--mm-turq-600);
  font-weight: 700;
  border-left: 3px solid var(--mm-red-600);
}

.mm-nav-num {
  font-family: var(--mm-font-mono);
  font-size: 11px;
  font-weight: 700;
  background-color: var(--mm-slate-200);
  color: var(--mm-slate-700);
  padding: 2px 6px;
  border-radius: 4px;
}

.mm-nav-btn.active .mm-nav-num {
  background-color: var(--mm-turq-600);
  color: #ffffff;
}

.mm-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--mm-slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.mm-theme-toggle {
  background-color: var(--mm-slate-100);
  border: 1px solid var(--mm-slate-300);
  color: var(--mm-slate-800);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

/* MAIN CONTENT AREA */
.mm-main {
  flex: 1;
  padding: 32px 44px;
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: hidden;
}

.mm-hero {
  background: linear-gradient(125deg, var(--mm-slate-900) 0%, var(--mm-turq-700) 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--mm-shadow-lg);
}

.mm-hero::after {
  content: "∑ π √ ∞";
  position: absolute;
  right: 24px;
  bottom: -10px;
  font-size: 86px;
  font-weight: 900;
  opacity: 0.08;
  pointer-events: none;
}

.mm-hero-top {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mm-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

.mm-pill.red {
  background-color: var(--mm-red-600);
}

.mm-hero h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 10px 0;
}

.mm-hero p {
  font-size: 15px;
  max-width: 780px;
  opacity: 0.92;
  margin: 0;
}

/* SECTION PANELS */
.mm-section {
  display: none;
  animation: mmFadeIn 0.25s ease;
}

.mm-section.active {
  display: block;
}

@keyframes mmFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mm-section-header {
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--mm-slate-200);
}

.mm-section-category {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mm-red-600);
  letter-spacing: 1px;
}

.mm-section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--mm-slate-900);
  margin: 4px 0 8px 0;
}

.mm-section-desc {
  font-size: 15px;
  color: var(--mm-slate-600);
  margin: 0;
}

/* CARDS & GRIDS */
.mm-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.mm-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.mm-card {
  background-color: var(--mm-white);
  border: 1px solid var(--mm-slate-200);
  border-radius: var(--mm-radius);
  padding: 22px;
  box-shadow: var(--mm-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mm-card:hover {
  box-shadow: var(--mm-shadow-md);
}

.mm-card.accent-turq {
  border-top: 4px solid var(--mm-turq-600);
}

.mm-card.accent-red {
  border-top: 4px solid var(--mm-red-600);
}

.mm-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--mm-slate-900);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mm-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--mm-turq-100);
  color: var(--mm-turq-700);
}

.mm-tag.red {
  background-color: var(--mm-red-100);
  color: var(--mm-red-600);
}

/* FORMULA & EXAMPLE BOXES */
.mm-formula-box {
  background-color: var(--mm-slate-100);
  border-left: 4px solid var(--mm-turq-600);
  padding: 14px 16px;
  border-radius: 6px;
  font-family: var(--mm-font-mono);
  font-size: 13.5px;
  margin: 12px 0;
  color: var(--mm-slate-900);
  overflow-x: auto;
}

.mm-formula-box.red {
  border-left-color: var(--mm-red-600);
}

.mm-step-list {
  padding-left: 18px;
  margin: 10px 0;
  font-size: 14px;
}

.mm-step-list li {
  margin-bottom: 6px;
}

/* TABLES */
.mm-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  background: var(--mm-white);
  border-radius: var(--mm-radius);
  border: 1px solid var(--mm-slate-200);
}

.mm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.mm-table th, .mm-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--mm-slate-200);
}

.mm-table th {
  background-color: var(--mm-slate-100);
  font-weight: 700;
  color: var(--mm-slate-900);
}

.mm-table tr:last-child td {
  border-bottom: none;
}

/* TIMELINE */
.mm-timeline {
  position: relative;
  padding-left: 28px;
  border-left: 3px solid var(--mm-turq-500);
  margin: 20px 0;
}

.mm-timeline-item {
  position: relative;
  margin-bottom: 22px;
  background: var(--mm-white);
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--mm-slate-200);
}

.mm-timeline-item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 20px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: var(--mm-red-600);
  border: 3px solid var(--mm-white);
}

.mm-timeline-year {
  font-family: var(--mm-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--mm-turq-600);
}

/* INTERACTIVE WIDGETS */
.mm-widget {
  background-color: var(--mm-white);
  border: 2px solid var(--mm-turq-500);
  border-radius: var(--mm-radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--mm-shadow-md);
}

.mm-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.mm-input, .mm-select {
  padding: 9px 13px;
  border: 1px solid var(--mm-slate-300);
  border-radius: 8px;
  font-size: 14px;
  background-color: var(--mm-slate-50);
  color: var(--mm-slate-900);
  font-family: var(--mm-font-sans);
}

.mm-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background-color: var(--mm-turq-600);
  color: #ffffff;
  transition: background-color 0.15s;
}

.mm-btn:hover {
  background-color: var(--mm-turq-700);
}

.mm-btn.red {
  background-color: var(--mm-red-600);
}

.mm-btn.red:hover {
  background-color: #be123c;
}

.mm-btn.secondary {
  background-color: var(--mm-slate-200);
  color: var(--mm-slate-800);
}

/* INTERACTIVE SOROBAN CANVAS */
.mm-soroban-board {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  padding: 24px 18px;
  border-radius: 12px;
  border: 6px solid #334155;
  display: flex;
  justify-content: space-around;
  position: relative;
  margin-top: 16px;
  user-select: none;
}

.mm-soroban-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  height: 8px;
  background-color: #cbd5e1;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.mm-soroban-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 3;
  width: 54px;
}

.mm-soroban-rod {
  position: absolute;
  top: 0;
  bottom: 28px;
  width: 4px;
  background-color: #64748b;
  z-index: 1;
}

.mm-heaven-zone {
  height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 3;
  margin-bottom: 12px;
}

.mm-earth-zone {
  height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  z-index: 3;
}

.mm-bead {
  width: 46px;
  height: 22px;
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
  clip-path: polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}

.mm-bead.active {
  background: linear-gradient(180deg, #fb7185, #e11d48);
}

.mm-bead.heaven-bead.active {
  transform: translateY(36px);
}

.mm-bead.earth-bead.active {
  transform: translateY(-22px);
}

.mm-col-digit {
  margin-top: 12px;
  font-family: var(--mm-font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  background-color: rgba(255,255,255,0.1);
  padding: 2px 10px;
  border-radius: 4px;
  z-index: 3;
}

/* FLASH ANZAN DISPLAY */
.mm-anzan-screen {
  background-color: #0f172a;
  color: #2dd4bf;
  font-family: var(--mm-font-mono);
  font-size: 64px;
  font-weight: 800;
  height: 180px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  border: 3px solid #334155;
  letter-spacing: 2px;
}

@media (max-width: 900px) {
  .mm-atlas-module {
    flex-direction: column;
  }
  .mm-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .mm-main {
    padding: 20px;
  }
}
