/* Pro Fields Styles */

/* Product Search Container */
.product-search-container {
  position: relative;
  
  .product-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #007cba;
      box-shadow: 0 0 0 1px #007cba;
    }
  }
  
  .product-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    
    .product-result {
      padding: 8px 12px;
      cursor: pointer;
      border-bottom: 1px solid #eee;
      
      &:hover {
        background-color: #f5f5f5;
      }
      
      &:last-child {
        border-bottom: none;
      }
      
      .product-name {
        font-weight: 500;
        margin-bottom: 2px;
      }
      
      .product-price {
        color: #666;
        font-size: 0.9em;
      }
    }
    
    .no-results {
      padding: 8px 12px;
      color: #666;
      font-style: italic;
    }
  }
  
  .selected-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    
    .product-info {
      flex: 1;
      
      .product-name {
        font-weight: 500;
        margin-bottom: 2px;
      }
      
      .product-price {
        color: #666;
        font-size: 0.9em;
      }
    }
    
    .remove-product {
      background: none;
      border: none;
      font-size: 18px;
      cursor: pointer;
      color: #999;
      padding: 0;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      
      &:hover {
        color: #dc3545;
      }
    }
  }
}

/* Upload Container */
.upload-container {
  .upload-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    
    &:hover, &.dragover {
      border-color: #007cba;
      background-color: #f0f8ff;
    }
    
    .upload-icon {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.6;
    }
    
    .upload-text {
      p {
        margin: 0 0 8px 0;
        font-weight: 500;
      }
      
      small {
        display: block;
        color: #666;
        margin-bottom: 4px;
      }
    }
  }
  
  .uploaded-files {
    margin-top: 16px;
    
    .upload-progress {
      margin-bottom: 12px;
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 4px;
      
      .file-name {
        font-weight: 500;
        margin-bottom: 8px;
      }
      
      .progress-bar {
        background: #f0f0f0;
        border-radius: 10px;
        overflow: hidden;
        height: 20px;
        margin-bottom: 8px;
        
        .progress-fill {
          background: #007cba;
          height: 100%;
          transition: width 0.3s ease;
        }
      }
      
      .progress-text {
        font-size: 0.9em;
        color: #666;
      }
    }
    
    .uploaded-file {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      background: #f9f9f9;
      border-radius: 4px;
      margin-bottom: 8px;
      
      .file-info {
        flex: 1;
        
        .file-name {
          font-weight: 500;
          margin-bottom: 2px;
        }
        
        .file-size {
          font-size: 0.9em;
          color: #666;
        }
      }
      
      .file-actions {
        display: flex;
        gap: 8px;
        
        button {
          background: none;
          border: none;
          cursor: pointer;
          font-size: 16px;
          padding: 4px;
          border-radius: 3px;
          
          &:hover {
            background-color: rgba(0, 0, 0, 0.1);
          }
          
          &.remove-file:hover {
            color: #dc3545;
          }
        }
      }
    }
    
    .upload-error {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      background: #f8d7da;
      border: 1px solid #f5c6cb;
      border-radius: 4px;
      color: #721c24;
      
      .remove-error {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        color: #721c24;
      }
    }
  }
}

/* Rich Text Editor */
.rich-text-editor {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  
  .rich-text-toolbar {
    border-bottom: 1px solid #ddd;
    padding: 8px;
    background-color: #f8f9fa;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    
    .toolbar-btn {
      margin: 0;
      padding: 6px 10px;
      border: 1px solid #ccc;
      background-color: #fff;
      cursor: pointer;
      border-radius: 3px;
      font-size: 12px;
      font-weight: 500;
      transition: all 0.2s ease;
      
      &:hover {
        background-color: #e9ecef;
      }
      
      &.active {
        background-color: #007cba;
        color: #fff;
        border-color: #007cba;
      }
    }
  }
  
  .rich-text-content {
    padding: 12px;
    min-height: 150px;
    outline: none;
    font-size: 14px;
    line-height: 1.5;
    
    &:focus {
      background-color: #fafafa;
    }
    
    p {
      margin: 0 0 12px 0;
      
      &:last-child {
        margin-bottom: 0;
      }
    }
    
    ul, ol {
      margin: 0 0 12px 20px;
      padding: 0;
    }
    
    a {
      color: #007cba;
      text-decoration: underline;
    }
  }
}

