/**
 * Currency Toggle UI Styles
 * Floating currency switcher for SAR/USD conversion
 */

.currency-toggle {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 999;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 5px;
    display: flex;
    gap: 5px;
    transition: all 0.3s ease;
}

.currency-toggle:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.currency-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.currency-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.currency-btn.active {
    background: linear-gradient(135deg, #c89e4a 0%, #d4af37 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(200, 158, 74, 0.3);
}

.currency-flag {
    font-size: 20px;
    line-height: 1;
}

.currency-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .currency-toggle {
        top: auto;
        bottom: 20px;
        right: auto;
        left: 15px;
        padding: 4px;
    }
    
    .currency-btn {
        padding: 8px 12px;
        font-size: 13px;
        gap: 5px;
    }
    
    .currency-flag {
        font-size: 18px;
    }
}

/* Hide currency symbol in price when showing full format */
.pricing-amount .currency,
.price-amount .currency {
    display: inline;
}

/* Animation for price changes */
[data-price-sar] {
    transition: all 0.3s ease;
}

[data-price-sar].price-updating {
    opacity: 0.5;
    transform: scale(0.98);
}

/* Currency info tooltip */
.currency-toggle::after {
    content: 'Switch Currency';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.currency-toggle:hover::after {
    opacity: 1;
}

/* Alternative compact design (uncomment to use) */
/*
.currency-toggle {
    flex-direction: column;
    padding: 8px 6px;
    gap: 8px;
}

.currency-btn {
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

.currency-code {
    font-size: 11px;
}
*/

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .currency-toggle {
        background: #1e293b;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .currency-btn {
        color: #94a3b8;
    }
    
    .currency-btn:hover {
        background: #334155;
        color: #e2e8f0;
    }
    
    .currency-btn.active {
        background: linear-gradient(135deg, #c89e4a 0%, #d4af37 100%);
        color: white;
    }
}

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

.currency-toggle.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #c89e4a;
    border-top-color: transparent;
    border-radius: 50%;
    animation: currency-loading 0.6s linear infinite;
}

@keyframes currency-loading {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Sticky positioning on scroll */
@media (min-width: 769px) {
    body.scrolled .currency-toggle {
        top: 80px;
    }
}

/* Print styles - hide toggle when printing */
@media print {
    .currency-toggle {
        display: none !important;
    }
}
