/* ===== CSS Variables - Neo Brutalism ===== */
:root {
    --black: #0a0a0a;
    --black-light: #1a1a1a;
    --black-lighter: #252525;
    --red-dark: #8B0000;
    --red: #B22222;
    --red-bright: #DC143C;
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --white: #FAFAFA;
    --gray: #888888;
    --gray-dark: #444444;
    --accent: #D4AF37;

    --border-width: 4px;
    --shadow-offset: 6px;
    --shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
    --shadow-gold: var(--shadow-offset) var(--shadow-offset) 0 var(--gold);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --container-width: 1400px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* ===== Container ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--black);
    border-bottom: var(--border-width) solid var(--white);
    padding: 16px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { display: flex; align-items: center; }

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    padding: 10px 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: var(--border-width) solid transparent;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
}

/* ===== Main ===== */
.main {
    flex: 1;
    padding: 120px 0 60px;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.page-icon {
    width: 80px;
    height: 80px;
    background: var(--red-dark);
    border: var(--border-width) solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 var(--gold);
    flex-shrink: 0;
}

.page-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.page-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.page-description {
    color: var(--gray);
    font-size: 1.1rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: var(--border-width) solid var(--white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--red-dark);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    background: var(--red);
    box-shadow: 2px 2px 0 var(--black);
    transform: translate(4px, 4px);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--gold);
}

.btn-secondary {
    background: var(--black-light);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-secondary:active {
    box-shadow: 2px 2px 0 var(--black);
    transform: translate(4px, 4px);
}

.btn-secondary:hover {
    background: var(--black-lighter);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--gold);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.hidden-input { display: none; }

/* ===== Editor Grid ===== */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ===== Options Panel ===== */
.options-panel {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* ===== Type Tabs ===== */
.type-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 24px;
}

.type-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--gray-dark);
    background: var(--black);
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s ease;
}

.type-tab + .type-tab { border-left: none; }

.type-tab svg {
    width: 20px;
    height: 20px;
}

.type-tab.active {
    background: var(--red-dark);
    color: var(--white);
    border-color: var(--white);
}

.type-tab:not(.active):hover {
    background: var(--black-lighter);
    color: var(--white);
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group > label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--black);
    border: 2px solid var(--gray-dark);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-dark);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 8px;
}

/* ===== Radio Options ===== */
.radio-options {
    display: flex;
    gap: 0;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input { display: none; }

.radio-custom {
    display: block;
    padding: 10px 14px;
    border: 2px solid var(--gray-dark);
    background: var(--black);
    color: var(--gray);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s;
}

.radio-label + .radio-label .radio-custom { border-left: none; }

.radio-label input:checked + .radio-custom {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

/* ===== Checkbox ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
}

/* ===== Section Divider ===== */
.section-divider {
    border-top: 2px solid var(--gray-dark);
    margin: 24px 0;
}

/* ===== Colors ===== */
.color-row {
    display: flex;
    gap: 20px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-label {
    font-size: 0.85rem;
    color: var(--gray);
}

.color-input {
    width: 44px;
    height: 44px;
    border: 2px solid var(--white);
    background: none;
    cursor: pointer;
    padding: 2px;
}

.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; }

/* ===== Slider ===== */
.flex-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.flex-label label {
    font-size: 0.95rem;
    font-weight: 600;
}

.value-display {
    font-family: var(--font-mono);
    color: var(--gold);
    font-weight: bold;
    font-size: 0.95rem;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: var(--black);
    border: 2px solid var(--gray-dark);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--white);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--white);
}

/* ===== Logo Upload ===== */
.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid var(--white);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-logo {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    background: var(--red-dark);
    border: 1px solid var(--white);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-remove-logo svg {
    width: 10px;
    height: 10px;
}

.btn-remove-logo:hover { background: var(--red-bright); }

/* ===== Preview Panel ===== */
.preview-panel {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 110px;
}

.panel-header {
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-dark);
    padding-bottom: 12px;
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.qr-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: var(--black);
    border: 2px solid var(--gray-dark);
    padding: 24px;
    margin-bottom: 16px;
}

.qr-placeholder {
    text-align: center;
    color: var(--gray-dark);
}

.qr-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
}

.qr-placeholder p {
    font-size: 0.95rem;
}

#qr-canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

/* ===== Raw Content ===== */
.raw-content {
    background: var(--black);
    border: 2px solid var(--gray-dark);
    padding: 12px 16px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.raw-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.raw-content code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gold);
    word-break: break-all;
}

/* ===== Download Actions ===== */
.download-actions {
    display: flex;
    gap: 12px;
}

.download-actions .btn {
    flex: 1;
}

/* ===== Footer ===== */
.footer {
    background: var(--red-dark);
    border-top: var(--border-width) solid var(--white);
    padding: 30px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--gray-dark); border: 2px solid var(--black); }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
        text-align: center;
    }

    .page-title { font-size: 2rem; }

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

    .preview-panel {
        position: static;
    }

    .type-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .type-tab + .type-tab { border-left: 2px solid var(--gray-dark); }
    .type-tab:nth-child(1),
    .type-tab:nth-child(2) { border-bottom: none; }

    .radio-options { flex-direction: column; }
    .radio-label + .radio-label .radio-custom {
        border-left: 2px solid var(--gray-dark);
        border-top: none;
    }

    .download-actions {
        flex-direction: column;
    }

    .btn { justify-content: center; }
}
