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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.input-section,
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

textarea,
input[type="text"],
input[type="number"],
select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="color"] {
    width: 100%;
    height: 50px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.file-label:hover {
    background: #e2e8f0;
}

.center-image-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

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

.canvas-container {
    position: relative;
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr-canvas {
    display: none;
    max-width: 100%;
    height: auto;
}

#qr-canvas.visible {
    display: block;
}

.placeholder {
    text-align: center;
    color: var(--text-muted);
}

.placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.placeholder p {
    font-size: 0.9rem;
}

footer {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: var(--radius);
    text-align: center;
}

footer p {
    color: #92400e;
    font-size: 0.9rem;
}

footer strong {
    color: #78350f;
}

.icon-type-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.icon-tab {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.icon-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.icon-section {
    margin-top: 0.5rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.emoji-option {
    font-size: 2rem;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: white;
}

.emoji-option:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.emoji-option.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

@media (max-width: 768px) {
    .generator {
        grid-template-columns: 1fr;
    }

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

    h1 {
        font-size: 2rem;
    }
}
