/* QR Code Generator - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --card-border-radius: 12px;
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Card styling */
.card {
    border: none;
    border-radius: var(--card-border-radius);
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Tab navigation */
.nav-pills {
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.nav-pills::-webkit-scrollbar {
    height: 4px;
}

.nav-pills::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 4px;
}

.nav-pills .nav-link {
    color: #6c757d;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    background-color: #e9ecef;
    color: #495057;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-pills .nav-link i {
    font-size: 1.1rem;
}

/* Form styling */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    border-color: #dee2e6;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.375rem;
}

/* QR Preview container */
.qr-preview-container {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.qr-preview-container.has-qr {
    border-style: solid;
    border-color: #e9ecef;
}

.qr-placeholder {
    text-align: center;
}

.qr-placeholder i {
    opacity: 0.3;
}

#qrPreview img {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1.05rem;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* Download buttons */
#downloadButtons .btn {
    padding: 0.75rem 1rem;
}

#downloadButtons .btn-success {
    background-color: #198754;
}

#downloadButtons .btn-info {
    background-color: #0dcaf0;
    color: #000;
}

/* Sticky sidebar */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        top: 20px;
    }
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .nav-pills .nav-link {
        padding: 0.5rem;
    }

    .nav-pills .nav-link span {
        display: none !important;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .qr-preview-container {
        min-height: 220px;
    }
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error state */
.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

/* Success animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.qr-preview-container img {
    animation: fadeIn 0.3s ease;
}

/* Title styling */
.display-5 {
    color: #212529;
}

.lead {
    font-size: 1.1rem;
}

/* Form divider */
hr {
    border-color: #e9ecef;
    opacity: 1;
}

/* Footer */
footer {
    font-size: 0.9rem;
}
