/* QR Code Generator Specific Styles */

/* Heading size adjustments for proper hierarchy */
.card-header h2 {
    font-size: 1.25rem;
}

.accordion-header h3 {
    font-size: 1rem;
    margin: 0;
}

.card-body h2,
.card-body h3 {
    font-size: 1.25rem;
}

/* Accessibility - Focus indicators */
*:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 3px;
}

input[type="range"]:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 4px;
}

.qr-preview-container {
    min-height: 400px;
    max-height: 600px;
    background: var(--bs-secondary-bg);
    border-radius: 0.375rem;
    padding: 2rem;
    overflow: hidden;
}

#qrcode {
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

#qrcode canvas,
#qrcode svg {
    max-width: 100%;
    max-height: 500px;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 0.375rem;
}

.content-field {
    transition: opacity 0.3s ease;
}

/* Accordion customization */
.accordion-button:not(.collapsed) {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

/* Form controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Range inputs */
.form-range::-webkit-slider-thumb {
    background-color: var(--bs-primary);
}

.form-range::-moz-range-thumb {
    background-color: var(--bs-primary);
}

/* Sticky positioning for preview on larger screens */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        z-index: 1020;
    }
}

/* File upload styling */
#logoUpload {
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Error message styling */
#errorMessage {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Loading state */
.qr-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.qr-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .qr-preview-container {
    background: var(--bs-dark);
}

[data-bs-theme="dark"] #qrcode canvas,
[data-bs-theme="dark"] #qrcode svg {
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

/* Skip to content link for keyboard users */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Ensure screen reader only text is properly hidden */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Improve color contrast for better readability */
.text-muted {
    color: #6c757d !important;
}
