/* Enhanced Rate Input Styles with Update Buttons */

.input-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-with-button .rate-input {
    flex: 1;
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.btn-update-rate {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    white-space: nowrap;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-update-rate:hover {
    background: linear-gradient(135deg, #218838, #1ea87d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.btn-update-rate:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40,167,69,0.4);
}

.btn-update-rate i {
    font-size: 11px;
}

.btn-update-rate.updating {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    pointer-events: none;
}

.btn-update-rate.updating i {
    animation: spin 1s linear infinite;
}

.btn-update-rate.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.btn-update-rate.success::after {
    content: '✓';
    font-weight: bold;
    font-size: 12px;
}

.btn-update-rate.success i {
    display: none;
}

.rate-input:focus + .btn-update-rate {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.rate-input.changed {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.25);
    background-color: #fff3cd;
}

.rate-input.changed + .btn-update-rate {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    animation: pulse 2s infinite;
}

.rate-input.updated {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40,167,69,0.25);
    background-color: #d4edda;
}

.rate-input.updated + .btn-update-rate {
    background: linear-gradient(135deg, #28a745, #20c997);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Rate update animations */
.rate-updating {
    background: linear-gradient(-45deg, #e3f2fd, #bbdefb, #90caf9, #64b5f6);
    background-size: 400% 400%;
    animation: gradient-shift 1s ease infinite;
}

.rate-auto-updated {
    background: #d4edda;
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40,167,69,0.3);
    animation: success-pulse 0.6s ease-out;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(40,167,69,0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(40,167,69,0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(40,167,69,0.3);
    }
}

/* Enhanced Product Type Cards */
.product-type-card {
    position: relative;
    transition: all 0.3s ease;
}

.product-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-type-card .product-rates {
    position: relative;
}

.product-type-card .product-rates::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #007bff, #28a745);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-type-card.enabled .product-rates::before {
    opacity: 1;
}

/* Real-time Status Indicators */
.currency-status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    transition: all 0.3s ease;
}

.currency-status-indicator.updating {
    background: #ffc107;
    animation: pulse 1s infinite;
}

.currency-status-indicator.error {
    background: #dc3545;
}

/* Bulk Update Actions */
.rate-bulk-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.btn-bulk-update {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-bulk-update:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.btn-bulk-update i {
    margin-right: 5px;
}

/* Auto-refresh Indicator */
.auto-refresh-status {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0,123,255,0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 9998;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.auto-refresh-status.visible {
    transform: translateX(0);
}

.auto-refresh-status.success {
    background: rgba(40,167,69,0.9);
}

.auto-refresh-status.error {
    background: rgba(220,53,69,0.9);
}

/* Enhanced tooltips for rate inputs */
.rate-input[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-with-button {
        flex-direction: column;
        gap: 5px;
    }
    
    .input-with-button .rate-input {
        border-radius: 6px;
        border-right: 1px solid #ddd;
    }
    
    .btn-update-rate {
        border-radius: 6px;
        width: 100%;
        justify-content: center;
    }
}