.post-editor {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px; 
  background: linear-gradient(to right, rgba(99, 102, 241, 0.03), rgba(124, 58, 237, 0.08));
}

.editor-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}


.editor-body {
  padding: 25px;
  display: flex;
  flex-direction: row;
  gap: 25px;
}

.editor-form {
  flex: 1;
  min-width: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group.half {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1f2937;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

textarea.form-control {
  resize: vertical;
}

.content-editor {
  font-family: monospace;
  min-height: 300px;
  line-height: 1.6;
  height: calc(80vh - 300px);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  padding: 12px 15px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.editor-toolbar button, .editor-toolbar label {
  background: white;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  color: #4b5563;
  transition: all 0.2s ease;
  min-width: 40px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.editor-toolbar button:hover, .editor-toolbar label:hover {
  background-color: #f3f4f6;
  border-color: #7c3aed;
  color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(124, 58, 237, 0.15);
}

.editor-toolbar .upload-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 50%;
  border-top-color: #7c3aed;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.editor-toolbar button.uploading, .editor-toolbar label.uploading {
  color: transparent;
  pointer-events: none;
}

.file-input {
  display: none;
}

.toolbar-btn {
  font-family: Arial, sans-serif;
  font-size: 15px;
}

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

.toggle-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 12px;
  margin-right: 10px;
  transition: background-color 0.3s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-switch {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(26px);
}

.toggle-text {
  font-weight: 600;
  color: #4b5563;
}

.preview-section {
  flex: 1;
  min-width: 0;
  max-height: 80vh;
  overflow-y: auto;
  position: sticky;
  top: 25px;
  padding: 0;
  border: none;
  border-radius: 12px;
}

.preview-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #1f2937;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: white;
  padding: 10px 0;
  z-index: 10;
  border-bottom: 2px solid rgba(124, 58, 237, 0.1);
}

.markdown-preview {
  padding: 20px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  background-color: rgba(249, 250, 251, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  min-height: 400px;
}

.markdown-preview :deep(h1),
.markdown-preview :deep(h2),
.markdown-preview :deep(h3),
.markdown-preview :deep(h4),
.markdown-preview :deep(h5),
.markdown-preview :deep(h6) {
  margin-top: 1em;
  margin-bottom: 0.5em;
  color: #1f2937;
}

.markdown-preview :deep(p) {
  margin-bottom: 1em;
  line-height: 1.6;
}

.markdown-preview :deep(img) {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.markdown-preview :deep(a) {
  color: #7c3aed;
  text-decoration: none;
  border-bottom: 1px dashed #7c3aed;
  transition: all 0.3s ease;
}

.markdown-preview :deep(a:hover) {
  color: #6d28d9;
  border-bottom: 1px solid #6d28d9;
}

.markdown-preview :deep(blockquote) {
  border-left: 4px solid #7c3aed;
  padding-left: 15px;
  margin-left: 0;
  color: #4b5563;
  font-style: italic;
}

.markdown-preview :deep(code) {
  background-color: #f3f4f6;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
}

.markdown-preview :deep(pre) {
  background-color: #f3f4f6;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 15px 0;
}

.markdown-preview :deep(pre code) {
  background-color: transparent;
  padding: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: left 0.7s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(107, 114, 128, 0.4);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 992px) {
  .editor-body {
    flex-direction: column;
  }
  
  .preview-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    max-height: none;
    position: static;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .editor-body {
    padding: 15px;
  }
  
  .editor-toolbar {
    padding: 5px;
  }
  
  .editor-toolbar button {
    padding: 6px 10px;
    min-width: 30px;
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }
  
  .btn {
    width: 100%;
  }
}

.file-name-settings {
  margin-bottom: 15px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
}

.custom-file-name {
  margin-top: 15px;
  animation: fadeIn 0.3s ease;
}

.auto-file-name {
  margin-top: 10px;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-style: italic;
}

.form-text {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 5px;
}

.text-muted {
  color: #6b7280;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
