:root {
    --bg-color: #0f1115;
    --card-bg: #161b22;
    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --secondary: #21262d;
    --secondary-hover: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --error: #f85149;
    --success: #2ea043;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
header {
    text-align: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.badge {
    font-size: 0.8rem;
    background: var(--primary);
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

p {
    color: var(--text-muted);
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"] {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-main);
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    letter-spacing: 2px;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.3em;
    font-weight: 600;
}

.error-msg.hidden {
    opacity: 0;
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    background-color: var(--secondary);
    border-radius: 20px;
    position: relative;
    transition: background-color 0.2s;
    border: 1px solid var(--border);
}

.slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 1px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

input:checked + .slider {
    background-color: rgba(46, 160, 67, 0.2);
    border-color: var(--success);
}

input:checked + .slider::before {
    transform: translateX(19px);
    background-color: var(--success);
}

.label-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Preview Section */
.preview-section {
    background: #fff; /* Barcodes need white background */
    border-radius: 6px;
    padding: 2rem;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.barcode-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.barcode-container svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.placeholder-text {
    color: #ccc;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* Actions */
.actions-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background-color: var(--success);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn.primary:not(:disabled):hover {
    background-color: #3fb950;
}

.btn.secondary {
    background-color: var(--secondary);
    color: var(--text-main);
    border-color: var(--border);
}

.btn.secondary:not(:disabled):hover {
    background-color: var(--secondary-hover);
    border-color: #8b949e;
}

/* Footer Status Bar */
footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
