/**
 * Next GenAI Form Builder - Base Form Styles
 * Core form elements used by all themes and navigations
 * Extracted from shared/css/form.css
 */

:root {
    /* Form-Specific Colors (overridable by theme files) */
    --ngfb-form-primary: #4F46E5;
    --ngfb-form-accent: #10B981;
    --ngfb-form-background: #FFFFFF;
    --ngfb-form-text: #1F2937;
    --ngfb-form-text-secondary: #6B7280;
    --ngfb-form-border: #E5E7EB;
    --ngfb-form-radius: 8px;
    --ngfb-form-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Public form wrapper - ensures CSS variables cascade */
.ngfb-public-form {
    /* CSS variables are injected here by the renderer */
    /* They automatically cascade to all child elements */
    display: block !important; /* override shortcode inline display:flex */
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    /* Prevent centering from shortcode skeleton */
    align-items: stretch !important;
    justify-content: flex-start !important;
    /* Width is controlled by JavaScript - no flex constraints */
    flex: none !important;
}

/* Ensure both form and results panel take full width when rendered on the frontend */
.ngfb-public-form > .ngfb-form {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    flex: 0 0 100% !important;
}

/* Results panel should stack below the calculator for responsive/auto-flow layouts */
.ngfb-public-form #ngfb-calculator-results-panel {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Internal content wrapper should stack vertically (matches admin preview) */
.ngfb-public-form .ngfb-content-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
}

/* If ToC is not the immediate sibling, still ensure spacing for common ToC plugins */
.ngfb-public-form ~ #ez-toc-container,
.ngfb-public-form ~ .toc_container,
.ngfb-public-form ~ .lwptoc,
.ngfb-public-form ~ .wp-block-table-of-contents {
    margin-top: var(--ngfb-form-bottom-gap, 32px) !important;
}

