/**
 * Sales Autocomplete Notification Styles
 * Notification and edit input styles for sales employee table
 * @version 1.0.1
 */

/* Update success notification */
.update-success {
    position: absolute;
    right: 12px;
    top: -30px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3), 0 2px 4px -1px rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

.update-success::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #059669;
}

.update-success.show {
    opacity: 1;
    transform: translateY(-5px);
}

.update-success i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
}

/* Update error notification */
.update-error {
    position: absolute;
    right: 12px;
    top: -30px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 2px 4px -1px rgba(239, 68, 68, 0.2);
    white-space: nowrap;
}

.update-error::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #DC2626;
}

.update-error.show {
    opacity: 1;
    transform: translateY(-5px);
}

.update-error i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
}

/* Edit input field */
.sales-employee-edit-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    border: 2px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.sales-employee-edit-input:hover {
    border-color: #9CA3AF;
}

.sales-employee-edit-input:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: #ECFDF5;
}

.sales-employee-edit-input::placeholder {
    color: #9CA3AF;
    font-style: italic;
}

/* Editable cell styling */
td[data-field="rg_sales"] {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

td[data-field="rg_sales"]:hover {
    background-color: #F9FAFB;
}

td[data-field="rg_sales"]:hover::after {
    content: '\f044'; /* Font Awesome edit icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Loading state */
.sales-employee-edit-input.loading {
    background: #F3F4F6;
    pointer-events: none;
    opacity: 0.7;
}

.sales-employee-edit-input.loading::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid #E5E7EB;
    border-top-color: #10B981;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success state animation */
.sales-employee-edit-input.success {
    border-color: #10B981;
    background: #ECFDF5;
    animation: successFlash 0.5s ease;
}

@keyframes successFlash {
    0%, 100% {
        background: white;
    }
    50% {
        background: #D1FAE5;
    }
}

/* Error state */
.sales-employee-edit-input.error {
    border-color: #EF4444;
    background: #FEF2F2;
    animation: shake 0.4s ease;
}

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

/* Notification toast container */
.sales-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
}

.notification-toast {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast.success {
    border-left: 4px solid #10B981;
}

.notification-toast.error {
    border-left: 4px solid #EF4444;
}

.notification-toast.warning {
    border-left: 4px solid #F59E0B;
}

.notification-toast .notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toast.success .notification-icon {
    background: #D1FAE5;
    color: #059669;
}

.notification-toast.error .notification-icon {
    background: #FEE2E2;
    color: #DC2626;
}

.notification-toast.warning .notification-icon {
    background: #FEF3C7;
    color: #D97706;
}

.notification-toast .notification-content {
    flex: 1;
}

.notification-toast .notification-title {
    font-weight: 600;
    color: #1F2937;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.notification-toast .notification-message {
    color: #6B7280;
    font-size: 0.8125rem;
}

.notification-toast .notification-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toast .notification-close:hover {
    background: #F3F4F6;
    color: #6B7280;
}

/* Responsive styles */
@media (max-width: 640px) {
    .sales-notifications {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .update-success,
    .update-error {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
        right: 8px;
        top: -28px;
    }

    .sales-employee-edit-input {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.625rem;
    }

    td[data-field="rg_sales"]:hover::after {
        font-size: 0.6875rem;
        right: 6px;
    }
}

/* Accessibility */
.sales-employee-edit-input:focus-visible {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .update-success,
    .update-error,
    .sales-notifications,
    td[data-field="rg_sales"]:hover::after {
        display: none;
    }
}
