/* QR Code Customization Styles */
.qr-customization-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.customization-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.customization-header h3 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.customization-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-button.active {
    color: #5D82D5;
    border-bottom-color: #5D82D5;
    background: rgba(93, 130, 213, 0.05);
}

.tab-button:hover {
    color: #5D82D5;
    background: rgba(93, 130, 213, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Logo Upload Section */
.logo-upload-section {
    margin-bottom: 24px;
}

.logo-upload-area {
    border: 2px dashed #5D82D5;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    background: rgba(93, 130, 213, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.logo-upload-area:hover {
    border-color: #4a6bc4;
    background: rgba(93, 130, 213, 0.05);
}

.logo-upload-area.dragover {
    border-color: #4a6bc4;
    background: rgba(93, 130, 213, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    color: #5D82D5;
    margin-bottom: 16px;
}

.upload-text {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-subtext {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.upload-button {
    background: #5D82D5;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.upload-button:hover {
    background: #4a6bc4;
}

.logo-preview {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 16px;
}

.logo-preview.show {
    display: flex;
}

.logo-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
}

.logo-info {
    flex: 1;
}

.logo-name {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.logo-size {
    color: #666;
    font-size: 14px;
}

.remove-logo {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.remove-logo:hover {
    background: #c0392b;
}

/* Logo Position Controls */
.logo-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.control-group {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.control-label {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.position-option {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.position-option:hover {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.05);
}

.position-option.active {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.1);
}

.position-option::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #5D82D5;
    border-radius: 50%;
}

.position-option[data-position="center"]::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.position-option[data-position="top-left"]::after {
    position: absolute;
    top: 25%;
    left: 25%;
}

.position-option[data-position="top-right"]::after {
    position: absolute;
    top: 25%;
    right: 25%;
}

.position-option[data-position="bottom-left"]::after {
    position: absolute;
    bottom: 25%;
    left: 25%;
}

.position-option[data-position="bottom-right"]::after {
    position: absolute;
    bottom: 25%;
    right: 25%;
}

/* Size and Shape Controls */
.size-slider {
    width: 100%;
    margin: 12px 0;
}

.slider-container {
    position: relative;
    margin: 16px 0;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5D82D5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5D82D5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    position: absolute;
    right: 0;
    top: -25px;
    background: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.shape-options {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.shape-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.shape-option:hover {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.05);
}

.shape-option.active {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.1);
    color: #5D82D5;
}

/* Pattern Customization */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pattern-option {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pattern-option:hover {
    border-color: #5D82D5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93, 130, 213, 0.2);
}

.pattern-option.active {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.1);
}

.pattern-preview {
    width: 40px;
    height: 40px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 1px;
}

.pattern-dot {
    background: #2c3e50;
    transition: all 0.3s ease;
}

/* Square Pattern */
.pattern-square .pattern-dot {
    border-radius: 0;
}

/* Circle Pattern */
.pattern-circle .pattern-dot {
    border-radius: 50%;
}

/* Rounded Pattern */
.pattern-rounded .pattern-dot {
    border-radius: 2px;
}

/* Diamond Pattern */
.pattern-diamond .pattern-dot {
    transform: rotate(45deg);
    border-radius: 0;
}

/* Color Customization */
.color-section {
    margin-bottom: 24px;
}

.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.color-control {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-hex {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
}

.preset-colors {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: #5D82D5;
}

/* Corner Styles */
.corner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.corner-option {
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.corner-option:hover {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.05);
}

.corner-option.active {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.1);
}

.corner-preview {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    margin-bottom: 8px;
}

.corner-square .corner-preview {
    border-radius: 0;
}

.corner-rounded .corner-preview {
    border-radius: 6px;
}

.corner-circle .corner-preview {
    border-radius: 50%;
}

.corner-diamond .corner-preview {
    transform: rotate(45deg);
}

/* Border and Frame Options */
.border-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.border-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #5D82D5;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

.border-style-options {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.border-style {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.border-style:hover {
    border-color: #5D82D5;
}

.border-style.active {
    border-color: #5D82D5;
    background: rgba(93, 130, 213, 0.1);
    color: #5D82D5;
}

/* QR Preview Section */
.qr-preview-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 24px;
    border: 1px solid #e9ecef;
}

.qr-preview-container {
    display: inline-block;
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.qr-code-preview {
    width: 200px;
    height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.qr-logo-overlay {
    position: absolute;
    z-index: 10;
    border-radius: 4px;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-button {
    background: #27ae60;
    color: white;
}

.download-button:hover {
    background: #229954;
    transform: translateY(-1px);
}

.regenerate-button {
    background: #5D82D5;
    color: white;
}

.regenerate-button:hover {
    background: #4a6bc4;
    transform: translateY(-1px);
}

.test-button {
    background: #f39c12;
    color: white;
}

.test-button:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .qr-customization-panel {
        padding: 16px;
        margin-top: 16px;
    }
    
    .customization-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .logo-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .color-controls {
        grid-template-columns: 1fr;
    }
    
    .border-controls {
        grid-template-columns: 1fr;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .corner-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .preview-button {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .position-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shape-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .qr-code-preview {
        width: 150px;
        height: 150px;
    }
    
    .logo-upload-area {
        padding: 24px 16px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #5D82D5;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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