* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;

}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.tool-description {
  font-size: 16px;
  opacity: 0.9;
  max-width: 95%;
  margin: auto;
  line-height: 1.6;
}

.controls {
  padding: 15px 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  background: #cfd8e4;
  color: #2c3e50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn:hover {
  background: #b7c2d1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-download {
  background: #27ae60;
  color: white;
}

.btn-download:hover {
  background: #219653;
}

.btn-copy {
  background: #3498db;
  color: white;
}

.btn-copy:hover {
  background: #2980b9;
}

.btn-clear {
  background: #e74c3c;
  color: white;
}

.btn-clear:hover {
  background: #c0392b;
}

.btn-json {
  background: #9b59b6;
  color: white;
}

.btn-json:hover {
  background: #8e44ad;
}

.main-content {
  display: flex;
  height: calc(100vh - 230px);
  min-height: 500px;
  gap: 20px;
}

.editor-section {
  width: 50%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 6px;
}

.preview-section {
  width: 50%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 6px;
}

.preview-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
}

.tab {
  padding: 8px 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tab.active {
  border-bottom: 3px solid #3498db;
  background: white;
  color: #3498db;
}

.tab:hover:not(.active) {
  background: #edf2f7;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

h2 {
  font-size: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-container {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fcfcfc;
  position: relative;
}

#yaml-editor {
  width: 100%;
  height: 100%;
  padding: 20px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 15px;
  line-height: 1.5;
  border: none;
  resize: none;
  background: #fcfcfc;
  color: #333;
  tab-size: 2;
}

#yaml-editor:focus {
  outline: none;
}

.preview-container {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: auto;
  padding: 20px;
  margin: 20px;
  background: #fcfcfc;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre;
  display: none;
}

.preview-container.active {
  display: block;
}

.error-container {
  padding: 15px;
  background: #ffebee;
  border-radius: 6px;
  border-left: 4px solid #e74c3c;
  display: none;
  margin: 20px;
  margin-top: 0;
}

.error-title {
  font-weight: 600;
  color: #c0392b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.instructions {
  background: #e3f2fd;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #3498db;
}

.instructions h3 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions ul {
  padding-left: 25px;
  line-height: 1.8;
}

.instructions li {
  margin-bottom: 10px;
}

.status-bar {
  padding: 10px 30px;
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.valid-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.valid {
  color: #27ae60;
}

.invalid {
  color: #e74c3c;
}

/* Syntax highlighting */
.key {
  color: #2980b9;
  font-weight: bold;
}

.string {
  color: #27ae60;
}

.number {
  color: #e67e22;
}

.boolean {
  color: #9b59b6;
}

.null {
  color: #7f8c8d;
}

.colon {
  color: #34495e;
}

.dash {
  color: #34495e;
}

.comment {
  color: #95a5a6;
  font-style: italic;
}

/* JSON specific */
.json-brace {
  color: #34495e;
  font-weight: bold;
}

.json-bracket {
  color: #34495e;
  font-weight: bold;
}

.conversion-info {
  padding: 10px 20px;
  padding-top: 0;
  position: relative;
  top: -5px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  text-align: center;
  gap: 8px;
}
