/* QR Generator Specific Styles */

/* QR Type Selection */
.qr-type-section {
    padding: 3rem;
    text-align: center;
}

.type-header {
    margin-bottom: 3rem;
}

.type-header h2 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.type-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.qr-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.qr-type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.qr-type-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.qr-type-card.active {
    border-color: #667eea;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.qr-type-card.active .type-icon {
    background: #667eea;
    color: white;
}

.type-icon {
    background: #f1f5f9;
    color: #64748b;
    padding: 1rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.qr-type-card h3 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.qr-type-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

/* Input Section */
.input-section {
    padding: 3rem;
    border-top: 1px solid #e2e8f0;
}

.input-form {
    display: none;
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.input-form.active {
    display: block;
}

.input-form h3 {
    color: #1e293b;
    margin: 0 0 2rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.generate-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

#generateBtn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* QR Display Section */
.qr-display-section {
    padding: 3rem;
    border-top: 1px solid #e2e8f0;
}

.qr-header {
    text-align: center;
    margin-bottom: 3rem;
}

.qr-header h2 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.qr-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.qr-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 3rem;
    justify-content: center;
}

.qr-code-display {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.qr-info {
    flex: 1;
    max-width: 400px;
}

.qr-type-display,
.qr-content-preview {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.qr-type-display strong,
.qr-content-preview strong {
    color: #374151;
    display: block;
    margin-bottom: 0.5rem;
}

.qr-content-preview #displayQrContent {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: #4b5563;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* QR Customization */
.qr-customization {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
}

.qr-customization h3 {
    color: #1e293b;
    margin: 0 0 2rem 0;
    font-size: 1.4rem;
    text-align: center;
}

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

.customization-actions {
    text-align: center;
}

/* Download Section */
.download-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.download-section h3 {
    color: #1e293b;
    margin: 0 0 2rem 0;
    font-size: 1.4rem;
}

.download-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.download-actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
}

/* Canvas Styling */
#qrCanvas {
    display: block;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

/* Success/Error Messages */
.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

/* Required field styling */
.form-group label[for$="Input"]::after,
.form-group label[for$="FirstName"]::after,
.form-group label[for$="LastName"]::after,
.form-group label[for$="Ssid"]::after,
.form-group label[for$="Address"]::after,
.form-group label[for$="Number"]::after,
.form-group label[for$="Lat"]::after,
.form-group label[for$="Lng"]::after {
    content: " *";
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .qr-type-section,
    .input-section,
    .qr-display-section {
        padding: 2rem 1.5rem;
    }
    
    .qr-types-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .qr-type-card {
        padding: 1.5rem 1rem;
    }
    
    .qr-type-card h3 {
        font-size: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .generate-actions,
    .download-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .generate-actions button,
    .download-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .qr-container {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }
    
    .qr-info {
        max-width: 100%;
        width: 100%;
    }
    
    .customization-grid {
        grid-template-columns: 1fr;
    }
    
    .type-icon {
        padding: 0.75rem;
    }
    
    .type-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .qr-type-section,
    .input-section,
    .qr-display-section {
        padding: 1.5rem 1rem;
    }
    
    .type-header h2,
    .qr-header h2 {
        font-size: 1.5rem;
    }
    
    .input-form,
    .qr-customization,
    .download-section {
        padding: 1.5rem;
    }
    
    .qr-code-display {
        padding: 1rem;
    }
    
    #qrCanvas {
        max-width: 250px;
    }
    
    .qr-types-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-type-card {
        padding: 1rem;
    }
}

/* Animation for QR code generation */
.qr-generating {
    opacity: 0.7;
    pointer-events: none;
}

.qr-generating #qrCanvas {
    filter: blur(2px);
}

/* Fade in animation for QR display */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.qr-display-section {
    animation: fadeIn 0.5s ease-out;
}

/* Color input styling */
input[type="color"] {
    width: 60px !important;
    height: 40px;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 2px !important;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    color: inherit;
}

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