/**
 * Dysheme Editor - Professional WYSIWYG Editor
 * CKEditor alternative - Custom built, no external dependencies
 */

.dysheme-editor {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dysheme-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f8f9fa 0%, #eef0f2 100%);
  border-bottom: 1px solid #e0e0e0;
  min-height: 44px;
}

.dysheme-editor-toolbar-group {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid #d0d5dc;
}

.dysheme-editor-toolbar-group:last-child {
  margin-right: 0;
  padding-right: 0;
  border-right: none;
}

.dysheme-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #495057;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 15px;
}

.dysheme-editor-btn:hover {
  background: rgba(0, 123, 255, 0.12);
  color: #007bff;
}

.dysheme-editor-btn:active,
.dysheme-editor-btn.active {
  background: rgba(0, 123, 255, 0.2);
  color: #0056b3;
}

.dysheme-editor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dysheme-editor-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.dysheme-editor-content {
  min-height: 280px;
  max-height: 500px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #212529;
  outline: none;
}

.dysheme-editor-content:empty::before {
  content: attr(data-placeholder);
  color: #adb5bd;
}

.dysheme-editor-content:focus {
  outline: none;
}

.dysheme-editor-content h1 { font-size: 1.75em; margin: 0.5em 0; font-weight: 600; }
.dysheme-editor-content h2 { font-size: 1.4em; margin: 0.5em 0; font-weight: 600; }
.dysheme-editor-content h3 { font-size: 1.2em; margin: 0.5em 0; font-weight: 600; }
.dysheme-editor-content p { margin: 0.5em 0; }
.dysheme-editor-content p[style*="text-align"],
.dysheme-editor-content div[style*="text-align"],
.dysheme-editor-content h1[style*="text-align"],
.dysheme-editor-content h2[style*="text-align"],
.dysheme-editor-content h3[style*="text-align"],
.dysheme-editor-content li[style*="text-align"] {
  /* Hizalama stilleri inline olarak uygulanır */
}
.dysheme-editor-content ul, .dysheme-editor-content ol { 
  margin: 0.5em 0; 
  padding-left: 2em; 
  line-height: 1.8;
}
.dysheme-editor-content ul { list-style-type: disc; }
.dysheme-editor-content ol { list-style-type: decimal; }
.dysheme-editor-content ul ul, .dysheme-editor-content ol ol,
.dysheme-editor-content ul ol, .dysheme-editor-content ol ul {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}
.dysheme-editor-content li { 
  margin: 0.25em 0;
  padding-left: 0.25em;
}
.dysheme-editor-content blockquote { margin: 0.5em 0; padding-left: 1em; border-left: 4px solid #dee2e6; color: #6c757d; }
.dysheme-editor-content img { max-width: 100%; height: auto; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.dysheme-editor-content img:hover { border-color: #007bff; }
.dysheme-editor-content img.selected { border-color: #007bff; outline: 2px solid rgba(0,123,255,0.3); }
.dysheme-editor-content a { 
  color: #007bff; 
  text-decoration: underline; 
  cursor: pointer;
}
.dysheme-editor-content a:hover { 
  color: #0056b3; 
  text-decoration: underline;
}
.dysheme-editor-content table { border-collapse: collapse; width: 100%; }
.dysheme-editor-content td, .dysheme-editor-content th { border: 1px solid #dee2e6; padding: 8px; }

.dysheme-editor-footer {
  padding: 6px 12px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  color: #6c757d;
}

/* Modal for link/image dialogs */
.dysheme-editor-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dysheme-editor-modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  min-width: 400px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.dysheme-editor-modal h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
}

.dysheme-editor-modal .form-group {
  margin-bottom: 16px;
}

.dysheme-editor-modal label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
}

.dysheme-editor-modal input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.dysheme-editor-modal .form-row {
  display: flex;
  gap: 12px;
}

.dysheme-editor-modal .form-row .form-group {
  flex: 1;
}

.dysheme-editor-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.dysheme-editor-modal-buttons button {
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.dysheme-editor-modal-buttons .btn-cancel {
  background: #e9ecef;
  color: #495057;
}

.dysheme-editor-modal-buttons .btn-ok {
  background: #007bff;
  color: #fff;
}

.dysheme-editor-modal-buttons .btn-ok:hover {
  background: #0056b3;
}
