/* ── Style Manager — page-specific ── */

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

:root {
    --bg: #06060e;
    --surface: #0d0d1c;
    --surface2: #141428;
    --surface3: #1c1c35;
    --border: #252540;
    --border2: #353560;
    --accent: #7b61ff;
    --accent2: #ff6b9d;
    --accent3: #00e5a0;
    --green: #00e5a0;
    --red: #ff4d6d;
    --yellow: #ffd166;
    --blue: #4da6ff;
    --text: #eeeeff;
    --muted: #6666a0;
    --muted2: #4a4a7a;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-w, 220px);
    flex: 1;
    padding: 24px;
    display: flex;
    gap: 24px;
}

.left-column {
    flex: 1;
    max-width: 500px;
}

.right-column {
    flex: 1.2;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.style-count {
    background: var(--surface2);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--muted);
}

.add-button {
    margin-left: auto;
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 13px;
}

.add-button:hover {
    background: #8d7aff;
}

.styles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.style-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.style-card:hover {
    border-color: var(--accent);
    background: var(--surface3);
}

.style-card-header {
    padding: 16px;
    border-left: 4px solid;
    display: flex;
    gap: 12px;
}

.style-card:nth-child(1) .style-card-header { border-left-color: var(--accent); }
.style-card:nth-child(2) .style-card-header { border-left-color: var(--accent2); }
.style-card:nth-child(3) .style-card-header { border-left-color: var(--accent3); }
.style-card:nth-child(4) .style-card-header { border-left-color: var(--blue); }

.style-info {
    flex: 1;
}

.style-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.style-description {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.style-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: var(--surface3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--muted);
}

.style-stats {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.style-actions {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    background: var(--surface3);
}

.btn-small {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Noto Sans Thai', sans-serif;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--border);
}

.detail-header {
    background: linear-gradient(135deg, #7b61ff 0%, #8d7aff 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.detail-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-section {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.detail-section-title {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--muted);
}

input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 13px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--muted);
}

.info-value {
    font-weight: 600;
}

.code-block {
    background: var(--surface3);
    padding: 16px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 250px;
    overflow-y: auto;
}

.code-keyword { color: var(--accent2); }
.code-string { color: var(--accent3); }
.code-number { color: var(--yellow); }

.test-input {
    width: 100%;
    padding: 12px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 13px;
    margin-bottom: 12px;
}

.test-button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 14px;
    margin-bottom: 16px;
}

.test-button:hover {
    background: #8d7aff;
}

.preview-box {
    background: var(--surface3);
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.btn-action {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-save {
    background: var(--accent);
}

.btn-save:hover {
    background: #8d7aff;
}

.btn-duplicate {
    background: var(--surface3);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-duplicate:hover {
    background: var(--border);
}

.btn-delete {
    background: var(--red);
    flex: 0.5;
}

.btn-delete:hover {
    background: #ff5a79;
}
