:root {
    /* Base Colors - Blue Default */
    --primary: #1e3a8a;
    --primary-light: #eff6ff;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.main-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

header p {
    color: var(--text-muted);
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"] {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Color Picker Custom */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Frame Grid */
.frame-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.frame-opt {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    background: var(--bg-body);
}

.frame-opt:hover {
    border-color: var(--primary);
}

.frame-opt.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* File Upload */
.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: 0.2s;
}

.file-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: -4px;
}

/* Buttons */
button {
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

#btnGenerate {
    background: var(--primary);
    color: white;
    margin-top: 10px;
}

#btnGenerate:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#btnDownload {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

#btnDownload:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

#btnDownload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
    min-height: 400px;
    justify-content: center;
}

.preview-header {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border-radius: 8px;
    min-height: 300px;
    padding: 20px;
}

.placeholder-qr {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.placeholder-qr svg {
    width: 64px;
    height: 64px;
    opacity: 0.2;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}