/* FreeHand MX 11 & FreeHand AI — Vektörel Tuval ve Çalışma Alanı Stilleri */
:root {
  --fh-bg: #ece9d8; /* Windows/Mac Classic FreeHand gri tonu */
  --fh-canvas-bg: #606060; /* FreeHand tuval dışı boşluk rengi */
  --fh-page-bg: #ffffff; /* FreeHand çalışma paftası */
  --fh-border: #7f9db9;
  --fh-border-dark: #404040;
  --fh-border-light: #ffffff;
  --fh-text: #000000;
  --fh-bar-bg: #d4d0c8;
  --fh-btn-hover: #e0ded6;
  --fh-btn-active: #c0bcb0;
  --fh-selection: #0066cc;
  --fh-guide: #00ffff;
  
  /* Pantone Referans Renkleri */
  --pantone-captain: #ffd100; /* Pantone 109 C */
  --pantone-claude: #7b68ee;  /* Pantone 2728 C */
  --pantone-cursor: #ff8200;  /* Pantone 151 C */
  --pantone-ag: #00b140;      /* Pantone 368 C */
  --pantone-codex: #00a3e0;   /* Pantone Process Cyan */
  --pantone-error: #c8102e;   /* Pantone 186 C */
  --pantone-gray: #8a8d8f;    /* Pantone Cool Gray 7 C */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body.freehand-app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  font-size: 11px;
  background-color: var(--fh-bar-bg);
  color: var(--fh-text);
  display: flex;
  flex-direction: column;
}

/* 1. Üst Menü Çubuğu (Menu Bar) */
.fh-menubar {
  height: 24px;
  background: linear-gradient(180deg, #fbfaf8 0%, #ece9d8 100%);
  border-bottom: 1px solid #999;
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 2px;
  z-index: 100;
}

.fh-menu-item {
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  position: relative;
  font-size: 11px;
}

.fh-menu-item:hover, .fh-menu-item.active {
  background-color: var(--fh-selection);
  color: #fff;
}

.fh-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #7f9db9;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.25);
  min-width: 170px;
  z-index: 1000;
  padding: 2px 0;
  color: #000;
}

.fh-menu-item.open .fh-dropdown {
  display: block;
}

.fh-dropdown-item {
  padding: 4px 18px 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}

.fh-dropdown-item:hover {
  background-color: var(--fh-selection);
  color: #fff;
}

.fh-dropdown-item .shortcut {
  color: #888;
  font-size: 10px;
  margin-left: 16px;
}
.fh-dropdown-item:hover .shortcut {
  color: #ddd;
}

.fh-dropdown-sep {
  height: 1px;
  background: #d4d0c8;
  margin: 3px 1px;
}

/* 2. Standart Araç Çubuğu (Main Toolbar) */
.fh-toolbar {
  height: 28px;
  background-color: var(--fh-bar-bg);
  border-bottom: 1px solid #808080;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 3px;
  z-index: 90;
}

.fh-tool-btn {
  width: 24px;
  height: 22px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.fh-tool-btn {
  width: auto;
  min-width: 24px;
  padding: 0 6px;
  white-space: nowrap;
}

.fh-tool-btn:hover {
  background-color: var(--fh-btn-hover);
  border: 1px solid #7f9db9;
}

.fh-tool-btn:active, .fh-tool-btn.active {
  background-color: var(--fh-btn-active);
  border: 1px solid #404040;
}

.fh-toolbar-sep {
  width: 1px;
  height: 18px;
  background: #a0a0a0;
  margin: 0 4px;
}

.fh-zoom-select {
  height: 20px;
  font-size: 11px;
  border: 1px solid #7f9db9;
  padding: 0 2px;
  background: #fff;
}

/* 3. Ana Çalışma Alanı (Workspace Container) */
.fh-workspace {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
  background-color: var(--fh-canvas-bg);
}

/* Cetveller (Rulers) */
.fh-ruler-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  background: #e0ded6;
  border-right: 1px solid #a0a0a0;
  border-bottom: 1px solid #a0a0a0;
  z-index: 50;
  cursor: pointer;
}