/* Ranking Fields */
.ranking-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  background-color: #fafafa;
  
  .ranking-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    
    &:hover {
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    &.dragging {
      opacity: 0.5;
      transform: rotate(2deg);
    }
    
    .ranking-handle {
      margin-right: 12px;
      color: #666;
      font-weight: bold;
      cursor: grab;
      
      &:active {
        cursor: grabbing;
      }
    }
    
    .ranking-label {
      flex: 1;
      font-weight: 500;
    }
  }
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 4px;
  
  .star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    
    &:hover,
    &.hover,
    &.selected {
      color: #ffc107;
    }
  }
}

/* Scale Fields */
.scale-container {
  display: flex;
  align-items: center;
  gap: 16px;
  
  &.vertical {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .scale-label-min,
  .scale-label-max {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
  }
  
  .scale-options {
    display: flex;
    gap: 12px;
    
    .vertical & {
      flex-direction: column;
      gap: 8px;
    }
    
    label {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      font-weight: 500;
      
      input[type="radio"] {
        margin: 0;
      }
    }
  }
}

/* Slider Fields */
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  
  input[type="range"] {
    flex: 1;
    margin: 0;
  }
  
  .slider-value {
    font-weight: 500;
    color: #007cba;
    min-width: 60px;
    text-align: center;
  }
}

/* Tags Fields */
.tags-container {
  .tags-input-wrapper {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    
    &:focus-within {
      border-color: #007cba;
      box-shadow: 0 0 0 1px #007cba;
    }
    
    .tags-input {
      border: none;
      outline: none;
      flex: 1;
      min-width: 120px;
      padding: 4px;
      font-size: 14px;
    }
    
    .tags-display {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      
      .tag {
        display: flex;
        align-items: center;
        gap: 4px;
        background-color: #007cba;
        color: white;
        padding: 4px 8px;
        border-radius: 16px;
        font-size: 12px;
        font-weight: 500;
        
        .remove-tag {
          background: none;
          border: none;
          color: white;
          cursor: pointer;
          font-size: 14px;
          padding: 0;
          width: 16px;
          height: 16px;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 50%;
          
          &:hover {
            background-color: rgba(255, 255, 255, 0.2);
          }
        }
      }
    }
  }
  
  .predefined-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    
    .predefined-tag {
      background-color: #f8f9fa;
      border: 1px solid #dee2e6;
      color: #495057;
      padding: 4px 8px;
      border-radius: 16px;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      
      &:hover {
        background-color: #e9ecef;
        border-color: #adb5bd;
      }
    }
  }
}

/* Appointment Fields */
.appointment-container {
  display: flex;
  gap: 12px;
  
  .appointment-date,
  .appointment-time {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #007cba;
      box-shadow: 0 0 0 1px #007cba;
    }
  }
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  
  .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    
    img {
      max-width: 100%;
      max-height: 100%;
      border-radius: 8px;
    }
    
    .close-modal {
      position: absolute;
      top: -10px;
      right: -10px;
      background: #fff;
      border: none;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      cursor: pointer;
      font-size: 18px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      
      &:hover {
        background-color: #f5f5f5;
      }
    }
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .appointment-container {
    flex-direction: column;
  }
  
  .scale-container {
    flex-direction: column;
    align-items: flex-start;
    
    .scale-options {
      flex-direction: column;
      gap: 8px;
    }
  }
  
  .rich-text-toolbar {
    .toolbar-btn {
      padding: 4px 6px;
      font-size: 11px;
    }
  }
  
  .upload-dropzone {
    padding: 20px 10px;
    
    .upload-icon {
      font-size: 32px;
    }
  }
}