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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 24px;
    font-size: 1.75rem;
}

.input-section {
    margin-bottom: 24px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-selector label {
    color: #666;
    font-size: 0.9rem;
}

select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #4a90d9;
}

.buttons {
    display: flex;
    gap: 8px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

#generate-btn {
    background: #4a90d9;
    color: white;
}

#generate-btn:hover {
    background: #3a7bc8;
}

#clear-btn {
    background: #e0e0e0;
    color: #333;
}

#clear-btn:hover {
    background: #d0d0d0;
}

.output-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    margin-bottom: 16px;
}

#qr-canvas {
    display: none;
    border-radius: 8px;
}

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

#download-btn {
    background: #2ecc71;
    color: white;
    padding: 12px 32px;
    font-size: 1rem;
}

#download-btn:hover:not(:disabled) {
    background: #27ae60;
}

#download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .size-selector {
        justify-content: space-between;
    }

    .buttons {
        justify-content: stretch;
    }

    .buttons button {
        flex: 1;
    }
}
