:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.app-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.app-header p {
    color: var(--secondary-color);
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

.controls-section {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.control-group input[type="text"],
.control-group input[type="url"],
.control-group textarea,
.control-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.control-group textarea {
    min-height: 100px;
    resize: vertical;
}

.control-group input[type="text"]:focus,
.control-group input[type="url"]:focus,
.control-group textarea:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.color-options {
    display: flex;
    gap: 15px;
}

.color-options > div {
    flex: 1;
}

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

input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}

.preview-section {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-preview-container {
    width: 300px;
    height: 300px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    position: relative;
}

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

#qr-placeholder {
    text-align: center;
    color: var(--secondary-color);
}

#qr-placeholder i {
    font-size: 80px;
    margin-bottom: 15px;
    color: #ddd;
}

.download-options {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-download, .btn-warning {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #3a5bef;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-download {
    background-color: var(--success-color);
    color: white;
}

.btn-download:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

.history-section {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 30px;
}

.history-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.history-item {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.history-item img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.history-item p {
    margin-top: 5px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: var(--secondary-color);
    font-size: 14px;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}