/* ============================================
   SenQrcode - Professional Design System
   ============================================ */

/* --- Base Transitions --- */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Card Component --- */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.06);
}
.dark .card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}
.dark .card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}
.dark .form-label {
    color: #94a3b8;
}
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    background: white;
    color: #1e293b;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.dark .form-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
.dark .form-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.form-input::placeholder {
    color: #94a3b8;
}
.form-select {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    background: white;
    color: #1e293b;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    appearance: none;
    cursor: pointer;
}
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.dark .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
.dark .form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

/* --- Section Dividers --- */
.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    margin-top: 0.25rem;
}
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #e2e8f0, transparent);
}
.dark .section-divider::after {
    background: linear-gradient(to right, #334155, transparent);
}
.section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    white-space: nowrap;
}

/* --- Buttons --- */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-action:active {
    transform: translateY(0);
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    background: #6366f1;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #ef4444;
    border-color: #fca5a5;
}
.dark .btn-secondary {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
.dark .btn-secondary:hover {
    background: #334155;
    color: #f87171;
    border-color: #7f1d1d;
}

/* --- Shape Buttons --- */
.shape-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border-radius: 0.625rem;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}
.shape-btn:hover {
    border-color: #c7d2fe;
    color: #6366f1;
    background: #eef2ff;
}
.shape-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.dark .shape-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}
.dark .shape-btn:hover {
    border-color: #4f46e5;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
}
.dark .shape-btn.active {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* --- Color Picker --- */
.color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background-color: transparent;
    padding: 0;
}
.color-picker:hover {
    transform: scale(1.08);
}
.color-picker:active {
    transform: scale(0.95);
}
.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-picker::-webkit-color-swatch {
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s ease;
}
.color-picker:hover::-webkit-color-swatch {
    border-color: #c7d2fe;
}
.color-picker::-moz-color-swatch {
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
}
.color-picker-sm {
    width: 36px;
    height: 36px;
    min-width: 36px;
}
.dark .color-picker::-webkit-color-swatch {
    border-color: #475569;
}
.dark .color-picker:hover::-webkit-color-swatch {
    border-color: #818cf8;
}
.dark .color-picker::-moz-color-swatch {
    border-color: #475569;
}

.color-option-card {
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.color-option-card:hover {
    border-color: #e2e8f0;
}
.dark .color-option-card {
    background: rgba(15, 23, 42, 0.5);
    border-color: #1e293b;
}
.dark .color-option-card:hover {
    border-color: #334155;
}

/* --- Custom Slider --- */
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    transition: background 0.2s ease;
}
.custom-slider:hover {
    background: #cbd5e1;
}
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}
.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}
.custom-slider:active::-webkit-slider-thumb {
    transform: scale(1.05);
}
.custom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}
.custom-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}
.custom-slider-sm {
    height: 4px;
}
.custom-slider-sm::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
}
.custom-slider-sm::-moz-range-thumb {
    width: 14px;
    height: 14px;
}
.dark .custom-slider {
    background: #334155;
}
.dark .custom-slider:hover {
    background: #475569;
}
.dark .custom-slider::-webkit-slider-thumb {
    background: #818cf8;
    box-shadow: 0 1px 3px rgba(129, 140, 248, 0.3);
}
.dark .custom-slider::-moz-range-thumb {
    background: #818cf8;
    box-shadow: 0 1px 3px rgba(129, 140, 248, 0.3);
}

/* --- QR Preview --- */
.qr-preview-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border-radius: 0.875rem;
    border: 1px dashed #e2e8f0;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.dark .qr-preview-wrapper {
    background: rgba(15, 23, 42, 0.5);
    border-color: #334155;
}
.qr-preview-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    min-width: 220px;
    transition: all 0.3s ease;
}

/* --- Logo Preview --- */
.logo-preview {
    max-width: 80px;
    max-height: 80px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 10;
}
.dark .logo-preview {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* --- QR Module Transitions --- */
.qr-module {
    transition: all 0.3s ease;
}

/* --- Animations --- */
@keyframes fade {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-fade {
    animation: fade 1.5s ease-in-out infinite alternate;
}
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}
.animate-bounce {
    animation: bounce 1.2s ease-in-out infinite;
}

/* --- Template Thumbnails --- */
.template-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.625rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid #e2e8f0;
    background: white;
    padding: 0.5rem;
}
.template-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #c7d2fe;
}
.dark .template-thumbnail {
    background: #0f172a;
    border-color: #334155;
}
.dark .template-thumbnail:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.qr-preview svg {
    max-width: 80px;
    max-height: 80px;
    width: 100%;
    height: 100%;
}

/* --- Footer Social --- */
.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.625rem;
    color: #64748b;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}
.footer-social:hover {
    background: #f1f5f9;
    color: #334155;
    transform: translateY(-2px);
}
.dark .footer-social {
    color: #94a3b8;
}
.dark .footer-social:hover {
    background: #1e293b;
    color: #f1f5f9;
}

/* --- Toast Notifications --- */
.toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    max-width: 360px;
    backdrop-filter: blur(12px);
}
.toast.removing {
    animation: toastOut 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}
.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}
.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.toast-info {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* --- Page Load Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
main .card {
    animation: fadeInUp 0.5s ease-out both;
}
main > div > div:first-child .card {
    animation-delay: 0.05s;
}
main > div > div:last-child .card {
    animation-delay: 0.15s;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* --- Responsive Tweaks --- */
@media (max-width: 640px) {
    .card {
        padding: 1.125rem;
    }
    .btn-action span {
        display: none;
    }
    .btn-action {
        padding: 0.5rem 0.625rem;
    }
}