/* Easy Form Frontend Styles */
.easy-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.ef-form-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.ef-form-description {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
}

.ef-form-fields {
    margin-bottom: 20px;
}

.ef-field-wrapper {
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.ef-field-wrapper label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.ef-field-wrapper label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.ef-rating-field .ef-stars-container {
    font-size: 24px;
    cursor: pointer;
}

.ef-star {
    color: #ddd;
    transition: color 0.2s ease;
    margin-right: 4px;
}

.ef-star:hover,
.ef-star.ef-star-active {
    color: inherit;
}

.ef-star:hover ~ .ef-star {
    color: #ddd;
}

.ef-input,
.ef-textarea,
.ef-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ef-input:focus,
.ef-textarea:focus,
.ef-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Enhanced field validation states */
.ef-field-error .ef-input,
.ef-field-error .ef-textarea,
.ef-field-error .ef-select {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.ef-field-success .ef-input,
.ef-field-success .ef-textarea,
.ef-field-success .ef-select {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

.ef-textarea {
    resize: vertical;
    min-height: 100px;
}

.ef-checkbox-field,
.ef-radio-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ef-checkbox-option,
.ef-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ef-checkbox-option:hover,
.ef-radio-option:hover {
    background-color: #f8f9fa;
}

.ef-checkbox-option input,
.ef-radio-option input {
    width: auto;
    margin: 0;
}

.ef-html-field {
    margin: 20px 0;
}

.ef-divider-field hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

.ef-form-submit {
    text-align: center;
    margin-top: 30px;
}

.ef-submit-btn {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 140px;
}

.ef-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.ef-submit-btn:active {
    transform: translateY(0);
}

.ef-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced loading state */
.ef-loading .ef-submit-btn {
    color: transparent;
    pointer-events: none;
}

.ef-loading .ef-submit-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: ef-spin 1s linear infinite;
}

@keyframes ef-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced form messages */
.ef-form-messages {
    margin-top: 20px;
}

.ef-success-message,
.ef-form-message.ef-success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 16px 20px;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: ef-slide-in 0.3s ease-out;
}

.ef-success-message::before,
.ef-form-message.ef-success-message::before {
    content: "✓";
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.ef-error-message,
.ef-form-message.ef-error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 16px 20px;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: ef-slide-in 0.3s ease-out;
}

.ef-error-message::before,
.ef-form-message.ef-error-message::before {
    content: "⚠";
    background: #dc3545;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

@keyframes ef-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pro Features Styles */
.ef-file-upload-field {
    position: relative;
}

.ef-file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ef-file-label {
    display: block;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.ef-file-label:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.ef-file-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.ef-date-picker,
.ef-time-picker {
    position: relative;
}

.ef-rating-field {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
}

.ef-star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ef-star:hover,
.ef-star.active {
    color: #ffc107;
    transform: scale(1.1);
}

/* Elite Features Styles */
.ef-signature-field {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.ef-signature-canvas {
    width: 100%;
    height: 200px;
    cursor: crosshair;
    display: block;
}

.ef-signature-controls {
    padding: 10px;
    border-top: 1px solid #ddd;
    text-align: center;
    background: #f8f9fa;
}

.ef-signature-clear {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.ef-signature-clear:hover {
    background: #c82333;
}

.ef-multi-step-form .ef-step {
    display: none;
    animation: ef-fade-in 0.3s ease-in-out;
}

.ef-multi-step-form .ef-step.active {
    display: block;
}

@keyframes ef-fade-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.ef-step-indicators {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.ef-step-indicator {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.ef-step-indicator.active {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.ef-step-indicator.completed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.ef-step-indicator.completed::after {
    content: "✓";
    position: absolute;
    font-size: 16px;
    font-weight: bold;
}

.ef-step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.ef-step-prev,
.ef-step-next {
    padding: 12px 24px;
    border: 2px solid #007cba;
    background: #fff;
    color: #007cba;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ef-step-prev:hover,
.ef-step-next:hover {
    background: #007cba;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.ef-step-prev:disabled,
.ef-step-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ef-step-prev::before {
    content: "←";
    font-weight: bold;
}

.ef-step-next::after {
    content: "→";
    font-weight: bold;
}

/* Payment field styles */
.ef-payment-field {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
}

.ef-payment-amount {
    font-size: 28px;
    font-weight: bold;
    color: #007cba;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ef-payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ef-payment-method {
    padding: 16px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
}

.ef-payment-method:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.ef-payment-method.selected {
    border-color: #007cba;
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    color: #005a87;
}

/* Enhanced form states */
.ef-form-submitting {
    pointer-events: none;
    opacity: 0.8;
}

.ef-form-submitted .ef-form-fields {
    opacity: 0.6;
    pointer-events: none;
}

/* Redirect message styling */
.ef-redirect-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 16px 20px;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: ef-slide-in 0.3s ease-out;
}

.ef-redirect-message::before {
    content: "↗";
    background: #ffc107;
    color: #212529;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* Accessibility improvements */
.ef-input:focus,
.ef-textarea:focus,
.ef-select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ef-input,
    .ef-textarea,
    .ef-select {
        border-width: 2px;
    }
    
    .ef-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ef-input,
    .ef-textarea,
    .ef-select,
    .ef-submit-btn,
    .ef-field-wrapper,
    .ef-step-indicator,
    .ef-payment-method {
        transition: none;
    }
    
    .ef-success-message,
    .ef-error-message,
    .ef-redirect-message {
        animation: none;
    }
    
    .ef-loading .ef-submit-btn::after {
        animation: none;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .easy-form-container {
        padding: 15px;
        margin: 10px;
    }
    
    .ef-input,
    .ef-textarea,
    .ef-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .ef-checkbox-field,
    .ef-radio-field {
        gap: 15px;
    }
    
    .ef-step-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .ef-step-prev,
    .ef-step-next {
        justify-content: center;
    }
    
    .ef-payment-methods {
        grid-template-columns: 1fr;
    }
    
    .ef-submit-btn {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .ef-form-title {
        font-size: 20px;
    }
    
    .ef-rating-field {
        justify-content: center;
    }
    
    .ef-step-indicators {
        gap: 5px;
    }
    
    .ef-step-indicator {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .ef-payment-amount {
        font-size: 24px;
    }
    
    .ef-success-message,
    .ef-error-message,
    .ef-redirect-message {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .ef-submit-btn,
    .ef-form-messages {
        display: none;
    }
    
    .ef-input,
    .ef-textarea,
    .ef-select {
        border: 1px solid #000;
        background: transparent;
    }
}

/* ========================================
   NUMBER FIELD STYLES
   ======================================== */

.ef-number-field .ef-number-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: #1d2327;
}

.ef-number-field .ef-number-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ef-number-field .ef-number-input:invalid {
    border-color: #d63638;
}

.ef-number-field .ef-number-input::placeholder {
    color: #8c8f94;
    opacity: 1;
}

/* Number input spinner buttons */
.ef-number-field .ef-number-input::-webkit-outer-spin-button,
.ef-number-field .ef-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}



/* Custom number input with increment/decrement buttons */
.ef-number-field.ef-custom-spinner {
    position: relative;
}

.ef-number-field .ef-number-controls {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ef-number-field .ef-number-btn {
    width: 20px;
    height: 16px;
    border: 1px solid #dcdcde;
    background: #f6f7f7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.ef-number-field .ef-number-btn:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.ef-number-field .ef-number-btn:active {
    background: #dcdcde;
}

/* ========================================
   DATE PICKER FIELD STYLES
   ======================================== */

.ef-date-field .ef-date-picker {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
}

.ef-date-field .ef-date-picker:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ef-date-field .ef-date-picker:invalid {
    border-color: #d63638;
}

/* Calendar icon for date picker */
.ef-date-field {
    position: relative;
}

.ef-date-field::after {
    content: "\1f4c5";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    color: #8c8f94;
}

/* Hide default calendar icon in some browsers */
.ef-date-field .ef-date-picker::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Date input placeholder styling */
.ef-date-field .ef-date-picker:invalid {
    color: #8c8f94;
}

.ef-date-field .ef-date-picker:valid {
    color: #1d2327;
}

/* ========================================
   STAR RATING FIELD STYLES
   ======================================== */

.ef-rating-field {
    margin-bottom: 20px;
}

.ef-rating-field .ef-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.ef-stars-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 24px;
    line-height: 1;
}

.ef-star {
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    display: inline-block;
}

.ef-star:hover {
    transform: scale(1.1);
}

.ef-star.ef-star-active {
    color: inherit;
}

.ef-star.ef-star-hover {
    color: inherit;
    opacity: 0.7;
}

/* Star size variations */
.ef-stars-container.ef-size-small {
    font-size: 16px;
}

.ef-stars-container.ef-size-medium {
    font-size: 24px;
}

.ef-stars-container.ef-size-large {
    font-size: 32px;
}

/* Rating display text */
.ef-rating-display {
    margin-top: 8px;
}

.ef-rating-text {
    font-size: 13px;
    color: #646970;
    font-style: italic;
}

/* Clear rating button */
.ef-rating-clear {
    background: none;
    border: none;
    color: #646970;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    text-decoration: underline;
    padding: 0;
}

.ef-rating-clear:hover {
    color: #d63638;
}

/* Half star support */
.ef-star.ef-star-half {
    position: relative;
    overflow: hidden;
}

.ef-star.ef-star-half::before {
    content: "★";
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: inherit;
}

.ef-star.ef-star-half::after {
    content: "★";
    position: absolute;
    right: 0;
    width: 50%;
    overflow: hidden;
    color: #ddd;
}

/* Star hover effects */
.ef-rating-field:not(.ef-disabled) .ef-star:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.ef-rating-field:not(.ef-disabled) .ef-star:hover ~ .ef-star {
    color: #ddd;
}

/* Rating field validation states */
.ef-rating-field.ef-field-error .ef-stars-container {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.ef-rating-field.ef-field-success .ef-stars-container {
    animation: success-pulse 0.5s;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Star size variations */
.ef-stars-container.ef-size-small {
    font-size: 16px;
}

.ef-stars-container.ef-size-medium {
    font-size: 24px;
}

.ef-stars-container.ef-size-large {
    font-size: 32px;
}

/* Rating display text */
.ef-rating-display {
    margin-top: 8px;
}

.ef-rating-text {
    font-size: 13px;
    color: #646970;
    font-style: italic;
}

/* Clear rating button */
.ef-rating-clear {
    background: none;
    border: none;
    color: #646970;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    text-decoration: underline;
    padding: 0;
}

.ef-rating-clear:hover {
    color: #d63638;
}

/* Required field indicator */
.ef-rating-field .required {
    color: #d63638;
    margin-left: 4px;
}

/* Error state for rating field */
.ef-rating-field.ef-field-error .ef-stars-container {
    border: 2px dashed #d63638;
    border-radius: 6px;
    padding: 8px;
}

.ef-rating-field.ef-field-error .ef-field-label {
    color: #d63638;
}

/* Success state for rating field */
.ef-rating-field.ef-field-success .ef-stars-container {
    border: 2px solid #00a32a;
    border-radius: 6px;
    padding: 8px;
}

/* ========================================
   ADMIN FORM BUILDER STYLES
   ======================================== */

/* Field type buttons in admin */
.ef-field-type[data-field-type="number"],
.ef-field-type[data-field-type="date_picker"],
.ef-field-type[data-field-type="rating"] {
    position: relative;
}

/* Pro badge for new field types */
.ef-field-type[data-field-type="number"]::after,
.ef-field-type[data-field-type="date_picker"]::after,
.ef-field-type[data-field-type="rating"]::after {
    content: "PRO";
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}

/* Field preview in form builder */
.ef-field-preview .ef-number-input,
.ef-field-preview .ef-date-picker {
    pointer-events: none;
    background: #f9f9f9;
}

.ef-field-preview .ef-stars-container {
    pointer-events: none;
}

.ef-field-preview .ef-star {
    cursor: default;
}

/* Settings panel styles */
.ef-settings-section h4 {
    margin: 20px 0 15px 0;
    padding-top: 15px;
    border-top: 1px solid #f0f0f1;
    color: #1d2327;
    font-size: 14px;
    font-weight: 600;
}

.ef-setting-row {
    margin-bottom: 16px;
}

.ef-setting-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1d2327;
    font-size: 13px;
}

.ef-setting-row small {
    display: block;
    margin-top: 4px;
    color: #646970;
    font-size: 12px;
    line-height: 1.4;
}

.ef-custom-date-row {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 3px solid #007cba;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .ef-stars-container {
        font-size: 20px;
    }
    
    .ef-stars-container.ef-size-large {
        font-size: 28px;
    }
    
    .ef-number-field .ef-number-input,
    .ef-date-field .ef-date-picker {
        font-size: 16px;
        padding: 10px 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ef-number-field .ef-number-input,
    .ef-date-field .ef-date-picker {
        background: #1d1d1d;
        border-color: #444;
        color: #fff;
    }
    
    .ef-number-field .ef-number-input::placeholder {
        color: #888;
    }
    
    .ef-rating-field .ef-field-label {
        color: #fff;
    }
    
    .ef-rating-text {
        color: #aaa;
    }
}

/* Print styles */
@media print {
    .ef-rating-field .ef-stars-container {
        color: #000 !important;
    }
    
    .ef-star:not(.ef-star-active) {
        color: #ccc !important;
    }
}