:root {
	--primary-color: #6366f1;
	--secondary-color: #8b5cf6;
	--accent-color: #06b6d4;
	--success-color: #10b981;
	--warning-color: #f59e0b;
	--danger-color: #ef4444;
	--dark-color: #1e293b;
	--light-color: #f8fafc;
	--border-color: #e2e8f0;
	--text-color: #334155;
}

body {
	background: #f4f6fb;
	min-height: 100vh;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	margin: 0;
	padding: 0;
}

.main-container {
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	margin: 40px auto;
	max-width: 1200px;
	overflow: hidden;
}

.json-editor, .yaml-output {
	font-family: 'JetBrains Mono', 'Courier New', monospace;
	font-size: 14px;
	line-height: 1.6;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 16px;
	min-height: 360px;
	resize: vertical;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.json-editor {
	background: #ffffff;
	color: #0f172a;
}

.yaml-output {
	background: #ffffff;
	color: #0f172a;
}

.json-editor:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
	outline: none;
}

.header-section {
	background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
	color: white;
	padding: 28px 0;
	text-align: center;
	border-bottom: 1px solid rgba(255,255,255,0.2);
	box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.header-section h1 {
	font-size: 2.25rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-section p {
	font-size: 1.05rem;
	opacity: 0.95;
	max-width: 700px;
	margin: 0 auto;
}

.tool-section {
	padding: 28px 32px;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--dark-color);
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.btn-group {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.btn {
	padding: 10px 18px;
	border: none;
	border-radius: 8px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.btn-primary {
	background: var(--primary-color);
	color: white;
}

.btn-primary:hover {
	background: #5856eb;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-success {
	background: var(--success-color);
	color: white;
}

.btn-success:hover {
	background: #059669;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning {
	background: var(--warning-color);
	color: white;
}

.btn-warning:hover {
	background: #d97706;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-danger {
	background: var(--danger-color);
	color: white;
}

.btn-danger:hover {
	background: #dc2626;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
	background: #6b7280;
	color: white;
}

.btn-secondary:hover {
	background: #4b5563;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.status-bar {
	background: var(--light-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
}

.status-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.status-icon {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--success-color);
}

.status-icon.error {
	background: var(--danger-color);
}

.status-icon.warning {
	background: var(--warning-color);
}

.editor-container {
	position: relative;
}

.copy-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #f1f5f9;
	color: #0f172a;
	border: 1px solid var(--border-color);
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.copy-btn:hover {
	background: #e2e8f0;
}

.stats-container {
	background: var(--light-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
	display: none;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
}

.stat-item {
	text-align: center;
	padding: 15px;
	background: white;
	border-radius: 8px;
	border: 1px solid var(--border-color);
}

.stat-value {
font-size: 1.5rem;
font-weight: 600;
color: var(--primary-color);
}

.stats-label {
font-size: 0.9rem;
color: var(--text-color);
margin-top: 5px;
}

.message-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
}

.message {
background: white;
border-radius: 8px;
padding: 15px 20px;
margin-bottom: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
border-left: 4px solid var(--success-color);
animation: slideIn 0.3s ease;
}

.message.error {
border-left-color: var(--danger-color);
}

.message.warning {
border-left-color: var(--warning-color);
}

.feature-card {
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
min-height: 140px;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
transform: translateY(-2px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.feature-card h6 {
margin: 6px 0 4px;
color: var(--dark-color);
}

.feature-card p {
margin: 0;
color: var(--text-color);
font-size: 0.92rem;
}

.info-panel {
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.info-panel .row ul li {
display: flex;
gap: 8px;
align-items: flex-start;
}

.description-section {
margin-top: 10px;
}

.section-title {
display: flex;
align-items: center;
gap: 8px;
}

/* Centered description wrapper after editors */
.jsonyaml-desc {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 24px !important;
  margin-bottom: 40px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .jsonyaml-desc {
    margin: 16px 12px 24px !important;
    max-width: 100% !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  }
}

@keyframes slideIn {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}

@media (max-width: 768px) {
  .main-container {
    margin: 12px;
    border-radius: 14px;
  }

  .tool-section {
    padding: 18px;
  }

  .header-section h1 {
    font-size: 1.6rem;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .json-editor, .yaml-output {
    min-height: 260px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet tweaks */
@media (max-width: 992px) {
  .main-container {
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Small phones */
@media (max-width: 480px) {
  .header-section p {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .copy-btn {
    top: 8px;
    right: 8px;
  }
}
