/* Placeholder for Form Master Drag & Drop frontend CSS */ 

/* Form Master Drag & Drop Frontend Styles */

.fm-form-renderer {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fm-form-title {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.fm-form-description {
  margin-bottom: 25px;
  color: #666;
  text-align: center;
  line-height: 1.5;
}

.fm-progress-bar {
  position: relative;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  margin-bottom: 25px;
  overflow: hidden;
}

.fm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0073aa, #005a87);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fm-progress-text {
  position: absolute;
  top: -25px;
  right: 0;
  font-size: 12px;
  color: #666;
}

.fm-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-weight: 500;
}

.fm-message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.fm-message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.fm-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fm-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fm-field-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.fm-required {
  color: #dc3545;
  margin-left: 4px;
}

.fm-field-description {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.fm-field {
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #fff;
}

.fm-field:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.fm-field-error {
  border-color: #dc3545;
}

.fm-field-error-message {
  color: #dc3545;
  font-size: 12px;
  font-weight: 500;
}

.fm-field:disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

/* Textarea */
.fm-field-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* Select */
.fm-field-select {
  cursor: pointer;
}

/* Radio and Checkbox Groups */
.fm-radio-group,
.fm-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fm-radio-option,
.fm-checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
}

.fm-radio-option input[type="radio"],
.fm-checkbox-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.fm-radio-label,
.fm-checkbox-label {
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

/* File Upload */
.fm-field-file {
  padding: 8px;
  border: 2px dashed #e9ecef;
  background: #f8f9fa;
  cursor: pointer;
  text-align: center;
}

.fm-field-file:hover {
  border-color: #0073aa;
  background: #f0f8ff;
}

.fm-file-preview {
  margin-top: 10px;
}

.fm-file-preview img {
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Range Slider */
.fm-range-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.fm-field-range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  outline: none;
  -webkit-appearance: none;
}

.fm-field-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0073aa;
  cursor: pointer;
}

.fm-field-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0073aa;
  cursor: pointer;
  border: none;
}

.fm-range-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  color: #0073aa;
}

/* Rating Stars */
.fm-rating-container {
  display: flex;
  gap: 5px;
}

.fm-star {
  background: none;
  border: none;
  font-size: 24px;
  color: #e9ecef;
  cursor: pointer;
  transition: color 0.2s ease;
}

.fm-star:hover,
.fm-star.fm-star-filled {
  color: #ffc107;
}

/* Signature Canvas */
.fm-signature-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fm-signature-canvas {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  cursor: crosshair;
  background: #fff;
}

.fm-clear-signature {
  align-self: flex-start;
  padding: 8px 16px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s ease;
}

.fm-clear-signature:hover {
  background: #5a6268;
}

/* HTML Content */
.fm-html-content {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #0073aa;
}

