/* =========================================================
   A4 AYLIK PLANLAYICI - CSS STİLLERİ
   Siyah-Beyaz, Mürekkep Tasarruflu, A4 Tek Sayfa Uyumlu
   ========================================================= */

:root {
  --ink-black: #000000;
  --ink-dark: #222222;
  --ink-mid: #666666;
  --ink-light: #cccccc;
  --ink-ultralight: #eeeeee;
  --line-rule: #bbbbbb;
  --bg-app: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--ink-black);
  line-height: 1.25;
  font-size: 11px;
}

/* =========================================================
   ÜST KONTROL ÇUBUĞU (TOOLBAR)
   ========================================================= */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 2px solid #000000;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #000000;
  margin-right: 4px;
}

.lang-switcher {
  display: inline-flex;
  border: 1.5px solid #000000;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 4px;
}

.lang-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-right: 1px solid #000000;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:last-child {
  border-right: none;
}

.lang-btn:hover {
  background: #eeeeee;
}

.lang-btn.active {
  background: #000000;
  color: #ffffff;
}

.btn {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000000;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn:hover {
  background: #000000;
  color: #ffffff;
}

.btn.active {
  background: #000000;
  color: #ffffff;
}

.btn-print {
  background: #000000;
  color: #ffffff;
  font-weight: 700;
}

.btn-print:hover {
  background: #333333;
}

.select-input {
  padding: 3.5px 6px;
  font-size: 11px;
  border: 1.5px solid #000000;
  border-radius: 4px;
  background: #ffffff;
  font-weight: 600;
}

.nav-arrow-btn {
  padding: 3px 7px;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

/* =========================================================
   A4 SAYFA YÖNETİMİ
   ========================================================= */
.sheet-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 10px 50px 10px;
}

.a4-sheet {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  color: var(--ink-black);
}

.a4-sheet.portrait {
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  padding: 7mm 8mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.a4-sheet.landscape {
  width: 297mm;
  height: 210mm;
  max-height: 210mm;
  padding: 6mm 7mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* =========================================================
   ORTAK TİPOGRAFİ VE YAPILAR
   ========================================================= */
.section-title {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1.5px solid var(--ink-black);
  padding-bottom: 2px;
  margin-bottom: 3.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-tag {
  font-size: 7.5px;
  font-weight: 700;
  border: 1px solid var(--ink-black);
  padding: 0 3px;
  border-radius: 2px;
  text-transform: uppercase;
}

[contenteditable="true"] {
  outline: none;
  cursor: text;
}

[contenteditable="true"]:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.chk {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.2px solid var(--ink-black);
  border-radius: 1px;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.chk.checked::after {
  content: "✓";
  position: absolute;
  top: -4px;
  left: 1px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink-black);
}

.circle-chk {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.2px solid var(--ink-black);
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.circle-chk.checked {
  background-color: var(--ink-black);
}

/* =========================================================
   DİKEY (PORTRAIT) YERLEŞİM DÜZENİ
   ========================================================= */
.portrait .header-bar {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: end;
  border-bottom: 2px solid var(--ink-black);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.portrait .main-title {
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1.1;
}

.portrait .sub-title {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--ink-mid);
  margin-top: 1px;
}

.portrait .header-meta {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
}

.portrait .meta-box {
  border: 1.5px solid var(--ink-black);
  padding: 1.5px 6px;
  border-radius: 3px;
  min-width: 70px;
  text-align: center;
}

.portrait .focus-strip {
  border: 1.2px solid var(--ink-black);
  background-color: #fafafa;
  padding: 2.5px 5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
}

.focus-label {
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.focus-text {
  flex: 1;
  border-bottom: 1px dotted var(--ink-mid);
  min-height: 12px;
  font-weight: 600;
}

/* Takvim Alanı (Dikey: 6 Hafta x 7 Gün = 42 Hücre) */
.portrait .calendar-section {
  margin-bottom: 4px;
}

.portrait .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1.5px solid var(--ink-black);
  border-left: 1.5px solid var(--ink-black);
}

.cal-day-header {
  font-size: 7.5px;
  font-weight: 800;
  text-align: center;
  padding: 2px 0;
  border-right: 1px solid var(--ink-black);
  border-bottom: 1.5px solid var(--ink-black);
  background: #f4f4f4;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cal-day-header.weekend {
  background: #e9e9e9;
}

.portrait .cal-cell {
  border-right: 1px solid var(--ink-black);
  border-bottom: 1px solid var(--ink-black);
  height: 13.8mm;
  padding: 1.5px 2.5px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.portrait .cal-cell.weekend {
  background: #fafafa;
}

.cal-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}

.cal-date-badge {
  font-size: 8px;
  font-weight: 800;
  min-width: 12px;
  height: 12px;
  line-height: 11px;
  text-align: center;
  border: 1px solid var(--ink-black);
  border-radius: 50%;
  display: inline-block;
}

.cal-cell-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1px;
}

.cal-note-line {
  border-bottom: 1px dotted #ccc;
  height: 4px;
  font-size: 7px;
  line-height: 7px;
  overflow: hidden;
  white-space: nowrap;
}

/* Dikey İki Sütunlu Alt Gövde */
.portrait .projects-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  flex: 1;
  min-height: 0;
}

.current-projects-col {
  display: flex;
  flex-direction: column;
}

.project-card {
  border: 1.2px solid var(--ink-black);
  border-radius: 3px;
  padding: 3px 4.5px;
  margin-bottom: 3.5px;
  background: #ffffff;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 9px;
  border-bottom: 1px solid var(--ink-light);
  padding-bottom: 1.5px;
  margin-bottom: 2px;
}

.project-name {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 3px;
}

.project-deadline {
  font-size: 7.5px;
  font-weight: 700;
  border: 1px solid var(--ink-black);
  padding: 0 3px;
  border-radius: 2px;
  white-space: nowrap;
}

.project-tasks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  margin-bottom: 2px;
}

.task-item {
  display: flex;
  align-items: center;
  font-size: 8px;
}

.task-text {
  flex: 1;
  border-bottom: 1px dotted var(--line-rule);
  min-height: 11px;
  line-height: 11px;
}

.project-status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  font-weight: 600;
  color: var(--ink-mid);
  border-top: 1px dashed var(--ink-light);
  padding-top: 1.5px;
  margin-top: 1px;
}

.status-opt {
  display: flex;
  align-items: center;
}

.future-projects-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.future-card {
  border: 1.2px dashed var(--ink-black);
  border-radius: 3px;
  padding: 2.5px 4.5px;
  margin-bottom: 3px;
  background: #ffffff;
}

.future-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  font-weight: 800;
  margin-bottom: 1px;
}

