/* Price Comparison Widget Styles */
.price-comparison-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    width: 100%;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e0e0e0;
}

.price-comparison-widget.show {
    transform: translateY(0);
    opacity: 1;
}

.price-comparison-widget.minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.price-comparison-widget.minimized .widget-content {
    display: none;
}

.price-comparison-widget.minimized .widget-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #2077ba;
    color: white;
    font-size: 20px;
}

.widget-header {
    background: linear-gradient(135deg, #2077ba 0%, #2c91ce 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.widget-title i {
    font-size: 16px;
}

.widget-controls {
    display: flex;
    gap: 8px;
}

.widget-control {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-control:hover {
    background: rgba(255, 255, 255, 0.1);
}

.widget-content {
    padding: 16px;
    background: #fff;
}

.price-platform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.price-platform:last-child {
    border-bottom: none;
}

.price-platform:hover {
    background: #f9f9f9;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 6px;
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.platform-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.platform-icon.direct {
    background: #2077ba;
}

.platform-icon.booking {
    background: #003580;
}

.platform-icon.airbnb {
    background: #ff5a5f;
}

.platform-icon.vrbo {
    background: #ffd700;
    color: #333;
}

.platform-icon.expedia {
    background: #003366;
}

.platform-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.platform-name.direct {
    color: #2077ba;
    font-weight: 600;
}

.platform-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price-amount {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.price-amount.best {
    color: #2077ba;
}

.price-savings {
    font-size: 11px;
    color: #666;
    background: #f0f9ff;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.price-savings.best {
    background: #e6f7ff;
    color: #2077ba;
}

.widget-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.widget-disclaimer {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.widget-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.widget-error {
    padding: 16px;
    text-align: center;
    color: #d32f2f;
    font-size: 13px;
}

/* Placeholder content for lazy loading */
.widget-placeholder {
    padding: 24px 16px;
    text-align: center;
    color: #666;
}

.placeholder-icon {
    font-size: 32px;
    color: #2077ba;
    margin-bottom: 12px;
}

.placeholder-text {
    margin-bottom: 16px;
}

.placeholder-text strong {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
}

.placeholder-text p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.load-prices-btn {
    background: linear-gradient(135deg, #2077ba 0%, #2c91ce 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-prices-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 119, 186, 0.3);
}

.load-prices-btn:active {
    transform: translateY(0);
}

.load-prices-btn i {
    font-size: 12px;
}

.widget-toggle {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .price-comparison-widget {
        bottom: 80px; /* Account for mobile navigation */
        right: 15px;
        left: 15px;
        max-width: none;
        width: auto;
    }
    
    .price-comparison-widget.minimized {
        left: auto;
        width: 55px;
        height: 55px;
        bottom: 90px;
    }
    
    .platform-name {
        font-size: 12px;
    }
    
    .price-amount {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .price-comparison-widget {
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
}

/* Animation for price updates */
.price-amount.updating {
    opacity: 0.6;
    transform: scale(0.95);
    transition: all 0.2s;
}

.price-amount.updated {
    opacity: 1;
    transform: scale(1);
    background: #e8f5e8;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: all 0.3s;
}

/* Pulse animation for new data */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(32, 119, 186, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(32, 119, 186, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(32, 119, 186, 0);
    }
}

.price-comparison-widget.pulse {
    animation: pulse 2s infinite;
}

/* Floating reopen button */
.price-comparison-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 50px;
    background: linear-gradient(135deg, #2077ba 0%, #2c91ce 100%);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999999;
    box-shadow: 0 4px 20px rgba(32, 119, 186, 0.4);
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    padding: 0 16px;
}

.price-comparison-floating-btn.show {
    transform: scale(1);
    opacity: 1;
}

.price-comparison-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(32, 119, 186, 0.4);
}

.price-comparison-floating-btn i {
    font-size: 16px;
}

/* Price date styling */
.price-date {
    display: block;
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    font-weight: 400;
}

.floating-btn-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.price-comparison-floating-btn:hover .floating-btn-tooltip {
    opacity: 1;
}

.floating-btn-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

/* Mobile adjustments for floating button */
@media (max-width: 480px) {
    .price-comparison-floating-btn {
        bottom: 10px;
        right: 10px;
        width: 100px;
        height: 45px;
        font-size: 12px;
        padding: 0 12px;
    }
    
    .price-comparison-floating-btn i {
        font-size: 14px;
    }
    
    .floating-btn-tooltip {
        right: 60px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Fix for back-to-top button conflict */
/* Position back-to-top button on LEFT side to avoid price widget conflict */
.backtop {
    position: fixed !important;
    bottom: -60px !important;
    left: 20px !important;
    right: auto !important;
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    text-align: center !important;
    border-radius: 50% !important;
    opacity: 0 !important;
    z-index: 99999999 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
    display: block !important;
}

.backtop.islive {
    bottom: 20px !important;
    opacity: 0.9 !important;
}

.backtop:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(32, 119, 186, 0.5) !important;
}

.backtop i {
    font-size: 20px !important;
    line-height: 50px !important;
    color: #ffffff !important;
}

/* Mobile adjustments for back-to-top button */
@media (max-width: 768px) {
    .backtop {
        left: 15px !important;
        width: 45px !important;
        height: 45px !important;
        line-height: 45px !important;
    }
    
    .backtop.islive {
        bottom: 90px !important;
    }
    
    .backtop i {
        font-size: 18px !important;
        line-height: 45px !important;
    }
}

@media (max-width: 480px) {
    .backtop {
        width: 42px !important;
        height: 42px !important;
        line-height: 42px !important;
        left: 10px !important;
    }
    
    .backtop.islive {
        bottom: 80px !important;
    }
    
    .backtop i {
        font-size: 16px !important;
        line-height: 42px !important;
    }
}
