.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  background-color: #f5f5f5;
  font-family: 'Noto Sans KR', sans-serif;
  /* Application default font */
}

/* Register Custom Font */
@font-face {
  font-family: 'Noto Sans KR';
  src: url('../fonts/NotoSansKR-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

.toolbar {
  display: flex;
  gap: 15px;
  padding: 8px 12px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  align-items: stretch;
  flex-wrap: wrap;
  border-bottom: 2px solid #f0f0f0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 15px;
  border-right: 1px solid #eee;
  position: relative;
}

.toolbar-group:last-child {
  border-right: none;
}

.group-label {
  font-size: 11px;
  color: #888;
  position: absolute;
  top: -6px;
  left: 0;
  font-weight: bold;
  display: none;
  /* Minimalist: hide label or simple layout */
}

/* Optional: Label on top logic if we want, but row is better */

.toolbar label {
  font-weight: 500;
  color: #444;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.compact-input,
.compact-select {
  margin-left: 5px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  max-width: 80px;
}

.compact-select {
  max-width: 120px;
}

.color-input {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  margin-left: 5px;
  cursor: pointer;
}

.checkbox-label {
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  margin-right: 5px;
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.primary-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  transition: background-color 0.2s;
}

.primary-btn:hover {
  background-color: #45a049;
}

.primary-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.secondary-btn {
  background-color: #646cff;
  /* Violete */
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  transition: background-color 0.2s;
}

.secondary-btn:hover {
  background-color: #535bf2;
}

/* Status Bar */
.status-bar {
  background-color: #222;
  color: #eee;
  padding: 4px 15px;
  font-size: 12px;
  display: flex;
  gap: 20px;
  margin-top: auto;
  /* Push to bottom if container is flex col */
  align-items: center;
}

.status-item {
  font-family: monospace;
}

.editor-wrapper-outer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: white;
  border-radius: 8px;
  border-radius: 8px 8px 0 0;
  /* Rounded top only */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 0px;
  /* Connect to status bar if needed, or keeping it separate */
}

.editor-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Ensure TinyMCE fills the container */
.tox-tinymce {
  flex: 1;
  width: 100% !important;
  border: none !important;
}

.hint {
  margin-top: 10px;
  text-align: center;
  color: #666;
  font-size: 0.9em;
}

/* Preview Modal Styles */
.preview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.preview-modal-content {
  background: white;
  width: 90%;
  height: 90%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

.preview-header {
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f9f9;
}

.preview-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.preview-body {
  flex: 1;
  overflow: auto;
  /* Allow native scroll */
  background-color: #e5e5e5;
  display: flex;
  justify-content: center;
  /* Center horizontally if width < 100% */
  align-items: flex-start;
  /* Start from top to allow scrolling down properly */
  padding: 20px;
}

.preview-scroll-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.preview-body img {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  display: block;
}

.save-btn {
  background-color: #007bff;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
  font-weight: bold;
}

.save-btn:hover {
  background-color: #0056b3;
}

.close-btn {
  background-color: #6c757d;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.format-btn {
  background-color: #2196F3;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  margin-right: 5px;
  transition: background-color 0.2s;
}

.format-btn:hover {
  background-color: #1976D2;
}

.format-btn.html {
  background-color: #ff9800;
}

.format-btn.html:hover {
  background-color: #f57c00;
}

.preview-title-group {
  display: flex;
  align-items: center;
}

.export-actions-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.close-btn:hover {
  background-color: #5a6268;
}

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  /* Higher than everything */
}

.loading-content {
  background: white;
  padding: 30px 50px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-content p {
  margin: 0;
  font-weight: bold;
  color: #333;
}