.future-meta {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: var(--ink-mid);
  margin-top: 1px;
}

.notes-box {
  border: 1.2px solid var(--ink-black);
  border-radius: 3px;
  padding: 3.5px 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 2px;
}

.note-row {
  display: flex;
  align-items: center;
  font-size: 8px;
  margin-bottom: 2.5px;
}

.note-line {
  flex: 1;
  border-bottom: 1px dotted var(--line-rule);
  min-height: 11px;
}

/* =========================================================
   YATAY (LANDSCAPE) YERLEŞİM DÜZENİ
   ========================================================= */
.landscape .layout-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 6mm;
  height: 100%;
}

.landscape-left {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.landscape-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.landscape .header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid var(--ink-black);
  padding-bottom: 2.5px;
  margin-bottom: 2.5px;
}

.landscape .main-title {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.landscape .cal-cell {
  border-right: 1px solid var(--ink-black);
  border-bottom: 1px solid var(--ink-black);
  height: 23.5mm;
  padding: 1.5px 2.5px;
  display: flex;
  flex-direction: column;
}

.landscape .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1.5px solid var(--ink-black);
  border-left: 1.5px solid var(--ink-black);
  flex: 1;
}

/* =========================================================
   TOAST BİLDİRİMİ
   ========================================================= */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111827;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   YAZDIRMA (PRINT) ÖZEL STİLLERİ
   ========================================================= */
@media print {
  html,
  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .toolbar,
  .toast {
    display: none !important;
  }

  .sheet-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .a4-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }

  .a4-sheet.portrait {
    width: 100% !important;
    height: 279mm !important;
    max-height: 279mm !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .a4-sheet.landscape {
    width: 100% !important;
    height: 194mm !important;
    max-height: 194mm !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
}

@page {
  size: A4 portrait;
  margin: 8mm 9mm;
}