.fh-ruler-x {
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 16px;
  background: #f0eee6;
  border-bottom: 1px solid #a0a0a0;
  overflow: hidden;
  z-index: 40;
}

.fh-ruler-y {
  position: absolute;
  top: 16px;
  left: 0;
  bottom: 0;
  width: 16px;
  background: #f0eee6;
  border-right: 1px solid #a0a0a0;
  overflow: hidden;
  z-index: 40;
}

.fh-ruler-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sonsuz Tuval (Infinite Canvas Viewport) */
.fh-canvas-viewport {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 0;
  bottom: 0;
  overflow: hidden;
  cursor: default;
}

.fh-canvas-viewport.tool-hand {
  cursor: grab;
}
.fh-canvas-viewport.tool-hand.dragging {
  cursor: grabbing;
}
.fh-canvas-viewport.tool-zoom {
  cursor: zoom-in;
}
.fh-canvas-viewport.tool-pen {
  cursor: crosshair;
}
.fh-canvas-viewport.tool-text {
  cursor: text;
}

.fh-canvas-world {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}

/* FreeHand Pafta Kağıdı (Artboard / Page) */
.fh-artboard {
  position: absolute;
  background: var(--fh-page-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid #202020;
}

.fh-artboard-title {
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 11px;
  font-weight: bold;
  color: #e0e0e0;
  letter-spacing: 0.5px;
}

/* Grid & SVG Katmanları */
.fh-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fh-svg-layer * {
  pointer-events: auto;
}

/* FreeHand Vektör Kartları (Mesaj / İstasyon Kutuları) */
.fh-node-card {
  position: absolute;
  background: #ffffff;
  border: 1.5px solid #333333;
  border-radius: 4px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
  cursor: move;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: box-shadow 0.1s ease;
}

.fh-node-card:hover {
  box-shadow: 0 0 0 2px var(--fh-selection);
}

.fh-node-card.selected {
  outline: 2px solid var(--fh-selection);
  box-shadow: 0 0 8px rgba(0, 102, 204, 0.6);
}

.fh-card-header {
  padding: 4px 6px;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 10px;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

.fh-card-seq {
  background: rgba(0,0,0,0.25);
  padding: 1px 4px;
  border-radius: 2px;
  font-family: monospace;
}

.fh-card-author {
  flex: 1;
  margin-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fh-card-body {
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.35;
  color: #222;
  user-select: text;
  -webkit-user-select: text;
  max-height: 180px;
  overflow-y: auto;
  word-break: break-word;
}

.fh-card-footer {
  padding: 3px 6px;
  background: #f8f8f8;
  border-top: 1px solid #eaeaea;
  font-size: 9px;
  color: #777;
  display: flex;
  justify-content: space-between;
}

/* Bezier Bağlantı Çizgisi */
.fh-bezier-edge {
  fill: none;
  stroke: #777777;
  stroke-width: 2px;
  stroke-linecap: round;
  transition: stroke 0.15s, stroke-width 0.15s;
}

.fh-bezier-edge:hover {
  stroke: var(--fh-selection);
  stroke-width: 3.5px;
  cursor: pointer;
}

.fh-bezier-edge.highlight {
  stroke: var(--pantone-captain);
  stroke-width: 3px;
}

/* FreeHand Neural Wire & Handoff Bus */
.fh-bezier-edge.fh-kaptan-omurga {
  stroke: var(--pantone-captain);
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 3px rgba(255, 209, 0, 0.6));
}

.fh-bezier-edge.fh-bayrak-devri {
  stroke: #00d166;
  stroke-width: 2.8px;
  stroke-dasharray: 6 3;
}

.fh-bezier-edge.fh-mutabakat {
  stroke: #0055ea;
  stroke-width: 3px;
}

/* 4. Sol Yüzer Araç Paleti (FreeHand Tools Floating Palette) */
.fh-palette-tools {
  position: absolute;
  top: 32px;
  left: 32px;
  width: 58px;
  background: var(--fh-bar-bg);
  border: 2px outset #ffffff;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.fh-palette-header {
  height: 18px;
  background: linear-gradient(90deg, #0055ea 0%, #3688ff 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: move;
}

.fh-palette-header .close-btn {
  font-size: 10px;
  cursor: pointer;
}

.fh-tools-grid {
  display: grid;
  grid-template-columns: 26px 26px;
  gap: 2px;
  padding: 2px;
  background: var(--fh-bar-bg);
}

.fh-p-btn {
  width: 26px;
  height: 24px;
  border: 1px outset #eee;
  background: #d4d0c8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.fh-p-btn:hover {
  background: #e8e4dc;
}

.fh-p-btn.active {
  border: 1px inset #666;
  background: #bfb8ab;
}

/* Color Well (Renk Kuyusu) */
.fh-color-well {
  height: 38px;
  padding: 4px;
  background: var(--fh-bar-bg);
  border-top: 1px solid #999;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fh-well-stroke {
  width: 20px;
  height: 20px;
  border: 1px solid #000;
  background: #000000;
  position: absolute;
  top: 6px;
  left: 10px;
  z-index: 2;
  cursor: pointer;
}

.fh-well-fill {
  width: 20px;
  height: 20px;
  border: 1px solid #000;
  background: #ffd100;
  position: absolute;
  bottom: 6px;
  right: 10px;
  z-index: 1;
  cursor: pointer;
}

/* 5. Sağ Yüzer Paneller (Layers & Inspector & Swatches) */
.fh-floating-panel {
  position: absolute;
  right: 16px;
  width: 240px;
  background: var(--fh-bar-bg);
  border: 2px outset #ffffff;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.fh-panel-layers {
  top: 32px;
  height: 210px;
}

.fh-panel-inspector {
  top: 252px;
  height: 250px;
}

.fh-panel-swatches {
  top: 512px;
  height: 180px;
}

.fh-panel-body {
  flex: 1;
  background: #ffffff;
  margin: 2px;
  border: 1px inset #888;
  overflow-y: auto;
  font-size: 11px;
}

/* Katmanlar Listesi */
.fh-layer-row {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.fh-layer-row:hover {
  background: #f0f4f8;
}

.fh-layer-row.active {
  background: #d4e5ff;
}

.fh-layer-icon {
  margin-right: 6px;
  cursor: pointer;
  font-size: 11px;
}

.fh-layer-name {
  flex: 1;
}

/* Inspector Form Alanları */
.fh-inspect-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px solid #f4f4f4;
  align-items: center;
}

.fh-inspect-label {
  color: #666;
  font-size: 10px;
}

.fh-inspect-value {
  font-weight: 500;
  font-family: monospace;
  font-size: 11px;
}

.fh-inspect-raw {
  padding: 6px 8px;
  font-family: monospace;
  font-size: 10px;
  background: #fdfdfd;
  max-height: 110px;
  overflow-y: auto;
  user-select: text;
  -webkit-user-select: text;
  white-space: pre-wrap;
  border-top: 1px solid #eee;
}

/* Swatches Grid */
.fh-swatches-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 6px;
}

.fh-swatch-box {
  width: 26px;
  height: 26px;
  border: 1px solid #333;
  cursor: pointer;
  border-radius: 2px;
  position: relative;
}

.fh-swatch-box:hover {
  transform: scale(1.1);
  outline: 1px solid #fff;
  z-index: 5;
}

/* 6. Alt Durum Çubuğu (Status Bar) */
.fh-statusbar {
  height: 22px;
  background-color: var(--fh-bar-bg);
  border-top: 1px solid #808080;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  z-index: 100;
}

.fh-status-left, .fh-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fh-status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fh-status-item span.coord {
  font-family: monospace;
}

.fh-status-btn {
  background: #e1ded6;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  padding: 1px 6px;
  cursor: pointer;
  font-size: 10px;
  text-decoration: none;
  color: #000;
}

.fh-status-btn:hover {
  background: #fff;
}
