/**
 * Afriyah Multi-Currency - Frontend Styles
 * Beautiful currency switcher for customer-facing pages
 */

:root {
    --afriyah-primary: #28a745;
    --afriyah-primary-dark: #1e7e34;
    --afriyah-accent: #ffd700;
    --afriyah-dark: #2c3e50;
    --afriyah-light: #f8f9fa;
}

/* Currency Switcher - Dropdown Style */
.afriyah-currency-switcher {
    display: inline-block;
    position: relative;
}

.afriyah-currency-dropdown {
    padding: 10px 35px 10px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: var(--afriyah-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 180px;
}

.afriyah-currency-dropdown:hover {
    border-color: var(--afriyah-primary);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.afriyah-currency-dropdown:focus {
    outline: none;
    border-color: var(--afriyah-primary);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Currency Switcher - Button Style */
.afriyah-currency-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.afriyah-currency-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: white;
    font-size: 13px;
    font-weight: 700;
    color: var(--afriyah-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.afriyah-currency-btn:hover {
    border-color: var(--afriyah-primary);
    background: var(--afriyah-light);
    transform: translateY(-2px);
}

.afriyah-currency-btn.active {
    background: linear-gradient(135deg, var(--afriyah-primary), var(--afriyah-primary-dark));
    border-color: var(--afriyah-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.afriyah-currency-btn:active {
    transform: translateY(0);
}

/* Price Converter Widget */
.afriyah-price-converter {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, var(--afriyah-light), white);
    border-radius: 12px;
    border: 2px solid #ddd;
    font-weight: 600;
    justify-content: center;
}

.price-from, .price-to {
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    color: var(--afriyah-dark);
}

.price-arrow {
    font-size: 24px;
    color: var(--afriyah-primary);
    font-weight: 700;
}

/* Currency Symbol in Prices */
.woocommerce-Price-amount {
    font-weight: 700;
}

.woocommerce-Price-currencySymbol {
    margin-right: 2px;
    font-weight: 700;
}

/* Currency Notice */
.afriyah-currency-notice {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.5s ease-out;
}

.afriyah-currency-notice.success {
    border-left: 4px solid var(--afriyah-primary);
}

.afriyah-currency-notice .icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--afriyah-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.afriyah-currency-notice .message {
    font-size: 14px;
    font-weight: 600;
    color: var(--afriyah-dark);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Floating Currency Selector */
.afriyah-floating-currency {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9998;
    background: white;
    padding: 12px 18px;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.afriyah-floating-currency:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.afriyah-floating-currency .currency-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--afriyah-primary), var(--afriyah-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.afriyah-floating-currency select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--afriyah-dark);
    cursor: pointer;
    padding-right: 20px;
}

.afriyah-floating-currency select:focus {
    outline: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .afriyah-currency-dropdown {
        min-width: 150px;
        font-size: 13px;
        padding: 8px 30px 8px 12px;
    }
    
    .afriyah-currency-buttons {
        justify-content: center;
    }
    
    .afriyah-currency-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .afriyah-price-converter {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .price-from, .price-to {
        width: 100%;
        text-align: center;
    }
    
    .afriyah-currency-notice {
        right: 10px;
        left: 10px;
        top: 70px;
    }
    
    .afriyah-floating-currency {
        bottom: 70px;
        right: 10px;
        padding: 10px 14px;
    }
    
    .afriyah-floating-currency select {
        font-size: 12px;
    }
}

/* Loading State */
.afriyah-currency-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(40, 167, 69, 0.3);
    border-radius: 50%;
    border-top-color: var(--afriyah-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header Currency Switcher Integration */
.site-header .afriyah-currency-switcher {
    margin-left: 15px;
}

.site-header .afriyah-currency-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.site-header .afriyah-currency-dropdown:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .afriyah-currency-dropdown,
    .afriyah-currency-btn,
    .price-from,
    .price-to,
    .afriyah-currency-notice,
    .afriyah-floating-currency {
        background: #1e1e1e;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }
    
    .afriyah-currency-btn.active {
        background: linear-gradient(135deg, var(--afriyah-primary), var(--afriyah-primary-dark));
        color: white;
    }
}

/* GEO currency prompt (session is SSoT; this is display only) */
.afriyah-currency-prompt-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.afriyah-currency-prompt-box {
    background: #fff;
    color: #1e293b;
    max-width: 420px;
    width: 100%;
    border-radius: 16px;
    padding: 24px 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.afriyah-currency-prompt-box h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
}

.afriyah-currency-prompt-box p {
    margin: 0 0 20px;
    line-height: 1.55;
    font-size: 0.95rem;
    color: #475569;
}

.afriyah-currency-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.afriyah-currency-prompt-actions .button {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.afriyah-currency-prompt-actions .button.primary {
    background: var(--afriyah-primary);
    color: #fff;
}

.afriyah-currency-prompt-actions .button.secondary {
    background: #e2e8f0;
    color: #334155;
}

