/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

/* Header Styles */
header {
    background: #ffffff;
    color: #333;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-type-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-type-selector label {
    font-weight: 600;
    color: #555;
}

.input-type-selector select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.input-type-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Input Forms */
.input-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.input-form label {
    font-weight: 600;
    color: #555;
}

.input-form input,
.input-form textarea,
.input-form select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-form input:focus,
.input-form textarea:focus,
.input-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* Customization Section */
.customization-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.customization-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.customization-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.color-controls,
.logo-upload,
.size-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-controls label,
.logo-upload label,
.size-control label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.color-controls input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Generate Button */
.generate-button {
    padding: 16px 32px;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 8px 16px rgba(0, 123, 255, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    transform: translateY(0);
}

.generate-button:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    transform: translateY(-3px);
    box-shadow: 
        0 12px 24px rgba(0, 123, 255, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.generate-button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0, 123, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.preview-container {
    text-align: center;
}

.preview-container h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.qr-display {
    min-height: 300px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qr-display .placeholder {
    color: #6c757d;
    font-style: italic;
}

.qr-display canvas,
.qr-display img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Download Section */
.download-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.download-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover:not(:disabled) {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

.download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.share-options {
    display: flex;
    gap: 12px;
}

.share-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.share-btn:hover:not(:disabled) {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

.share-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .customization-grid {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .share-options {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
}

/* Animation for smooth transitions */
.input-form {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}