/* Floating Simulator Button */
.floating-simulator-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
}

.floating-simulator-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    width: 140px;
    border-radius: 30px;
    justify-content: flex-start;
    padding-left: 18px;
}

.floating-simulator-btn i {
    color: white;
    font-size: 26px;
    transition: all 0.3s ease;
    line-height: 1;
    flex-shrink: 0;
}

.floating-simulator-btn .btn-text {
    color: white;
    font-weight: 500;
    font-size: 14px;
    margin-left: 8px;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    position: absolute;
    right: 16px;
}

/* Enhanced Product Autocomplete Styles */
.product-option {
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.product-option:hover {
    background-color: #f8f9fa;
}

.select2-container--default .select2-results__option--highlighted .product-option {
    background-color: transparent;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: #206bc4;
    color: white;
}

.select2-container--default .select2-results__option--highlighted .text-primary {
    color: white !important;
}

.select2-container--default .select2-results__option--highlighted .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.select2-container--default .select2-results__option--highlighted .text-success {
    color: #51cf66 !important;
}

.select2-container--default .select2-results__option--highlighted .text-danger {
    color: #fa5252 !important;
}

.select2-container--default .select2-results__option--highlighted .text-info {
    color: #74c0fc !important;
}

.select2-container--default .select2-results__option--highlighted .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Stock indicators */
.stock-available {
    color: #28a745;
    font-weight: 500;
}

.stock-low {
    color: #fd7e14;
    font-weight: 500;
}

.stock-empty {
    color: #dc3545;
    font-weight: 500;
}

.floating-simulator-btn:hover .btn-text {
    opacity: 1;
}

.floating-simulator-btn:hover i {
    font-size: 20px;
}

/* Animation for floating effect */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating-simulator-btn {
    animation: float 3s ease-in-out infinite;
}

.floating-simulator-btn:hover {
    animation: none;
}

/* Pulse animation for attention */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.floating-simulator-btn:not(:hover) {
    animation: float 3s ease-in-out infinite, pulse 2s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .floating-simulator-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-simulator-btn:hover {
        width: 120px;
        border-radius: 25px;
    }
    
    .floating-simulator-btn i {
        font-size: 20px;
    }
    
    .floating-simulator-btn:hover i {
        font-size: 18px;
    }
    
    .floating-simulator-btn .btn-text {
        font-size: 12px;
    }
}

/* Modal enhancements */
#simulatorModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
}

#simulatorModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#simulatorModal .modal-title i {
    color: white;
}

#simulationResult .card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

#simulationResult .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* Input focus effects */
#simulatorForm .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Submit button styling */
#simulatorForm .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#simulatorForm .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Result highlighting */
#simulationResult .text-success {
    color: #28a745 !important;
    font-weight: 600;
}

#simulationResult .text-primary {
    color: #667eea !important;
    font-weight: 700;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Select2 custom styling to match Tabler theme */
.select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px;
    color: #495057;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 8px;
}

.select2-dropdown {
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.select2-container--default .select2-results__option {
    padding: 8px 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #667eea;
    color: white;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
}

/* Product autocomplete specific styles */
.product-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-info {
    flex: 1;
}

.product-code {
    font-weight: 600;
    color: #495057;
}

.product-description {
    color: #6c757d;
    font-size: 0.875rem;
}

.product-category {
    color: #28a745;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-price {
    font-weight: 600;
    color: #667eea;
    margin-left: 10px;
}

.product-stock {
    color: #17a2b8;
    font-size: 0.75rem;
    margin-left: 5px;
}