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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
.header {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.header-content h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex: 1;
    margin-bottom: 30px;
}

.form-section,
.result-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95em;
}

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

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.char-count {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85em;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker input[type="color"]:hover {
    border-color: var(--primary-color);
}

.color-text {
    flex: 1 !important;
    font-family: 'Courier New', monospace;
}

/* File Upload */
.file-upload {
    position: relative;
    margin-bottom: 10px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-light);
    font-size: 0.95em;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.file-label i {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.file-label span {
    color: var(--text-dark);
    font-weight: 500;
}

.file-upload.dragover .file-label {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.logo-preview {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.logo-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 5px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-download,
.btn-copy {
    background: var(--success-color);
    color: white;
    box-shadow: var(--shadow-md);
    padding: 10px 15px;
    font-size: 0.95em;
}

.btn-download:hover,
.btn-copy:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Result Section */
.result-header {
    margin-bottom: 20px;
}

.result-header h2 {
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3em;
}

.qr-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 300px;
}

.qr-display img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-weight: 500;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--error-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message:before {
    content: '⚠️';
    font-size: 1.2em;
}

/* Footer */
.footer {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.footer i {
    color: var(--error-color);
}

/* Small Screen */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .header-content h1 {
        font-size: 1.8em;
    }

    .button-group {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .header {
        padding: 20px;
        margin-bottom: 20px;
    }

    .form-section,
    .result-section {
        padding: 20px;
    }
}

/* Tab Navigation */
.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-button {
    padding: 10px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-button:hover {
    color: var(--text-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.color-picker {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.color-picker input[type="color"]:hover {
    border-color: var(--primary-color);
}

.color-text {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    background: var(--bg-light);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.success {
    color: var(--success-color);
}

.error {
    color: var(--error-color);
}

/* QR Code Style Options */
.style-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.style-option {
    position: relative;
}

.style-option input[type="radio"] {
    display: none;
}

.style-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-light);
    gap: 8px;
    font-size: 0.85em;
    font-weight: 500;
}

.style-label i {
    font-size: 1.8em;
    color: var(--text-light);
}

.style-option input[type="radio"]:checked + .style-label {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.style-option input[type="radio"]:checked + .style-label i {
    color: var(--primary-color);
}

.style-label:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

@media (max-width: 768px) {
    .tabs-container {
        flex-direction: column;
    }

    .style-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
