* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 450px;
  background: #2c3e50;
  color: #ecf0f1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar h1 {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #34495e;
}

.sidebar h2 {
  font-size: 16px;
  margin-top: 20px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #34495e;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar h2:hover {
  background: #3d566e;
}

.sidebar h2 .toggle {
  transition: transform 0.2s;
}

.sidebar h2.expanded .toggle {
  transform: rotate(180deg);
}

.count {
  font-size: 12px;
  background: #e74c3c;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

.section {
  margin-bottom: 20px;
}

.test-list {
  max-height: 300px;
  overflow-y: auto;
}

.test-list.collapsed,
.tree.collapsed {
  display: none;
}

.test-item {
  padding: 8px 12px;
  margin: 4px 0;
  background: #34495e;
  border-radius: 4px;
  transition: background 0.2s;
  word-wrap: break-word;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-item:hover {
  background: #3d566e;
}

.test-item.active {
  background: #3498db;
}

.test-item.completed-item {
  opacity: 0.7;
}

.delete-test-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.delete-test-btn:hover {
  opacity: 1;
  background: #c0392b;
}

/* Tree View */
.tree {
  font-size: 13px;
}

.tree-item {
  padding: 4px 8px;
  margin: 2px 0;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-item:hover {
  background: #34495e;
}

.tree-item.directory {
  font-weight: 500;
}

.tree-item.file {
  padding-left: 24px;
}

.tree-item .icon {
  margin-right: 6px;
  font-size: 10px;
  display: inline-block;
  width: 12px;
}

.tree-item .folder-icon {
  margin-right: 6px;
}

.tree-children {
  padding-left: 16px;
}

.tree-children.collapsed {
  display: none;
}

.delete-master-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.delete-master-btn:hover {
  opacity: 1;
  background: #c0392b;
}

.start-btn {
  font-size: 12px;
  padding: 2px 6px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-btn:hover {
  background: #2ecc71;
}

.create-btn {
  font-size: 12px;
  padding: 2px 6px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.create-btn:hover {
  opacity: 1;
  background: #2980b9;
}

.create-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.tree-item.directory:hover .create-actions {
  opacity: 1;
}

.masters-header-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: #34495e;
  border-radius: 4px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  overflow: hidden;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.breadcrumb {
  font-size: 13px;
  color: #666;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover {
  background: #229954;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

#editor {
  height: 100%;
  width: 100%;
}

/* Toast UI Editor overrides */
.toastui-editor-defaultUI {
  border: none;
}

.toastui-editor-toolbar {
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.toastui-editor-main {
  height: calc(100vh - 120px) !important;
}

.toastui-editor-ww-container,
.toastui-editor-md-container {
  padding: 24px;
}

.welcome {
  text-align: center;
  padding: 60px 24px;
  color: #7f8c8d;
}

.welcome h2 {
  margin-bottom: 16px;
}

/* Markdown Content */
.markdown-content {
  max-width: 900px;
  margin: 0 auto;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 24px;
  margin-bottom: 16px;
  color: #2c3e50;
}

.markdown-content h1 {
  font-size: 32px;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 12px;
}

.markdown-content h2 {
  font-size: 24px;
}

.markdown-content h3 {
  font-size: 20px;
}

.markdown-content p {
  margin-bottom: 16px;
}

.markdown-content ul,
.markdown-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.markdown-content li {
  margin-bottom: 8px;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.markdown-content table th,
.markdown-content table td {
  padding: 12px;
  text-align: left;
  border: 1px solid #ddd;
}

.markdown-content table th {
  background: #f8f9fa;
  font-weight: 600;
}

.markdown-content code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.markdown-content pre {
  background: #f4f4f4;
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.markdown-content pre code {
  background: none;
  padding: 0;
}

/* Interactive Checkboxes */
.markdown-content input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
  transform: scale(1.2);
}

.markdown-content input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.markdown-content li:has(input[type="checkbox"]) {
  list-style: none;
  margin-left: -20px;
}

/* Print Styles */
@media print {
  .sidebar,
  .toolbar {
    display: none;
  }

  .main-content {
    overflow: visible;
  }

  .content-area {
    padding: 0;
  }

  .markdown-content input[type="checkbox"] {
    -webkit-appearance: checkbox;
    appearance: checkbox;
  }
}