/* Public form container - apply same styling as admin preview */
.ngfb-public-form .ngfb-form {
    background: var(--ngfb-form-background, #FFFFFF) !important;
    color: var(--ngfb-form-text, #1e293b);
    padding: var(--ngfb-form-padding, 40px);
    border-radius: 18px !important;
    box-shadow: var(--ngfb-form-shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden !important;
    /* Width is controlled by JavaScript - no flex constraints */
    flex: none !important;
}

/* Side-by-side layout override */
.ngfb-public-form .ngfb-form[style*="flex-direction: row"],
.ngfb-public-form .ngfb-form[style*="flex-direction:row"] {
    flex-direction: row !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
}

/* Base form container */
.ngfb-form {
    background: var(--ngfb-form-background, #FFFFFF) !important;
    color: var(--ngfb-form-text, #1e293b);
    padding: var(--ngfb-form-padding, 40px);
    border-radius: 18px !important;
    box-shadow: var(--ngfb-form-shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden !important;
    /* Width is controlled by JavaScript - no flex constraints */
    flex: none !important;
}

/* Form elements in panels */
.ngfb-form-group {
    margin-bottom: 16px;
}

.ngfb-label {
    display: block;
    font-size: calc(var(--ngfb-base-font-size, 16px) * 0.8125) !important;
    font-weight: var(--ngfb-label-weight, 600) !important;
    color: var(--ngfb-form-text, #1e293b);
    margin-bottom: 4px;
}

.ngfb-label.required::after {
    content: ' *';
    color: #EF4444;
}

.ngfb-input,
.ngfb-textarea,
.ngfb-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--ngfb-form-radius, 10px);
    border: 2px solid var(--ngfb-form-border, #E2E8F0);
    background: var(--ngfb-form-surface, rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(10px);
    font-size: var(--ngfb-base-font-size, 16px) !important;
    color: var(--ngfb-form-text, #1e293b);
    transition: var(--ngfb-transition-smooth, all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1));
    position: relative;
    box-sizing: border-box;
}

.ngfb-input:hover,
.ngfb-textarea:hover,
.ngfb-select:hover {
    border-color: var(--ngfb-form-primary, #A855F7);
    background: var(--ngfb-form-surface, rgba(255, 255, 255, 0.95));
    transform: translateY(-1px);
}

.ngfb-input:focus,
.ngfb-textarea:focus,
.ngfb-select:focus {
    outline: none;
    border-color: transparent;
    background: #ffffff;
    color: #1e293b !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), 
                0 8px 24px rgba(168, 85, 247, 0.2),
                inset 0 0 0 2px var(--ngfb-form-primary, #A855F7);
    transform: translateY(-2px);
}

.ngfb-input::placeholder,
.ngfb-textarea::placeholder {
    color: var(--ngfb-form-text-secondary, #9CA3AF);
    opacity: 1;
}

.ngfb-textarea {
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

/* Enhanced select styling */
.ngfb-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23FF6B6B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.ngfb-select option {
    background: #ffffff !important;
    color: #1f2937 !important;
    padding: 12px 16px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: none !important;
    margin: 2px 0 !important;
}

.ngfb-select option:hover {
    background: var(--ngfb-form-primary, #a855f7) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.ngfb-select option:checked,
.ngfb-select option:selected {
    background: var(--ngfb-form-primary, #a855f7) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.ngfb-select:focus option,
.ngfb-select[size] option {
    background: #ffffff !important;
    color: #1f2937 !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: all 0.2s ease !important;
}

.ngfb-select:focus option:hover,
.ngfb-select[size] option:hover {
    background: var(--ngfb-form-primary, #a855f7) !important;
    color: #ffffff !important;
    border-bottom-color: var(--ngfb-form-primary, #a855f7) !important;
}

.ngfb-select:focus option:checked,
.ngfb-select[size] option:checked,
.ngfb-select:focus option:selected,
.ngfb-select[size] option:selected {
    background: var(--ngfb-form-primary, #a855f7) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-bottom-color: transparent !important;
}

.ngfb-select optgroup {
    background: #f9fafb !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Sections */
.ngfb-section {
    margin-bottom: var(--ngfb-section-gap, 32px);
    position: relative;
    z-index: 1;
}

.ngfb-section-header {
    font-size: calc(var(--ngfb-base-font-size, 16px) * var(--ngfb-title-scale, 1.25)) !important;
    font-weight: var(--ngfb-title-weight, 700) !important;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ngfb-form-border, #E2E8F0);
    color: var(--ngfb-form-text, #1e293b) !important;
    position: relative;
    letter-spacing: -0.3px;
}

.ngfb-section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--ngfb-form-primary, #A855F7), var(--ngfb-form-accent, #EC4899));
    border-radius: 2px;
}

.ngfb-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}

/* Form title and description styling */
.ngfb-form-title {
    margin: 0 0 8px 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.ngfb-form-description {
    margin: 0;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

/* Section body - main container for fields */
.ngfb-section-body {
    display: flex;
    flex-direction: column;
    gap: var(--ngfb-field-gap, 24px);
    width: 100%;
}

/* Two-column layout - Desktop */
.ngfb-section-body.two-column {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-auto-flow: column !important;
    grid-auto-rows: max-content !important;
    align-items: start !important;
    gap: var(--ngfb-field-gap, 24px) !important;
}

/* Column 1 fields */
.ngfb-section-body.two-column .ngfb-field[data-column="1"] {
    grid-column: 1 / 2 !important;
}

/* Column 2 fields */
.ngfb-section-body.two-column .ngfb-field[data-column="2"] {
    grid-column: 2 / 3 !important;
}

/* Responsive: Tablet (768px and below) */
@media (max-width: 768px) {
    .ngfb-section-body.two-column {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        grid-auto-flow: unset !important;
    }
    
    .ngfb-section-body.two-column .ngfb-field[data-column="1"],
    .ngfb-section-body.two-column .ngfb-field[data-column="2"] {
        grid-column: unset !important;
        width: 100% !important;
    }
}

/* Responsive: Mobile (480px and below) */
@media (max-width: 480px) {
    .ngfb-section-body.two-column {
        gap: var(--ngfb-field-gap, 16px) !important;
    }
    
    .ngfb-section-body.two-column .ngfb-field {
        gap: 6px !important;
    }
}

/* ===== SIDE-BY-SIDE LAYOUT STYLES ===== */

/* Form inputs wrapper - left side (45% width) */
.ngfb-form-inputs-wrapper {
    flex: 0 0 auto !important;
    width: 45% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    box-sizing: border-box !important;
}

/* Results panel in side-by-side mode - right side (flex: 1) */
.ngfb-form .ngfb-results-panel-modern {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    max-height: 100vh !important;
}

/* Responsive: Tablet (768px and below) - Stack vertically */
@media (max-width: 768px) {
    .ngfb-form-inputs-wrapper {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .ngfb-form[style*="flex-direction: row"],
    .ngfb-form[style*="flex-direction:row"] {
        flex-direction: column !important;
    }
    
    .ngfb-form .ngfb-results-panel-modern {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Opening animation state */
.ngfb-section-body.animating-open {
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Closing animation state */
.ngfb-section-body.animating-close {
    animation: fadeCollapse 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px) scaleY(0.92);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 2000px;
    }
}

@keyframes fadeCollapse {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 2000px;
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
    }
}

/* Full-width field spans entire row */
.ngfb-field[data-width="100%"],
.ngfb-field.field-width-100 {
    flex-basis: 100%;
}

/* Field wrapper - supports any percentage width */
.ngfb-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Width is set via inline styles from JavaScript */
    width: 100%;
}

/* Two-column layout - fields span full width of their grid cell */
.ngfb-section-body.two-column .ngfb-field {
    width: 100%;
}

/* Backward compatibility - 50% width */
.ngfb-field.field-width-50 {
    flex-basis: 50%;
}

/* Label position styles - Global for all fields */

/* Top label (default) - label styling for all fields */
.ngfb-field .ngfb-label {
    display: block;
    margin-bottom: 8px;
}

/* Left label layout - Global for all field types */
.ngfb-field.label-left {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.ngfb-field.label-left .ngfb-label {
    margin-bottom: 0;
    min-width: 120px;
    flex-shrink: 0;
    padding-top: 12px;
    order: -1; /* Ensure label appears first */
}

/* All field input containers should flex in left label mode */
.ngfb-field.label-left > input,
.ngfb-field.label-left > select,
.ngfb-field.label-left > textarea,
.ngfb-field.label-left > .ngfb-rating,
.ngfb-field.label-left > .ngfb-slider-container,
.ngfb-field.label-left > .ngfb-options,
.ngfb-field.label-left > .ngfb-currency-input,
.ngfb-field.label-left > .ngfb-toggle,
.ngfb-field.label-left > .ngfb-captcha,
.ngfb-field.label-left > .ngfb-signature,
.ngfb-field.label-left > .ngfb-location,
.ngfb-field.label-left > .ngfb-file-upload {
    flex: 1;
    min-width: 200px;
}

/* Help text for left label should appear below input/options */
.ngfb-field.label-left .ngfb-help-text {
    flex-basis: 100%;
    margin-left: 136px;
    margin-top: 4px;
}

/* For checkbox/radio options with left label */
.ngfb-field.label-left .ngfb-options {
    flex-basis: 100%;
    margin-left: 0;
}

/* Floating label layout */
.ngfb-field.has-floating-label {
    position: relative;
}

/* Add extra top padding to input for floating label space */
.ngfb-field.has-floating-label .ngfb-input,
.ngfb-field.has-floating-label .ngfb-textarea,
.ngfb-field.has-floating-label .ngfb-select {
    padding-top: 16px;
    padding-bottom: 10px;
    min-height: 40px;
}

.ngfb-field.has-floating-label .floating-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 14px;
    background: transparent;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ngfb-form-text-secondary, #6B7280);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
    line-height: 1.2;
}

.ngfb-field.has-floating-label .ngfb-input:focus ~ .floating-label,
.ngfb-field.has-floating-label .ngfb-input:not(:placeholder-shown) ~ .floating-label,
.ngfb-field.has-floating-label .ngfb-textarea:focus ~ .floating-label,
.ngfb-field.has-floating-label .ngfb-textarea:not(:placeholder-shown) ~ .floating-label,
.ngfb-field.has-floating-label .ngfb-select:focus ~ .floating-label,
.ngfb-field.has-floating-label .ngfb-select:not([value=""]) ~ .floating-label {
    top: -8px;
    transform: translateY(0);
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ngfb-form-primary, #10B981);
    background: var(--ngfb-form-background, #FFFFFF);
    padding: 2px 6px;
    border: 1px solid var(--ngfb-form-border, #E2E8F0);
    border-radius: 4px;
}

/* Option styling */
.ngfb-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ngfb-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 2px solid var(--ngfb-form-border, #E2E8F0) !important;
    border-radius: var(--ngfb-form-radius, 10px);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    background: transparent !important;
    position: relative;
    color: #ffffff;
}

.ngfb-option:hover {
    border-color: var(--ngfb-form-primary, #10B981);
    background: rgba(16, 185, 129, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-option.selected {
    border: 3px solid var(--ngfb-form-primary-dark, #0d8659) !important;
    background: var(--ngfb-form-primary, #10B981);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    color: #ffffff !important;
}

/* Custom Checkbox & Radio Indicators */
.ngfb-custom-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--ngfb-form-border, #E2E8F0);
    border-radius: 4px;
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ngfb-radio-indicator {
    border-radius: 50%;
}

/* Checked state */
.ngfb-custom-indicator.selected {
    background: var(--ngfb-form-primary, #10B981);
    border-color: var(--ngfb-form-primary, #10B981);
    color: #ffffff !important;
}

/* Checkbox checkmark - only show when checked */
.ngfb-checkbox-indicator.checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
}

/* Radio dot - only show when checked */
.ngfb-radio-indicator.checked::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Content wrapper for label and icon */
.ngfb-option-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ngfb-option-label {
    margin: 0;
    cursor: pointer;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.5;
    font-size: 14px;
    color: var(--ngfb-form-text, #1e293b) !important;
    flex: 1;
}

/* Hide the actual input */
.ngfb-option input[type="radio"],
.ngfb-option input[type="checkbox"] {
    display: none !important;
}

/* Toggle Switch Styling */
.ngfb-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--ngfb-form-border, #E2E8F0);
    border-radius: var(--ngfb-form-radius, 10px);
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    user-select: none;
}

.ngfb-toggle:hover {
    border-color: var(--ngfb-form-primary, #A855F7);
    background: rgba(79, 70, 229, 0.05);
}

.ngfb-toggle input[type="checkbox"] {
    display: none !important;
}

.ngfb-toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--ngfb-form-border, #E2E8F0);
    border-radius: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

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

.ngfb-toggle input[type="checkbox"]:checked + .ngfb-toggle-switch {
    background: var(--ngfb-form-primary, #A855F7);
}

.ngfb-toggle input[type="checkbox"]:checked + .ngfb-toggle-switch::before {
    left: 22px;
}

.ngfb-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: var(--ngfb-form-text, #1e293b);
    line-height: 1.5;
}

/* Submit button */
.ngfb-submit-btn {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--ngfb-form-primary) 0%, var(--ngfb-form-accent) 100%);
    color: #ffffff !important;
    border: none;
    border-radius: var(--ngfb-form-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ngfb-form-shadow);
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ngfb-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.3);
    filter: brightness(1.15);
    color: #ffffff !important;
}

/* Navigation buttons */
.ngfb-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    gap: 16px;
}

.ngfb-nav-btn {
    padding: 12px 24px;
    border: 2px solid var(--ngfb-form-border, #E2E8F0);
    background: rgba(255, 255, 255, 0.1);
    color: var(--ngfb-form-text, #1e293b);
    border-radius: var(--ngfb-form-radius, 10px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.ngfb-nav-btn:hover {
    border-color: var(--ngfb-form-primary, #A855F7);
    color: var(--ngfb-form-text, #1e293b);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.ngfb-nav-btn:active {
    transform: translateY(0);
}

.ngfb-nav-btn-primary {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #A855F7) 0%, var(--ngfb-form-accent, #EC4899) 100%);
    color: #ffffff !important;
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ngfb-nav-btn-primary:hover {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #A855F7) 0%, var(--ngfb-form-accent, #EC4899) 100%);
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
}

.ngfb-nav-btn-primary:active {
    transform: translateY(0);
    filter: brightness(1);
    color: #ffffff !important;
}

/* Error messages */
.ngfb-error-message {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #FFFFFF !important;
    background-color: #EF4444 !important;
    margin: 6px 0 8px 0 !important;
    padding: 10px 14px !important;
    border-radius: 6px !important;
    border-left: 4px solid #DC2626 !important;
    display: block !important;
    animation: slideInError 0.3s ease-out !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Field error state */
.ngfb-field.has-error .ngfb-input,
.ngfb-field.has-error .ngfb-textarea,
.ngfb-field.has-error select {
    border-color: #EF4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    animation: shake 0.4s ease-in-out !important;
}

.ngfb-field.has-error .ngfb-label {
    color: #EF4444 !important;
}

/* Modern Error Field Styles */
.modern-validation-error-field:focus {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
    outline: none !important;
}

.modern-validation-error:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.08) 100%) !important;
    transform: translateY(-1px) !important;
}

/* Success overlay */
.ngfb-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* New Field Types Styles */

/* Time, Phone, URL, Password inputs - inherit base input styles */
.ngfb-time-input,
.ngfb-phone-input,
.ngfb-url-input,
.ngfb-password-input {
    width: 100%;
}

/* Hidden input */
input[type="hidden"] {
    display: none;
}

/* Section Field */
.ngfb-section-field {
    margin: 24px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
    width: 100%;
}

/* Section field body - nested fields container */
.ngfb-section-field .ngfb-section-body {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
}

/* Section Header */
.ngfb-section-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--ngfb-form-text, #1f2937);
    display: flex;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ngfb-form-border, #e5e7eb);
    transition: all 0.3s ease;
}

.ngfb-section-header.ngfb-section-collapsible {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ngfb-section-header.ngfb-section-collapsible:hover {
    color: var(--ngfb-form-primary, #3b82f6);
    border-bottom-color: var(--ngfb-form-primary, #3b82f6);
    padding-left: 4px;
}

.ngfb-section-toggle {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    transform-origin: center;
}

.ngfb-section-description {
    font-size: 13px;
    color: #6b7280;
    margin: 8px 0 0 0;
    font-weight: 400;
    line-height: 1.5;
}

/* Removed duplicate - using definition at line 203 */

/* Enhanced Radio/Checkbox with Icons/Images */
.ngfb-radio-options,
.ngfb-checkbox-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.ngfb-option {
    position: relative;
    padding: 16px 12px 12px 12px;
    border: 2.5px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    background: #ffffff;
    min-height: auto;
    justify-content: flex-start;
}

.ngfb-option:hover {
    border-color: #d1d5db;
    background: #fafafa;
    transform: translateY(-1px);
}

.ngfb-option.selected {
    border-color: var(--ngfb-form-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.02);
    box-shadow: 0 0 0 1px var(--ngfb-form-primary, #3b82f6);
}

.ngfb-option-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.ngfb-option.selected .ngfb-option-image {
    transform: scale(1.08);
}

.ngfb-option-icon {
    font-size: 56px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.ngfb-option.selected .ngfb-option-icon {
    transform: scale(1.15);
}

.ngfb-option-label {
    font-weight: 500;
    font-size: 14px;
    color: #9ca3af;
    cursor: pointer;
    margin: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ngfb-option.selected .ngfb-option-label {
    color: var(--ngfb-form-primary, #3b82f6);
    font-weight: 600;
}

/* Hide all radio/checkbox inputs */
.ngfb-option input[type="radio"],
.ngfb-option input[type="checkbox"] {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* Indicator badge - positioned in top right */
.ngfb-option::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: 2.5px solid #d1d5db;
    border-radius: 50%;
    background: #ffffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngfb-option.selected::before {
    border-color: var(--ngfb-form-primary, #3b82f6);
    background: var(--ngfb-form-primary, #3b82f6);
    content: '✓';
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide indicator badge when hideInput is true */
.ngfb-option.hide-input::before {
    display: none !important;
}

/* Slider Styles - Theme Aware */
.ngfb-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.ngfb-slider-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ngfb-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    will-change: background;
    /* No transition on background - it updates instantly with CSS variable */
}
/* Webkit browsers (Chrome, Safari, Edge) */
.ngfb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    border: 2px solid #ffffff !important;
    cursor: pointer !important;
    transition: box-shadow 0.2s ease !important;
}

.ngfb-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Firefox */
.ngfb-slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    border: 2px solid #ffffff !important;
    cursor: pointer !important;
    transition: box-shadow 0.2s ease !important;
}

.ngfb-slider::-moz-range-thumb:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.ngfb-slider::-moz-range-track {
    background: transparent;
    border: none;
}

.ngfb-slider::-moz-range-progress {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    height: 8px;
    border-radius: 5px;
}

/* Slider value display */
.ngfb-slider-value {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    font-size: calc(var(--ngfb-base-font-size, 16px) * 0.8125);
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Slider scale labels */
.ngfb-slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 2px;
}

.ngfb-slider-scale-label {
    font-size: calc(var(--ngfb-base-font-size, 16px) * 0.75);
    color: var(--ngfb-form-text-secondary, #6B7280);
    font-weight: 500;
    flex: 0 0 auto;
}


/* New Field Types Styling */

/* Heading Field */
.ngfb-heading {
    margin: 16px 0 8px 0;
    color: var(--ngfb-form-text, #1f2937);
    font-weight: 600;
}

.ngfb-heading.h1 { font-size: 28px; }
.ngfb-heading.h2 { font-size: 24px; }
.ngfb-heading.h3 { font-size: 20px; }
.ngfb-heading.h4 { font-size: 18px; }
.ngfb-heading.h5 { font-size: 16px; }
.ngfb-heading.h6 { font-size: 14px; }

/* HTML Block Field */
.ngfb-html-block {
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    line-height: 1.6;
    color: var(--ngfb-form-text, #1f2937);
}

.ngfb-html-block p { margin: 8px 0; }
.ngfb-html-block ul, .ngfb-html-block ol { margin-left: 20px; margin: 8px 0; }
.ngfb-html-block li { margin: 4px 0; }
.ngfb-html-block a { color: var(--ngfb-form-primary, #4F46E5); text-decoration: none; }
.ngfb-html-block a:hover { text-decoration: underline; }

/* Currency Field */
.ngfb-currency-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.ngfb-currency-symbol {
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    min-width: 24px;
}

.ngfb-currency-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.ngfb-currency-input:focus {
    outline: none;
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* CAPTCHA Field - Modern Design */
.ngfb-captcha-wrapper {
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 12px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, var(--ngfb-form-surface, rgba(255, 255, 255, 0.5)) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ngfb-captcha-wrapper:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

/* CAPTCHA Header */
.ngfb-captcha-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-captcha-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngfb-form-text, #1f2937);
    letter-spacing: -0.3px;
}

.ngfb-captcha-subtitle {
    font-size: 13px;
    color: var(--ngfb-form-text-secondary, #6B7280);
    margin: 0;
    line-height: 1.5;
}

/* CAPTCHA Content */
.ngfb-captcha-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Math CAPTCHA */
.ngfb-captcha-math {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ngfb-captcha-math:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.ngfb-captcha-math.ngfb-captcha-verified {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-math-problem {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ngfb-form-text, #1f2937);
    white-space: nowrap;
}

.ngfb-captcha-math-num {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.ngfb-captcha-math-operator {
    font-size: 20px;
    color: var(--ngfb-form-primary, #4F46E5);
    font-weight: 700;
}

.ngfb-captcha-math-equals {
    font-size: 20px;
    color: var(--ngfb-form-text, #1f2937);
    font-weight: 700;
}

.ngfb-captcha-math-input {
    width: 120px;
    height: 50px;
    padding: 12px 14px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--ngfb-form-background, #ffffff);
    color: var(--ngfb-form-text, #1f2937);
    box-sizing: border-box;
}

.ngfb-captcha-math-input:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
}
.ngfb-captcha-math-input:focus {
    outline: none;
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.ngfb-captcha-math-input.ngfb-captcha-correct {
    border-color: #10B981 !important;
    background-color: #f0fdf4;
    color: #10B981;
}

.ngfb-captcha-math-input.ngfb-captcha-incorrect {
    border-color: #EF4444 !important;
    background-color: #fef2f2;
    color: #EF4444;
    animation: shake 0.4s ease-in-out;
}

/* Logic CAPTCHA */
.ngfb-captcha-logic {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: var(--ngfb-form-background, #ffffff);
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ngfb-captcha-logic.ngfb-captcha-verified {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-logic-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    padding: 12px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--ngfb-form-primary, #4F46E5);
}

.ngfb-captcha-logic-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.ngfb-captcha-logic-option {
    padding: 12px 16px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    background: var(--ngfb-form-background, #ffffff);
    color: var(--ngfb-form-text, #1f2937);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ngfb-captcha-logic-option:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
}

.ngfb-captcha-logic-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ngfb-captcha-logic-option.ngfb-captcha-correct {
    border-color: #10B981;
    background: #f0fdf4;
    color: #10B981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-logic-option.ngfb-captcha-incorrect {
    border-color: #EF4444;
    background: #fef2f2;
    color: #EF4444;
    animation: shake 0.3s ease-in-out;
}

/* Distorted Text CAPTCHA */
.ngfb-captcha-distorted-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: var(--ngfb-form-background, #ffffff);
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ngfb-captcha-distorted-text.ngfb-captcha-verified {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-distorted-canvas {
    width: 100%;
    max-width: 300px;
    height: 100px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    background: var(--ngfb-form-surface, #f9fafb);
    display: block;
    margin: 0 auto;
}

.ngfb-captcha-distorted-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ngfb-captcha-distorted-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
}

.ngfb-captcha-distorted-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    background: var(--ngfb-form-background, #ffffff);
    color: var(--ngfb-form-text, #1f2937);
    box-sizing: border-box;
}

.ngfb-captcha-distorted-input:focus {
    outline: none;
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.ngfb-captcha-distorted-input.ngfb-captcha-correct {
    border-color: #10B981 !important;
    background-color: #f0fdf4;
    color: #10B981;
}

.ngfb-captcha-distorted-input.ngfb-captcha-incorrect {
    border-color: #EF4444 !important;
    background-color: #fef2f2;
    animation: shake 0.4s ease-in-out;
}

.ngfb-captcha-distorted-btn {
    padding: 12px 24px;
    border: 2px solid var(--ngfb-form-primary, #4F46E5);
    border-radius: 8px;
    background: var(--ngfb-form-primary, #4F46E5);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ngfb-captcha-distorted-btn:hover {
    background: var(--ngfb-form-primary-dark, #4338CA);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.ngfb-captcha-distorted-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Slider CAPTCHA */
.ngfb-captcha-slider {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: var(--ngfb-form-background, #ffffff);
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ngfb-captcha-slider.ngfb-captcha-verified {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-slider-instruction {
    font-size: 15px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    text-align: center;
}

.ngfb-captcha-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ngfb-captcha-slider-track {
    flex: 1;
    height: 50px;
    background: linear-gradient(90deg, #E5E7EB 0%, var(--ngfb-form-border, #E5E7EB) 100%);
    border-radius: 25px;
    position: relative;
    cursor: grab;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-captcha-slider-track:active {
    cursor: grabbing;
}

.ngfb-captcha-slider-thumb {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
    user-select: none;
}

.ngfb-captcha-slider-thumb:active {
    cursor: grabbing;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* Click Pattern CAPTCHA */
.ngfb-captcha-click-pattern {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: var(--ngfb-form-background, #ffffff);
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ngfb-captcha-click-pattern.ngfb-captcha-verified {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ngfb-captcha-click-instruction {
    font-size: 15px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    text-align: center;
    padding: 12px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--ngfb-form-primary, #4F46E5);
}

.ngfb-captcha-click-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ngfb-captcha-click-box {
    aspect-ratio: 1;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    background: var(--ngfb-form-surface, #f9fafb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ngfb-captcha-click-box:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.05);
    transform: scale(1.05);
}

.ngfb-captcha-click-box.ngfb-captcha-click-correct {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulse 0.4s ease-out;
}

.ngfb-captcha-click-box.ngfb-captcha-click-incorrect {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    animation: shake 0.3s ease-in-out;
}

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

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

/* External CAPTCHA Services */
.ngfb-captcha-external {
    padding: 16px;
    background: #ffffff;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    transition: all 0.3s ease;
}

.ngfb-captcha-external:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
}

.ngfb-captcha-badge {
    font-size: 13px;
    color: var(--ngfb-form-text-secondary, #6B7280);
    font-weight: 500;
    text-align: center;
}

.ngfb-captcha-error {
    padding: 16px;
    background: #fef2f2;
    border: 2px solid #EF4444;
    border-radius: 8px;
    text-align: center;
}

.ngfb-captcha-error p {
    margin: 0 0 4px 0;
    color: #EF4444;
    font-weight: 600;
    font-size: 14px;
}

.ngfb-captcha-error small {
    color: #DC2626;
    font-size: 12px;
}

/* Signature Pad Field */
.ngfb-signature-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 12px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, var(--ngfb-form-surface, rgba(255, 255, 255, 0.5)) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ngfb-signature-wrapper:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

/* Signature Header */
.ngfb-signature-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-signature-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngfb-form-text, #1f2937);
    letter-spacing: -0.3px;
}

.ngfb-signature-instructions {
    font-size: 13px;
    color: var(--ngfb-form-text-secondary, #6B7280);
    margin: 0;
    line-height: 1.5;
}

/* Signature Canvas */
.ngfb-signature-canvas {
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 10px;
    background: #ffffff;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ngfb-signature-canvas:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02), 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.ngfb-signature-canvas:focus {
    outline: none;
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02), 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.ngfb-signature-canvas.has-signature {
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02), 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Signature Buttons */
.ngfb-signature-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ngfb-signature-btn {
    padding: 10px 20px;
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ngfb-form-text, #1f2937);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ngfb-signature-btn:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.ngfb-signature-btn:active {
    transform: translateY(0);
}

.ngfb-signature-btn-clear {
    border-color: #EF4444;
    color: #EF4444;
}

.ngfb-signature-btn-clear:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: #EF4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Location/Map Field */
.ngfb-location-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.ngfb-map-container {
    width: 100%;
    height: 400px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ngfb-map-container:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
}

.ngfb-map-container::before {
    content: '';
    display: none;
}

.ngfb-location-info {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 4px;
    border-left: 3px solid var(--ngfb-form-primary, #4F46E5);
}

.ngfb-location-display {
    font-size: 13px;
    color: #374151;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 4px;
    border-left: 3px solid #10B981;
    margin-top: 8px;
}

/* File Upload Field */
.ngfb-file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ngfb-file-drop-zone {
    border: 2px dashed var(--ngfb-form-primary, #4F46E5);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(79, 70, 229, 0.03);
}

.ngfb-file-drop-zone:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.08);
}

.ngfb-file-drop-zone.dragover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.12);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.ngfb-file-drop-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.ngfb-file-drop-text {
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    margin: 0 0 8px 0;
}

.ngfb-file-drop-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.ngfb-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ngfb-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    border-left: 4px solid var(--ngfb-form-accent, #10B981);
    position: relative;
}

.ngfb-file-icon {
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngfb-file-item-uploaded .ngfb-file-icon::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -8px;
    color: #10B981;
    font-weight: bold;
    font-size: 14px;
    background: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngfb-file-name {
    flex: 1;
    font-weight: 500;
    color: var(--ngfb-form-text, #1f2937);
    word-break: break-all;
    min-width: 0;
}

.ngfb-file-size {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.ngfb-file-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.ngfb-file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

.ngfb-file-progress {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 12px;
}

.ngfb-file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 2px;
}

.ngfb-file-item-uploaded {
    opacity: 0.8;
}

.ngfb-file-error {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    color: #991b1b;
    font-size: 13px;
    font-weight: 500;
}

/* Signature Pad Field - Theme Aware */
.ngfb-signature-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.02);
}

.ngfb-signature-canvas {
    border: 2px solid rgba(79, 70, 229, 0.3);
    border-radius: 6px;
    background: white;
    cursor: crosshair;
    display: block;
    width: 100%;
    height: 200px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Location Field - Theme Aware */
.ngfb-location-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.02);
}

.ngfb-location-display {
    padding: 12px;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 6px;
    color: var(--ngfb-form-primary, #4F46E5);
    font-size: 14px;
    font-weight: 500;
}

/* Modern Loading Indicator */
.ngfb-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
}

.ngfb-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.ngfb-loading-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid var(--ngfb-form-primary, #4F46E5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ngfb-loading-text {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    letter-spacing: 0.3px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .ngfb-form {
        padding: 20px;
    }
    
    .ngfb-section-body.two-column {
        grid-template-columns: 1fr !important;
    }
    
    .ngfb-field.field-width-50,
    .ngfb-field.field-width-100 {
        grid-column: span 1;
    }
}

/* Rating Field Styling */
.ngfb-rating {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ngfb-rating-icons {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ngfb-rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.ngfb-rating-star {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* Icon size variants */
.ngfb-rating-star[data-size="small"] {
    width: 24px;
    height: 24px;
}

.ngfb-rating-star[data-size="medium"] {
    width: 32px;
    height: 32px;
}

.ngfb-rating-star[data-size="large"] {
    width: 40px;
    height: 40px;
}

.ngfb-rating-star svg {
    width: 100%;
    height: 100%;
    transition: all 0.2s ease;
}

.ngfb-rating-star:hover svg,
.ngfb-rating-star.hover svg {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
}

.ngfb-rating-star.active svg {
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.5));
}

.ngfb-rating-star:hover,
.ngfb-rating-star.hover {
    transform: scale(1.15);
}

.ngfb-rating-star.active {
    transform: scale(1.05);
}

.ngfb-rating-label {
    font-size: 11px;
    color: var(--ngfb-form-text-secondary, #6b7280);
    margin-top: 4px;
    text-align: center;
    word-break: break-word;
    max-width: 60px;
    line-height: 1.2;
}

/* Calculation Field Styling */
.ngfb-calculation-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ngfb-calculation-result {
    padding: calc(var(--ngfb-base-font-size, 16px) * 0.75) calc(var(--ngfb-base-font-size, 16px) * 0.75);
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    font-weight: 600;
    font-size: calc(var(--ngfb-base-font-size, 16px) * 1.0);
    color: var(--ngfb-form-text, #1f2937);
    min-height: calc(var(--ngfb-base-font-size, 16px) * 2.5);
    display: flex;
    align-items: center;
}

/* Input Error State */
.ngfb-input-error {
    border-color: #EF4444 !important;
    background-color: rgba(239, 68, 68, 0.05);
}

.ngfb-input-error:focus {
    outline: none;
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Poll Field Styling */
.ngfb-poll-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.02);
    border-radius: 12px;
    border: 1px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-poll-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    margin-bottom: 8px;
}

.ngfb-poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ngfb-poll-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--ngfb-form-surface, #ffffff);
    border: 2px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ngfb-poll-option:hover {
    border-color: var(--ngfb-form-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.05);
}

.ngfb-poll-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--ngfb-form-text, #1f2937);
}

.ngfb-poll-option-text {
    flex: 1;
}

.ngfb-poll-results-bar {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.ngfb-poll-bar-fill {
    height: 24px;
    background: linear-gradient(90deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    border-radius: 4px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 0;
}

.ngfb-poll-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ngfb-form-text-secondary, #6b7280);
    text-align: right;
}

.ngfb-poll-thank-you {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: slideInScale 0.3s ease-out;
}

.ngfb-poll-thank-you-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: var(--ngfb-form-surface, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #10B981;
}

.ngfb-poll-checkmark {
    font-size: 48px;
    color: #10B981;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-poll-thank-you p {
    font-size: 16px;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    margin: 0;
}

.ngfb-poll-thank-you.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* ===== REPEATER FIELDS ===== */
.ngfb-repeater-container {
    margin-bottom: 20px;
}

.ngfb-repeater-items {
    border: 1px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ngfb-repeater-item {
    border-bottom: 1px solid var(--ngfb-form-border, #E5E7EB);
    padding: 16px;
    background: var(--ngfb-form-surface, #ffffff);
    transition: background 0.2s ease;
}

.ngfb-repeater-item:last-child {
    border-bottom: none;
}

.ngfb-repeater-item:hover {
    background: rgba(79, 70, 229, 0.02);
}

.ngfb-repeater-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-repeater-item-title {
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    font-size: 14px;
}

.ngfb-repeater-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.ngfb-repeater-field-wrapper {
    display: flex;
    flex-direction: column;
}

.ngfb-repeater-add-btn {
    padding: 10px 16px;
    background: var(--ngfb-form-primary, #4F46E5);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.ngfb-repeater-add-btn:hover {
    background: var(--ngfb-form-primary-dark, #4338CA);
}

.ngfb-repeater-remove-btn {
    padding: 6px 12px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.ngfb-repeater-remove-btn:hover {
    background: #DC2626;
}

/* ===== TABLE FIELDS ===== */
.ngfb-table-container {
    margin-bottom: 20px;
}

.ngfb-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 8px;
    background: var(--ngfb-form-surface, #ffffff);
}

.ngfb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ngfb-table thead {
    background: var(--ngfb-form-primary-lighter, #f3f4f6);
    border-bottom: 2px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--ngfb-form-text, #1f2937);
    white-space: nowrap;
}

.ngfb-table tbody tr {
    border-bottom: 1px solid var(--ngfb-form-border, #E5E7EB);
    transition: background 0.2s ease;
}

.ngfb-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
}

.ngfb-table td {
    padding: 12px;
    color: var(--ngfb-form-text, #1f2937);
}

.ngfb-table-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ngfb-table-input:focus {
    outline: none;
    border-color: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ngfb-currency-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--ngfb-form-border, #E5E7EB);
    border-radius: 6px;
    overflow: hidden;
    background: var(--ngfb-form-surface, #ffffff);
}

.ngfb-currency-symbol {
    padding: 8px 12px;
    background: var(--ngfb-form-primary-lighter, #f3f4f6);
    color: var(--ngfb-form-text, #1f2937);
    font-weight: 600;
    border-right: 1px solid var(--ngfb-form-border, #E5E7EB);
}

.ngfb-currency-input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
}

.ngfb-currency-input:focus {
    outline: none;
}

/* Hide number input spinners (up/down arrows) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* ===== FORM HEADER STYLES ===== */

.ngfb-form-header {
    width: 100%;
    padding: 32px 24px;
    margin-bottom: 24px;
    color: #1f2937;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    /* Background and shadow are controlled by header style classes */
}

.ngfb-form-header.ngfb-header-compact {
    padding: 16px 24px;
    margin-bottom: 16px;
}

.ngfb-form-header.ngfb-header-normal {
    padding: 32px 24px;
    margin-bottom: 24px;
}

.ngfb-form-header.ngfb-header-large {
    padding: 48px 24px;
    margin-bottom: 32px;
}

.ngfb-form-header.ngfb-header-with-divider {
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

/* ===== HEADER STYLE PRESETS ===== */
/* All header styles are now applied via inline styles in previewCore.js */
/* CSS classes removed to avoid conflicts with dynamic styling */

.ngfb-header-content {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ngfb-header-content.ngfb-logo-position-left {
    flex-direction: row;
    justify-content: flex-start;
}

.ngfb-header-content.ngfb-logo-position-center {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.ngfb-header-content.ngfb-logo-position-right {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.ngfb-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: fadeInDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Support for inline styles (custom dimensions) */
    /* Default dimensions - will be overridden by inline styles */
    width: 60px;
    height: 60px;
}

.ngfb-logo-container.ngfb-logo-size-small {
    width: 40px;
    height: 40px;
}

.ngfb-logo-container.ngfb-logo-size-medium {
    width: 60px;
    height: 60px;
}

.ngfb-logo-container.ngfb-logo-size-large {
    width: 80px;
    height: 80px;
}

.ngfb-logo-container.ngfb-logo-size-xlarge {
    width: 100px;
    height: 100px;
}

.ngfb-logo-container.ngfb-logo-size-xxlarge {
    width: 120px;
    height: 120px;
}

.ngfb-logo-container.ngfb-logo-size-jumbo {
    width: 150px;
    height: 150px;
}

.ngfb-form-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ngfb-form-logo:hover {
    transform: scale(1.05);
}

.ngfb-header-text {
    flex: 1;
    min-width: 0;
    width: 100%;
    animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.ngfb-form-title {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ngfb-form-description {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
    opacity: 0.85;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

@media (max-width: 768px) {
    .ngfb-form-header {
        padding: 24px 16px;
        margin-bottom: 16px;
        border-radius: 8px;
    }

    .ngfb-form-header.ngfb-header-compact {
        padding: 12px 16px;
        margin-bottom: 12px;
    }

    .ngfb-form-header.ngfb-header-normal {
        padding: 24px 16px;
        margin-bottom: 16px;
    }

    .ngfb-form-header.ngfb-header-large {
        padding: 32px 16px;
        margin-bottom: 24px;
    }

    .ngfb-header-content {
        gap: 16px;
    }

    .ngfb-form-title {
        font-size: 22px;
    }

    .ngfb-form-description {
        font-size: 13px;
    }

    .ngfb-header-content.ngfb-logo-position-center,
    .ngfb-header-content.ngfb-logo-position-left,
    .ngfb-header-content.ngfb-logo-position-right {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ngfb-form-header {
        padding: 16px 12px;
        margin-bottom: 12px;
        border-radius: 6px;
    }

    .ngfb-form-header.ngfb-header-compact {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    .ngfb-form-header.ngfb-header-normal {
        padding: 16px 12px;
        margin-bottom: 12px;
    }

    .ngfb-form-header.ngfb-header-large {
        padding: 24px 12px;
        margin-bottom: 16px;
    }

    .ngfb-header-content {
        gap: 12px;
    }

    .ngfb-logo-container.ngfb-logo-size-small {
        width: 32px;
        height: 32px;
    }

    .ngfb-logo-container.ngfb-logo-size-medium {
        width: 48px;
        height: 48px;
    }

    .ngfb-logo-container.ngfb-logo-size-large {
        width: 64px;
        height: 64px;
    }

    .ngfb-logo-container.ngfb-logo-size-xlarge {
        width: 80px;
        height: 80px;
    }

    .ngfb-logo-container.ngfb-logo-size-xxlarge {
        width: 96px;
        height: 96px;
    }

    .ngfb-logo-container.ngfb-logo-size-jumbo {
        width: 120px;
        height: 120px;
    }

    .ngfb-form-title {
        font-size: 18px;
    }

    .ngfb-form-description {
        font-size: 12px;
    }
}

.ngfb-form-header:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Auto-save Toast Notification */
.ngfb-autosave-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 14px;
    font-weight: 500;
    color: #10B981;
}

.ngfb-autosave-toast.fade-out {
    animation: slideOutDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

/* Last Saved Display */
.ngfb-last-saved {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
    display: none;
    font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
    .ngfb-form-header,
    .ngfb-logo-container,
    .ngfb-header-text,
    .ngfb-form-logo {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   SLIDER STYLE VARIANTS
   ============================================ */

/* 1. GRADIENT SMOOTH (Default) */
.ngfb-slider--gradient-smooth {
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
}

.ngfb-slider--gradient-smooth::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    border: 2px solid #ffffff !important;
    cursor: pointer !important;
}

.ngfb-slider--gradient-smooth::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    border: 2px solid #ffffff !important;
    cursor: pointer !important;
}

.ngfb-slider--gradient-smooth::-moz-range-progress {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    height: 8px;
    border-radius: 5px;
}

/* 2. MINIMAL FLAT */
.ngfb-slider--minimal-flat {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
}

.ngfb-slider--minimal-flat::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    border: none;
}

.ngfb-slider--minimal-flat::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    border: none;
}

.ngfb-slider--minimal-flat::-moz-range-progress {
    background: var(--ngfb-form-primary, #4F46E5);
    height: 4px;
    border-radius: 2px;
}

/* 3. NEON GLOW */
.ngfb-slider--neon-glow {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, 
        var(--ngfb-form-accent, #10B981) 0%, 
        var(--ngfb-form-accent, #10B981) var(--slider-value, 0%), 
        color-mix(in srgb, var(--ngfb-form-accent, #10B981) 25%, transparent) var(--slider-value, 0%), 
        color-mix(in srgb, var(--ngfb-form-accent, #10B981) 25%, transparent) 100%);
}

.ngfb-slider--neon-glow::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ngfb-form-accent, #10B981);
    box-shadow: 0 0 10px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 70%, transparent), 
                0 0 20px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 40%, transparent), 
                inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid #ffffff;
}

.ngfb-slider--neon-glow::-webkit-slider-thumb:hover {
    box-shadow: 0 0 15px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 80%, transparent), 
                0 0 30px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 60%, transparent), 
                inset 0 0 5px rgba(255, 255, 255, 0.5);
}

.ngfb-slider--neon-glow::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ngfb-form-accent, #10B981);
    box-shadow: 0 0 10px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 70%, transparent), 
                0 0 20px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 40%, transparent);
    border: 2px solid #ffffff;
}

.ngfb-slider--neon-glow::-moz-range-progress {
    background: var(--ngfb-form-accent, #10B981);
    height: 6px;
    border-radius: 3px;
    box-shadow: 0 0 8px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 60%, transparent);
}

/* 4. GLASS MORPHISM */
.ngfb-slider--glass-morphism {
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        rgba(79, 70, 229, 0.3) 0%, 
        rgba(79, 70, 229, 0.3) var(--slider-value, 0%), 
        rgba(255, 255, 255, 0.1) var(--slider-value, 0%), 
        rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
}

.ngfb-slider--glass-morphism::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.4);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.ngfb-slider--glass-morphism::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.ngfb-slider--glass-morphism::-moz-range-progress {
    background: rgba(79, 70, 229, 0.3);
    height: 8px;
    border-radius: 5px;
}

/* 5. RETRO SLIDER */
.ngfb-slider--retro {
    height: 12px;
    border-radius: 0;
    /* Distinct retro look: diagonal stripes + subtle ticks + theme split */
    background:
        /* diagonal stripes overlay */
        repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.08) 0 6px,
            transparent 6px 12px),
        /* subtle tick marks along the track */
        repeating-linear-gradient(to right,
            rgba(0, 0, 0, 0.10) 0 2px,
            transparent 2px 12px),
        /* theme-aware split fill */
        linear-gradient(to right,
            var(--ngfb-form-primary, #4F46E5) 0%,
            var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%),
            var(--ngfb-form-accent, #10B981) var(--slider-value, 0%),
            var(--ngfb-form-accent, #10B981) 100%) !important;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    border: 2px solid var(--ngfb-form-border, #333) !important;
}

.ngfb-slider--retro::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    /* checkered overlay + theme gradient base */
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent),
        linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    background-size: 6px 6px, auto;
    box-shadow: 3px 3px 0 var(--ngfb-form-border, #333), 0 2px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid var(--ngfb-form-border, #333) !important;
    outline: 1px dashed var(--ngfb-form-border, #333);
    outline-offset: -2px;
}

.ngfb-slider--retro::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent),
        linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    background-size: 6px 6px, auto;
    box-shadow: 3px 3px 0 var(--ngfb-form-border, #333), 0 2px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid var(--ngfb-form-border, #333) !important;
    outline: 1px dashed var(--ngfb-form-border, #333);
    outline-offset: -2px;
}

.ngfb-slider--retro::-moz-range-progress {
    background: var(--ngfb-form-primary, #4F46E5) !important;
    height: 10px;
    border: none;
}

/* 6. MODERN MINIMAL (Thin Line) */
.ngfb-slider--modern-minimal {
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
}

.ngfb-slider--modern-minimal::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: none;
}

.ngfb-slider--modern-minimal::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ngfb-form-primary, #4F46E5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: none;
}

.ngfb-slider--modern-minimal::-moz-range-progress {
    background: var(--ngfb-form-primary, #4F46E5);
    height: 2px;
    border-radius: 1px;
}

/* 7. DUAL COLOR */
.ngfb-slider--dual-color {
    height: 10px;
    border-radius: 5px;
    /* Vivid split with soft inner glow */
    background: linear-gradient(to right,
        var(--ngfb-form-primary, #4F46E5) 0%,
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%),
        var(--ngfb-form-accent, #10B981) var(--slider-value, 0%),
        var(--ngfb-form-accent, #10B981) 100%) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 35%, transparent),
                inset 0 0 12px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 20%, transparent);
}

.ngfb-slider--dual-color::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5) 0%, var(--ngfb-form-accent, #10B981) 100%) !important;
    /* Vibrant glow ring */
    box-shadow: 0 4px 12px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 35%, transparent),
                0 0 0 2px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 30%, transparent);
    border: 3px solid #ffffff;
}

.ngfb-slider--dual-color::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5) 0%, var(--ngfb-form-accent, #10B981) 100%) !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 35%, transparent),
                0 0 0 2px color-mix(in srgb, var(--ngfb-form-accent, #10B981) 30%, transparent);
    border: 3px solid #ffffff;
}

.ngfb-slider--dual-color::-moz-range-progress {
    background: var(--ngfb-form-primary, #4F46E5) !important;
    height: 10px;
    border-radius: 5px;
}

/* 8. ANIMATED PULSE */
.ngfb-slider--animated-pulse {
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
}

.ngfb-slider--animated-pulse::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    /* stronger halo to ensure visibility */
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 40%, transparent);
    border: 2px solid #ffffff;
    animation: sliderPulse 1.2s ease-out infinite;
}

.ngfb-slider--animated-pulse::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 40%, transparent);
    border: 2px solid #ffffff;
    animation: sliderPulse 1.2s ease-out infinite;
}

.ngfb-slider--animated-pulse::-moz-range-progress {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    height: 8px;
    border-radius: 5px;
}

@keyframes sliderPulse {
    0% {
        box-shadow:
            0 0 0 2px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 45%, transparent),
            0 0 0 0 color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 35%, transparent);
        transform: scale(1);
    }
    60% {
        box-shadow:
            0 0 0 2px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 45%, transparent),
            0 0 0 12px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 0%, transparent);
        transform: scale(1.04);
    }
    100% {
        box-shadow:
            0 0 0 2px color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 45%, transparent),
            0 0 0 0 color-mix(in srgb, var(--ngfb-form-primary, #4F46E5) 0%, transparent);
        transform: scale(1);
    }
}

/* 9. PILL SLIDER (Rounded Rectangle) */
.ngfb-slider--pill {
    height: 12px;
    border-radius: 10px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
}

.ngfb-slider--pill::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
}

.ngfb-slider--pill::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
}

.ngfb-slider--pill::-moz-range-progress {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    height: 12px;
    border-radius: 10px;
}

/* 10. THICK BOLD SLIDER */
.ngfb-slider--thick-bold {
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(to right, 
        var(--ngfb-form-primary, #4F46E5) 0%, 
        var(--ngfb-form-primary, #4F46E5) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) var(--slider-value, 0%), 
        var(--ngfb-form-border, #E5E7EB) 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ngfb-slider--thick-bold::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 3px rgba(255, 255, 255, 0.3);
    border: 3px solid #ffffff;
}

.ngfb-slider--thick-bold::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 3px solid #ffffff;
}

.ngfb-slider--thick-bold::-moz-range-progress {
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981));
    height: 16px;
    border-radius: 8px;
}

/* ============================================
   SLIDER THUMB SHAPE VARIANTS
   ============================================ */

/* SQUARE THUMB */
.ngfb-slider--thumb-square::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 2px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

.ngfb-slider--thumb-square::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 2px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

/* DIAMOND THUMB */
.ngfb-slider--thumb-diamond::-webkit-slider-thumb {
    width: 22px !important;
    height: 22px !important;
    border-radius: 0 !important;
    background: linear-gradient(45deg, var(--ngfb-form-primary, #4F46E5) 50%, var(--ngfb-form-accent, #10B981) 50%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    transform: rotate(45deg) !important;
}

.ngfb-slider--thumb-diamond::-moz-range-thumb {
    width: 22px !important;
    height: 22px !important;
    border-radius: 0 !important;
    background: linear-gradient(45deg, var(--ngfb-form-primary, #4F46E5) 50%, var(--ngfb-form-accent, #10B981) 50%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    transform: rotate(45deg) !important;
}

/* TRIANGLE THUMB (Pointing Down) */
.ngfb-slider--thumb-triangle::-webkit-slider-thumb {
    width: 0 !important;
    height: 0 !important;
    border-left: 12px solid transparent !important;
    border-right: 12px solid transparent !important;
    border-top: 20px solid var(--ngfb-form-primary, #4F46E5) !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

.ngfb-slider--thumb-triangle::-moz-range-thumb {
    width: 0 !important;
    height: 0 !important;
    border-left: 12px solid transparent !important;
    border-right: 12px solid transparent !important;
    border-top: 20px solid var(--ngfb-form-primary, #4F46E5) !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

/* STAR THUMB */
.ngfb-slider--thumb-star::-webkit-slider-thumb {
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%) !important;
}

.ngfb-slider--thumb-star::-moz-range-thumb {
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%) !important;
}

/* HEART THUMB */
.ngfb-slider--thumb-heart::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--ngfb-form-primary, #4F46E5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    clip-path: polygon(50% 100%, 0% 50%, 0% 25%, 25% 0%, 50% 25%, 75% 0%, 100% 25%, 100% 50%) !important;
}

.ngfb-slider--thumb-heart::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--ngfb-form-primary, #4F46E5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    clip-path: polygon(50% 100%, 0% 50%, 0% 25%, 25% 0%, 50% 25%, 75% 0%, 100% 25%, 100% 50%) !important;
}

/* HEXAGON THUMB */
.ngfb-slider--thumb-hexagon::-webkit-slider-thumb {
    width: 22px !important;
    height: 22px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
}

.ngfb-slider--thumb-hexagon::-moz-range-thumb {
    width: 22px !important;
    height: 22px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
}

/* ROUNDED SQUARE THUMB */
.ngfb-slider--thumb-rounded-square::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

.ngfb-slider--thumb-rounded-square::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

/* OVAL/PILL THUMB */
.ngfb-slider--thumb-oval::-webkit-slider-thumb {
    width: 28px !important;
    height: 16px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

.ngfb-slider--thumb-oval::-moz-range-thumb {
    width: 28px !important;
    height: 16px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

/* VERTICAL BAR THUMB */
.ngfb-slider--thumb-bar::-webkit-slider-thumb {
    width: 8px !important;
    height: 24px !important;
    border-radius: 4px !important;
    background: linear-gradient(90deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

.ngfb-slider--thumb-bar::-moz-range-thumb {
    width: 8px !important;
    height: 24px !important;
    border-radius: 4px !important;
    background: linear-gradient(90deg, var(--ngfb-form-primary, #4F46E5), var(--ngfb-form-accent, #10B981)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

/* PLUS/CROSS THUMB */
.ngfb-slider--thumb-plus::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--ngfb-form-primary, #4F46E5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0% 60%, 0% 40%, 40% 40%) !important;
}

.ngfb-slider--thumb-plus::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--ngfb-form-primary, #4F46E5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
    clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0% 60%, 0% 40%, 40% 40%) !important;
}

/* ============================================
   LIGHT ANIMATIONS FOR SLIDERS
   ============================================ */

/* Smooth hover animation for all sliders */
.ngfb-slider {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.ngfb-slider:hover {
    filter: brightness(1.05);
}

.ngfb-slider:active {
    filter: brightness(1.1);
}

/* Thumb hover animations */
.ngfb-slider::-webkit-slider-thumb {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ngfb-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.ngfb-slider::-moz-range-thumb {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.ngfb-slider::-moz-range-thumb:active {
    transform: scale(1.2);
}

/* Glow effect on focus */
.ngfb-slider:focus {
    outline: none;
    filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.4));
}

/* Smooth value display animation */
.ngfb-slider-value {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-slider-container:hover .ngfb-slider-value {
    transform: scale(1.05);
}

/* Subtle scale labels animation */
.ngfb-slider-scale-label {
    transition: all 0.3s ease;
}

.ngfb-slider-container:hover .ngfb-slider-scale-label {
    opacity: 0.8;
    font-weight: 600;
}

/* Track animation on interaction */
.ngfb-slider--gradient-smooth {
    transition: background 0.4s ease;
}

.ngfb-slider--gradient-smooth:hover {
    filter: saturate(1.1);
}

/* Neon glow animation */
.ngfb-slider--neon-glow {
    animation: neonFlicker 0.15s infinite;
}

@keyframes neonFlicker {
    0%, 100% {
        filter: drop-shadow(0 0 8px #00ff88);
    }
    50% {
        filter: drop-shadow(0 0 12px #00ff88);
    }
}

/* Animated pulse thumb - enhanced */
.ngfb-slider--animated-pulse::-webkit-slider-thumb {
    animation: sliderPulse 2s infinite;
}

.ngfb-slider--animated-pulse::-moz-range-thumb {
    animation: sliderPulse 2s infinite;
}

/* Smooth fill animation */
@keyframes fillAnimation {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

.ngfb-slider:active {
    animation: fillAnimation 0.2s ease-out;
}

/* Slider container entrance animation */
.ngfb-slider-container {
    animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Value display pulse on change */
.ngfb-slider-value {
    animation: valuePulse 0.4s ease-out;
}

@keyframes valuePulse {
    0% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Smooth thumb shape transitions */
.ngfb-slider--thumb-square::-webkit-slider-thumb,
.ngfb-slider--thumb-diamond::-webkit-slider-thumb,
.ngfb-slider--thumb-triangle::-webkit-slider-thumb,
.ngfb-slider--thumb-star::-webkit-slider-thumb,
.ngfb-slider--thumb-heart::-webkit-slider-thumb,
.ngfb-slider--thumb-hexagon::-webkit-slider-thumb,
.ngfb-slider--thumb-rounded-square::-webkit-slider-thumb,
.ngfb-slider--thumb-oval::-webkit-slider-thumb,
.ngfb-slider--thumb-bar::-webkit-slider-thumb,
.ngfb-slider--thumb-plus::-webkit-slider-thumb {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-slider--thumb-square::-moz-range-thumb,
.ngfb-slider--thumb-diamond::-moz-range-thumb,
.ngfb-slider--thumb-triangle::-moz-range-thumb,
.ngfb-slider--thumb-star::-moz-range-thumb,
.ngfb-slider--thumb-heart::-moz-range-thumb,
.ngfb-slider--thumb-hexagon::-moz-range-thumb,
.ngfb-slider--thumb-rounded-square::-moz-range-thumb,
.ngfb-slider--thumb-oval::-moz-range-thumb,
.ngfb-slider--thumb-bar::-moz-range-thumb,
.ngfb-slider--thumb-plus::-moz-range-thumb {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth shadow animation on hover */
.ngfb-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

.ngfb-slider::-moz-range-thumb:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Gradient animation for dual-color slider */
.ngfb-slider--dual-color {
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        filter: saturate(1);
    }
    50% {
        filter: saturate(1.1);
    }
}

/* Smooth track animation */
.ngfb-slider--pill::-webkit-slider-thumb,
.ngfb-slider--thick-bold::-webkit-slider-thumb {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ngfb-slider--pill::-moz-range-thumb,
.ngfb-slider--thick-bold::-moz-range-thumb {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Minimal flat slider smooth interaction */
.ngfb-slider--minimal-flat {
    transition: all 0.3s ease;
}

.ngfb-slider--minimal-flat:hover {
    filter: brightness(1.1) contrast(1.05);
}

/* Glass morphism blur animation */
.ngfb-slider--glass-morphism {
    animation: glassShimmer 4s ease-in-out infinite;
}

@keyframes glassShimmer {
    0%, 100% {
        backdrop-filter: blur(10px);
    }
    50% {
        backdrop-filter: blur(12px);
    }
}

/* Retro slider animation */
.ngfb-slider--retro {
    animation: retroFlash 0.3s ease-out;
}

@keyframes retroFlash {
    0% {
        filter: brightness(1.2);
    }
    100% {
        filter: brightness(1);
    }
}

/* Modern minimal smooth interaction */
.ngfb-slider--modern-minimal::-webkit-slider-thumb {
    transition: all 0.25s ease-out;
}

.ngfb-slider--modern-minimal::-moz-range-thumb {
    transition: all 0.25s ease-out;
}

/* Smooth color transition for themed sliders */
.ngfb-slider {
    transition: background 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Label and help text animations */
.ngfb-field-label {
    transition: all 0.3s ease;
}

.ngfb-slider-container:hover .ngfb-field-label {
    color: var(--ngfb-form-primary, #4F46E5);
    font-weight: 600;
}