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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Sections */
section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Suggestions Grid */
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.suggestion-card {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.suggestion-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.suggestion-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.suggestion-card .title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.suggestion-card .description {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Input Section */
.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

#qr-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

#qr-input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Buttons */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    border-color: var(--secondary);
}

/* QR Display */
.qr-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: var(--background);
    border-radius: var(--radius);
    padding: 2rem;
}

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

.placeholder p {
    margin-top: 1rem;
    font-size: 0.95rem;
}

#qr-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Download Section */
.download-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--success);
    color: white;
}

.btn-download:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-download span {
    font-size: 1rem;
}

.btn-download small {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
}

.size-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.size-options label {
    font-weight: 600;
}

.size-options select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.size-options select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    color: var(--text-light);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--background);
    color: var(--text);
}

.modal-form {
    padding: 1.5rem;
}

/* Form Fields */
.form-field {
    margin-bottom: 1.5rem;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.required-mark {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

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

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.checkbox-field {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
}

.modal-cancel {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }

    section {
        padding: 1.5rem;
    }

    .suggestions-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

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

    .btn-primary, .btn-secondary {
        width: 100%;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-form {
        padding: 1rem;
    }

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