/* Pretty QR Code - Custom Styles */

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    border: none;
    cursor: pointer;
}

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

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

/* Active color button state */
.color-btn.active {
    ring-width: 2px;
    ring-offset-width: 2px;
}

/* Modal animation */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-in {
    animation: modal-in 0.2s ease-out;
}

/* QR Code container styling */
#qrCodeContainer {
    min-width: 280px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: padding 0.3s ease;
}

#qrCodeContainer canvas,
#qrCodeContainer svg:not(.qr-frame) {
    max-width: 100%;
    height: auto;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* Smooth transitions */
.frame-btn,
.dot-style-btn,
.corner-style-btn {
    transition: all 0.2s ease;
}

/* Download button hover effect */
.download-btn:hover svg {
    transform: translateY(2px);
    transition: transform 0.2s ease;
}

/* Collapsible section animation */
#styleContent,
#imageContent {
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

#styleContent:not(.collapsed),
#imageContent:not(.collapsed) {
    max-height: none !important;
    overflow: visible;
}

#styleContent.collapsed,
#imageContent.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Toast notification */
#toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* File input label hover */
label:has(input[type="file"]):hover {
    border-color: #ff6699;
    background-color: rgba(255, 102, 153, 0.05);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #qrCodeContainer {
        min-width: 240px;
        min-height: 240px;
    }
}

@media (max-width: 640px) {
    .download-btn span.text-xs {
        display: none;
    }
    
    #qrCodeContainer {
        min-width: 200px;
        min-height: 200px;
    }
}

/* Frame styling */
#qrCodeContainer .qr-frame {
    z-index: 10;
}

/* Loading state for QR code */
.qr-loading {
    position: relative;
}

.qr-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #ff6699;
    outline-offset: 2px;
}

/* Prevent text selection on buttons */
button {
    user-select: none;
}

/* Gradient text effect (optional for title) */
.gradient-text {
    background: linear-gradient(135deg, #020266, #ff6699);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ff6699;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 102, 153, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff6699;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 102, 153, 0.3);
}

/* Download button loading state */
.download-btn:disabled,
#downloadAll:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Format toggle button */
.format-btn.active {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #020266;
}

/* Spin animation for loading spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}
