/* Hide the overlay by default */
body .spinner-overlay {
  display: none;
}

/* Show only when body has the class 'spinner' */
body.spinner .spinner-overlay {
  display: flex;
}

/* Fullscreen overlay styling */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Spinner container */
.spinner-body {
  text-align: center;
}

/* Spinner circle */
.spinner-body .loader {
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Loading text */
.spinner-body .loading-text {
  margin-top: 10px;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

/* Spin animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.spfs-form-container {
        max-width: 700px;
        margin: 40px auto;
        padding: 40px;
        background-color: #fff;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
        border-radius: 10px;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        position: relative;
    }
    
    .spfs-form-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .spfs-form-header h2 {
        color: #2d3748;
        font-size: 28px;
        font-weight: 600;
        margin: 0 0 10px;
    }
    
    .spfs-form-header p {
        color: #718096;
        font-size: 16px;
        margin: 0;
    }
    
    .spfs-product-form {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }
    
    .spfs-form-row {
        display: flex;
        gap: 20px;
    }
    
    .spfs-form-group {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .spfs-form-group label {
        font-weight: 500;
        font-size: 15px;
        margin-bottom: 8px;
        color: #2d3748;
    }
    
    .spfs-required::after {
        content: "*";
        color: #e53e3e;
        margin-left: 4px;
    }
    
    .spfs-form-group input[type="text"],
    .spfs-form-group input[type="email"],
    .spfs-form-group input[type="number"],
    .spfs-form-group input[type="url"],
    .spfs-form-group select,
    .spfs-form-group textarea {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        font-size: 15px;
        color: #4a5568;
        background-color: #f7fafc;
        transition: all 0.2s ease;
    }
    
    .spfs-form-group input:focus,
    .spfs-form-group select:focus,
    .spfs-form-group textarea:focus {
        outline: none;
        border-color: #4299e1;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
        background-color: white;
    }
    
    .spfs-form-group textarea {
        min-height: 100px;
        resize: vertical;
    }
    
    .spfs-form-group select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.5em 1.5em;
    }
    
    .spfs-price-input,
    .spfs-discount-input {
        position: relative;
    }
    
    .spfs-price-input span,
    .spfs-discount-input span {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: #718096;
        font-size: 15px;
    }
    
    .spfs-price-input span {
        left: 15px;
    }
    
    .spfs-discount-input span {
        right: 15px;
    }
    
    .spfs-price-input input {
        padding-left: 60px !important;
    }
    
    .spfs-discount-input input {
        padding-right: 40px !important;
    }
    
    .spfs-file-upload {
        background-color: #f7fafc;
        border: 1px dashed #cbd5e0;
        border-radius: 6px;
        padding: 20px;
        text-align: center;
        transition: all 0.2s ease;
    }
    
    .spfs-file-upload:hover {
        border-color: #4299e1;
        background-color: #ebf8ff;
    }
    
    .spfs-file-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: #4299e1;
        color: white;
        padding: 10px 20px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 500;
        font-size: 15px;
        transition: background-color 0.2s ease;
        margin-bottom: 10px;
        border: none;
    }
    
    .spfs-file-button:hover {
        background-color: #3182ce;
    }

    .spfs-file-button-gif {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: #4299e1;
        color: white;
        padding: 10px 20px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 500;
        font-size: 15px;
        transition: background-color 0.2s ease;
        margin-bottom: 10px;
        border: none;
    }
    
    .spfs-file-button-gif:hover {
        background-color: #3182ce;
    }
    
    .spfs-file-text {
        color: #718096;
        font-size: 14px;
        display: block;
    }

    .spfs-file-text-gif {
        color: #718096;
        font-size: 14px;
        display: block;
    }
    
    .spfs-radio-group {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .spfs-radio-option {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .spfs-radio-option input {
        width: 18px;
        height: 18px;
        accent-color: #4299e1;
    }
    
    .spfs-radio-option label {
        font-weight: normal;
        margin-bottom: 0;
    }
    
    .spfs-submit-button {
        background-color: #48bb78;
        color: white;
        border: none;
        border-radius: 6px;
        padding: 15px 30px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        width: 100%;
        transition: background-color 0.2s ease;
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .spfs-submit-button:hover {
        background-color: #38a169;
    }
    
    .spfs-submit-button .spinner {
        display: none;
    }
    
    .spfs-submit-button.loading .submit-text {
        display: none;
    }
    
    .spfs-submit-button.loading .spinner {
        display: block;
    }
    
    .spfs-submit-button.loading {
        cursor: not-allowed;
    }
    
    #spfs-form-messages {
        position: fixed;
        top: 20px;
        right: 20px;
        max-width: 400px;
        z-index: 1000;
    }
    
    .spfs-alert {
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        animation: fadeIn 0.3s, fadeOut 0.3s 4.7s;
    }
    
    .spfs-alert.success {
        background-color: #48bb78;
        color: white;
    }
    
    .spfs-alert.error {
        background-color: #e53e3e;
        color: white;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    @keyframes fadeOut {
        from { opacity: 1; transform: translateY(0); }
        to { opacity: 0; transform: translateY(-20px); }
    }
    
    @media (max-width: 768px) {
        .spfs-form-container {
            padding: 25px;
            margin: 20px auto;
        }
        
        .spfs-form-row {
            flex-direction: column;
            gap: 25px;
        }
        
        .spfs-radio-group {
            flex-direction: column;
            gap: 12px;
            align-items: flex-start;
        }
        
        #spfs-form-messages {
            left: 20px;
            right: 20px;
            max-width: none;
        }
    }