:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

/* Dark mode variables */
:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border-color: #495057;
    --accent-color: #4dabf7;
    --accent-hover: #339af0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* System preference (only applies if no manual theme is set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #3a3a3a;
        --text-primary: #e9ecef;
        --text-secondary: #adb5bd;
        --border-color: #495057;
        --accent-color: #4dabf7;
        --accent-hover: #339af0;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

h1 small {
    font-size: 0.5em;
    color: var(--text-secondary);
    font-weight: 400;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.github-link:hover {
    background-color: var(--bg-tertiary);
}

.github-link img {
    width: 24px;
    height: 24px;
}

.toolbar {
    background-color: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.toolbar-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-group label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-value {
    background-color: var(--bg-secondary);
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

input[type="range"] {
    width: 150px;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.example-button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.example-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.editor-pane,
.preview-pane {
    background-color: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.pane-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 400px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: text;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea::placeholder {
    color: var(--text-secondary);
}

textarea::placeholder {
    color: var(--text-secondary);
}

.result-container {
    position: relative;
    flex: 1;
    min-height: 400px;
}

.code-block {
    width: 100%;
    height: 100%;
    padding: 15px;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    white-space: pre;
    line-height: 1;
    overflow: auto;
    color: var(--text-primary);
    cursor: default;
    user-select: text;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    transition: background-color 0.2s;
    z-index: 10;
}

.copy-button:hover {
    background-color: var(--accent-hover);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--accent-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.instructions-section {
    background-color: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-top: 30px;
}

.instructions-section h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.instructions-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.instruction-block {
    margin-bottom: 25px;
}

.instruction-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.code-example {
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-top: 10px;
}

.code-example pre {
    margin: 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-x: auto;
}

.code-example code {
    font-family: 'Roboto Mono', monospace;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