/* Section and Divider */
.fm-field-section {
  background: #f0f8ff;
  border: 1px solid #0073aa;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}

.fm-field-section h4 {
  margin: 0 0 10px 0;
  color: #0073aa;
  font-size: 18px;
}

.fm-field-section p {
  margin: 0;
  color: #666;
}

.fm-field-divider {
  border: none;
  border-top: 2px solid #e9ecef;
  margin: 30px 0;
}

/* Form Actions */
.fm-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.fm-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.fm-btn-primary {
  background: linear-gradient(135deg, #0073aa, #005a87);
  color: #fff;
}

.fm-btn-primary:hover {
  background: linear-gradient(135deg, #005a87, #004a6f);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.fm-btn-primary:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.fm-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.fm-btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Loading State */
.fm-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

/* Form List Styles */
.fm-form-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.fm-form-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
}

.fm-form-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.fm-form-item-title {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.fm-form-item-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

.fm-form-item-stats {
  margin-bottom: 15px;
}

.fm-submission-count {
  background: #f8f9fa;
  color: #666;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.fm-form-item-actions {
  display: flex;
  gap: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .fm-form-renderer {
    padding: 15px;
    margin: 10px;
  }
  
  .fm-form-title {
    font-size: 20px;
  }
  
  .fm-form-actions {
    flex-direction: column;
    gap: 15px;
  }
  
  .fm-btn {
    width: 100%;
  }
  
  .fm-range-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .fm-range-value {
    text-align: center;
  }
  
  .fm-form-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .fm-form-renderer {
    padding: 10px;
  }
  
  .fm-field {
    padding: 10px 12px;
  }
  
  .fm-rating-container {
    justify-content: center;
  }
  
  .fm-signature-canvas {
    width: 100%;
    height: 120px;
  }
}

/* Animation for form loading */
.fm-form-renderer {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Progress bar animation */
.fm-progress-fill {
  animation: progressFill 0.5s ease-out;
}

@keyframes progressFill {
  from {
    width: 0%;
  }
}

/* Message animations */
.fm-message {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Error state animations */
.fm-field-error {
  animation: shake 0.5s ease-in-out;
}

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

/* Success state */
.fm-field-success {
  border-color: #28a745;
  background: #f8fff9;
}

/* Disabled state */
.fm-field:disabled,
.fm-field[readonly] {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Focus states for accessibility */
.fm-field:focus-visible {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/**
 * Form Master Drag & Drop Frontend Styles
 */

/* Form Container */
.fm-form {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

.fm-form-embedded {
    max-width: 100%;
}

/* Form Header */
.fm-form-header {
    margin-bottom: 30px;
    text-align: center;
}

.fm-form-title {
    font-size: 2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.fm-form-description {
    font-size: 1.1em;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Form Element */
.fm-form-element {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    border: 1px solid #e1e8ed;
}

/* Form Fields */
.fm-form-fields {
    margin-bottom: 30px;
}

.fm-field {
    margin-bottom: 25px;
}

.fm-field-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1em;
}

.fm-required {
    color: #e74c3c;
    font-weight: bold;
}

.fm-field-input {
    position: relative;
}

.fm-field-input input[type="text"],
.fm-field-input input[type="email"],
.fm-field-input input[type="tel"],
.fm-field-input input[type="url"],
.fm-field-input input[type="number"],
.fm-field-input input[type="date"],
.fm-field-input textarea,
.fm-field-input select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.fm-field-input input:focus,
.fm-field-input textarea:focus,
.fm-field-input select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.fm-field-input input:invalid,
.fm-field-input textarea:invalid,
.fm-field-input select:invalid {
    border-color: #e74c3c;
}

.fm-field-input textarea {
    min-height: 100px;
    resize: vertical;
}

.fm-field-input select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Radio and Checkbox Groups */
.fm-radio-group,
.fm-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fm-radio-option,
.fm-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.fm-radio-option input[type="radio"],
.fm-checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.fm-radio-label,
.fm-checkbox-label {
    font-size: 16px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* File Upload */
.fm-field-input input[type="file"] {
    padding: 10px;
    border: 2px dashed #e1e8ed;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fm-field-input input[type="file"]:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

/* Rating Stars */
.fm-rating-group {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.fm-rating-group input[type="radio"] {
    display: none;
}

.fm-rating-star {
    cursor: pointer;
    font-size: 24px;
    color: #ddd;
    transition: color 0.2s ease;
}

.fm-rating-star:hover,
.fm-rating-star:hover ~ .fm-rating-star,
.fm-rating-group input[type="radio"]:checked ~ .fm-rating-star {
    color: #ffd700;
}

/* Signature */
.fm-signature-pad {
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    height: 150px;
    background: #fff;
    position: relative;
    cursor: crosshair;
}

.fm-signature-pad canvas {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* Section Headers */
.fm-section-header {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
}

.fm-section-header h4 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.fm-section-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* Dividers */
.fm-divider {
    border: none;
    border-top: 2px solid #e1e8ed;
    margin: 30px 0;
}

/* Help Text */
.fm-field-help {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Form Submit */
.fm-form-submit {
    text-align: center;
    margin-top: 30px;
}

.fm-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.fm-submit-btn:active {
    transform: translateY(0);
}

.fm-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Messages */
.fm-form-messages {
    margin-top: 20px;
}

.fm-success-message,
.fm-error-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    display: none;
}

.fm-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fm-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.fm-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.fm-form.loading .fm-submit-btn {
    position: relative;
    color: transparent;
}

.fm-form.loading .fm-submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Field Validation States */
.fm-field.has-error .fm-field-input input,
.fm-field.has-error .fm-field-input textarea,
.fm-field.has-error .fm-field-input select {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.fm-field.has-error .fm-field-label {
    color: #e74c3c;
}

.fm-field.has-success .fm-field-input input,
.fm-field.has-success .fm-field-input textarea,
.fm-field.has-success .fm-field-input select {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Multi-step Form */
.fm-form-multi-step {
    position: relative;
}

.fm-step {
    display: none;
}

.fm-step.active {
    display: block;
}

.fm-step-navigation {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
}

.fm-step-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fm-step-btn:hover {
    background: #5a6268;
}

.fm-step-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.fm-step-progress {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.fm-step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e1e8ed;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.fm-step-indicator.active {
    background: #3498db;
    color: #fff;
}

.fm-step-indicator.completed {
    background: #27ae60;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fm-form {
        margin: 0 15px;
    }
    
    .fm-form-element {
        padding: 20px;
    }
    
    .fm-form-title {
        font-size: 1.5em;
    }
    
    .fm-form-description {
        font-size: 1em;
    }
    
    .fm-submit-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .fm-radio-group,
    .fm-checkbox-group {
        gap: 8px;
    }
    
    .fm-radio-option,
    .fm-checkbox-option {
        padding: 6px 0;
    }
    
    .fm-section-header {
        padding: 15px;
        margin: 20px 0;
    }
    
    .fm-section-header h4 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .fm-form-element {
        padding: 15px;
    }
    
    .fm-form-title {
        font-size: 1.3em;
    }
    
    .fm-field-input input[type="text"],
    .fm-field-input input[type="email"],
    .fm-field-input input[type="tel"],
    .fm-field-input input[type="url"],
    .fm-field-input input[type="number"],
    .fm-field-input input[type="date"],
    .fm-field-input textarea,
    .fm-field-input select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .fm-submit-btn {
        width: 100%;
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .fm-form {
        max-width: none;
        margin: 0;
    }
    
    .fm-form-element {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .fm-submit-btn {
        display: none;
    }
    
    .fm-form-messages {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .fm-form-element {
        border: 2px solid #000;
    }
    
    .fm-field-input input,
    .fm-field-input textarea,
    .fm-field-input select {
        border: 2px solid #000;
    }
    
    .fm-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .fm-field-input input,
    .fm-field-input textarea,
    .fm-field-input select,
    .fm-submit-btn,
    .fm-rating-star {
        transition: none;
    }
    
    .fm-submit-btn:hover {
        transform: none;
    }
} 