/* Sales Form Styles */

/* Readonly field styles */
.readonly-field {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* Error field styles */
.error-field {
    border: 1px solid red !important;
}

/* Button spinner animation */
button[type="submit"] .spinner {
    display: none !important;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Show spinner when button has loading class or is disabled */
button[type="submit"].loading .spinner,
button[type="submit"]:disabled .spinner {
    display: inline-block !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading state for buttons */
button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Submit button positioning */
#fc-sales-form p button[type="submit"] {
    float: left;
}

/* Clearfix for form */
#fc-sales-form::after {
    content: "";
    display: table;
    clear: both;
}

/* Success and error message styles */
.fc-success {
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    margin-bottom: 15px;
}

.fc-error {
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    margin-bottom: 15px;
}

/* Form layout styles */
.fc-date-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fc-officer-phone-row {
    display: flex !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

.fc-officer-field,
.fc-phone-field {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.fc-amount-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.fc-amount-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fc-radio-row {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

/* Textarea styles */
.fc-sales-form textarea {
    border: 1px solid #ccc;
    border-radius: 10px;
}

/* Disabled button styles */
.fc-btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

/* Success Modal Styles */
.fc-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fc-success-box {
    background-color: #00b894;
    color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.fc-success-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.fc-success-icon svg {
    color: white;
}

.fc-success-box h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.fc-success-box p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
}

.fc-success-link {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    word-break: break-all;
}

.fc-success-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.fc-success-btn {
    background-color: white;
    color: #00b894;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.fc-success-btn:hover {
    background-color: #e0e0e0;
    color: #00b894;
}

/* Responsive styles */
@media (max-width: 768px) {
    .fc-officer-phone-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .fc-success-box {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .fc-success-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-success-btn {
        width: 100%;
    }
}

/* Form buttons container */
html body .fc-sales-form .fc-form-buttons,
.wp-admin .fc-sales-form .fc-form-buttons {
    display: flex !important;
    gap: 10px !important;
    align-items: left !important;
    justify-content: flex-start !important;
    float: left !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .fc-sales-form .fc-form-buttons button[type="submit"],
.wp-admin .fc-sales-form .fc-form-buttons button[type="submit"] {
    background-color: #00b894 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: normal !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: none !important;
    float: left !important;
    margin: 0 !important;
}

html body .fc-sales-form .fc-form-buttons button[type="submit"]:hover,
.wp-admin .fc-sales-form .fc-form-buttons button[type="submit"]:hover {
    background-color: #008f73 !important;
}

html body .fc-sales-form .fc-form-buttons button[type="submit"]:disabled,
.wp-admin .fc-sales-form .fc-form-buttons button[type="submit"]:disabled {
    background-color: #008f73 !important;
    opacity: 0.7 !important;
}

html body .fc-sales-form .fc-form-buttons button[type="button"],
.wp-admin .fc-sales-form .fc-form-buttons button[type="button"] {
    background-color: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: normal !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: none !important;
    float: left !important;
    margin: 0 !important;
}

html body .fc-sales-form .fc-form-buttons button[type="button"]:hover,
.wp-admin .fc-sales-form .fc-form-buttons button[type="button"]:hover {
    background-color: #5a6268 !important;
}

/* Additional spinner animation */
@keyframes fc-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}
