/* Inline Editor Styles */

#inline-editor-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid #ddd;
}

.inline-editor-btn {
  padding: 0.5em 1em;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: inherit;
}

.inline-editor-btn:hover {
  background: #000;
  color: #fff;
}

.inline-editor-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inline-editor-btn-secondary {
  background: #f5f5f5;
  border-color: #999;
  color: #333;
}

.inline-editor-btn-secondary:hover {
  background: #e0e0e0;
  color: #000;
}

/* Modal */
#inline-editor-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.inline-editor-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.inline-editor-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 90vh;
  margin: 5vh auto;
  background: #fff;
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.inline-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em 1.5em;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.inline-editor-header h3 {
  margin: 0;
  font-size: 1.2em;
}

.inline-editor-close {
  background: none;
  border: none;
  font-size: 2em;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1em;
  height: 1em;
  color: #666;
}

.inline-editor-close:hover {
  color: #000;
}

.inline-editor-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.inline-editor-body textarea {
  width: 100%;
  height: 100%;
  border: none;
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  padding: 1em;
  resize: none;
}

/* SimpleMDE overrides */
.inline-editor-body .CodeMirror {
  height: 100%;
  border: none;
  font-size: 0.95em;
}

.inline-editor-body .editor-toolbar {
  border: none;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.inline-editor-body .CodeMirror-scroll {
  min-height: auto;
}

.inline-editor-footer {
  padding: 1em 1.5em;
  border-top: 1px solid #ddd;
  background: #fafafa;
}

.inline-editor-footer input[type="text"] {
  width: 100%;
  padding: 0.5em;
  border: 1px solid #ddd;
  font-size: 0.9em;
  margin-bottom: 1em;
  font-family: inherit;
}

.inline-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.inline-editor-status {
  display: none;
  padding: 0.75em 1.5em;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
}

.inline-editor-status.success {
  background: #d4edda;
  color: #155724;
}

.inline-editor-status.error {
  background: #f8d7da;
  color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .inline-editor-container {
    width: 95%;
    height: 95vh;
    margin: 2.5vh auto;
  }

  #inline-editor-controls {
    flex-direction: column;
  }

  .inline-editor-actions {
    flex-direction: column;
  }

  .inline-editor-actions button {
    width: 100%;
  }
}
