/* LaBoiteARE Currency Converter - Frontend Styles */

/* Pictogramme calculette sur les prix */
.laboiteare-cc-convertible {
    position: relative;
    cursor: pointer;
}

.laboiteare-cc-convertible::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-left: 10px;
    opacity: 1;
    vertical-align: text-top;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-bottom: -3px;

    background-image: url('../images/currency-exchange.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1); /* Pour rendre le SVG blanc */
}

/* Classe pour masquer l'icône si désactivée dans les options */
body.laboiteare-cc-hide-icon .laboiteare-cc-convertible::after {
    display: none;
}

.laboiteare-cc-convertible:hover::after {
    opacity: 0.7;
    transform: rotate(360deg);
    transition: all 0.3s ease;
}
/* Styles pour le tooltip */
.laboiteare-cc-tooltip {
    position: absolute;
    z-index: 999999;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    max-width: 320px;
    min-width: 280px;
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


.laboiteare-cc-tooltip.laboiteare-cc-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.laboiteare-cc-tooltip.laboiteare-cc-bottom::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}

.laboiteare-cc-tooltip:not(.laboiteare-cc-bottom)::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

.laboiteare-cc-content {
    padding: 16px;
}

.laboiteare-cc-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.laboiteare-cc-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.laboiteare-cc-conversions {
    margin-bottom: 12px;
}

.laboiteare-cc-conversion {
    display: flex;
    align-items: center;
    padding: 8px 0;
    transition: background-color 0.15s ease;
}

.laboiteare-cc-conversion:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
    margin: 0 -4px;
    padding: 8px 4px;
}

.laboiteare-cc-conversion:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

.laboiteare-cc-flag {
    width: 28px;
    font-size: 18px;
    margin-right: 10px;
    text-align: center;
    flex-shrink: 0;
}

.laboiteare-cc-currency {
    font-weight: 600;
    color: #495057;
    min-width: 45px;
    margin-right: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.laboiteare-cc-value {
    margin-left: auto;
    font-weight: 600;
    color: #212529;
    font-size: 14px;
    text-align: right;
}

.laboiteare-cc-footer {
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
    text-align: center;
}

.laboiteare-cc-footer small {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

/* Loading state */
.laboiteare-cc-loading {
    text-align: center;
    padding: 20px 16px;
}

.laboiteare-cc-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: laboiteare-cc-spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes laboiteare-cc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.laboiteare-cc-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
}

/* Error state */
.laboiteare-cc-error {
    text-align: center;
    padding: 16px;
}

.laboiteare-cc-error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.laboiteare-cc-error p {
    margin: 0;
    color: #dc3545;
    font-size: 13px;
    font-weight: 500;
}

/* Currency-specific styling */
.laboiteare-cc-conversion[data-currency="USD"] .laboiteare-cc-value {
    color: #78D6C6;
}

.laboiteare-cc-conversion[data-currency="GBP"] .laboiteare-cc-value {
    color: #FF9EAA;
}

.laboiteare-cc-conversion[data-currency="JPY"] .laboiteare-cc-value {
    color: #FFD365;
}

.laboiteare-cc-conversion[data-currency="AUD"] .laboiteare-cc-value {
    color: #A084E8;
}

.laboiteare-cc-conversion[data-currency="CHF"] .laboiteare-cc-value {
    color: #98E4FF;
}

.laboiteare-cc-conversion[data-currency="CNY"] .laboiteare-cc-value {
    color: #FF8B8B;
}

.laboiteare-cc-conversion[data-currency="NOK"] .laboiteare-cc-value {
    color: #9ADE7B;
}

/* Responsive design */
@media (max-width: 768px) {
    .laboiteare-cc-tooltip {
        max-width: 280px;
        min-width: 250px;
        font-size: 13px;
    }
    
    .laboiteare-cc-content {
        padding: 14px;
    }
    
    .laboiteare-cc-header h4 {
        font-size: 14px;
    }
    
    .laboiteare-cc-flag {
        font-size: 16px;
        width: 24px;
        margin-right: 8px;
    }
    
    .laboiteare-cc-currency {
        font-size: 12px;
        min-width: 40px;
        margin-right: 8px;
    }
    
    .laboiteare-cc-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .laboiteare-cc-tooltip {
        max-width: calc(100vw - 20px);
        min-width: auto;
        left: 10px !important;
        right: 10px;
        width: auto;
    }
    
    .laboiteare-cc-conversion {
        padding: 6px 0;
    }
    
    .laboiteare-cc-flag {
        font-size: 14px;
        width: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .laboiteare-cc-tooltip {
        border: 2px solid #000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .laboiteare-cc-header,
    .laboiteare-cc-footer {
        border-color: #000;
    }
    
    .laboiteare-cc-conversion:not(:last-child) {
        border-bottom-color: #ccc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .laboiteare-cc-tooltip {
        transition: opacity 0.1s ease;
        transform: none;
    }
    
    .laboiteare-cc-tooltip.laboiteare-cc-visible {
        transform: none;
    }
    
    .laboiteare-cc-spinner {
        animation: none;
        border: 2px solid #8e64af;
        border-radius: 50%;
    }
    
    .laboiteare-cc-conversion {
        transition: none;
    }
}

/* Print styles */
@media print {
    .laboiteare-cc-tooltip {
        display: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .laboiteare-cc-tooltip {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .laboiteare-cc-tooltip:not(.laboiteare-cc-bottom)::after {
        border-top-color: #2d3748;
    }
    
    .laboiteare-cc-tooltip.laboiteare-cc-bottom::before {
        border-bottom-color: #2d3748;
    }
    
    .laboiteare-cc-header h4 {
        color: #f7fafc;
    }
    
    .laboiteare-cc-header,
    .laboiteare-cc-footer {
        border-color: #4a5568;
    }
    
    .laboiteare-cc-conversion:not(:last-child) {
        border-bottom-color: #4a5568;
    }
    
    .laboiteare-cc-conversion:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .laboiteare-cc-currency {
        color: #cbd5e0;
    }
    
    .laboiteare-cc-value {
        color: #f7fafc;
    }
    
    .laboiteare-cc-footer small {
        color: #a0aec0;
    }
    
    .laboiteare-cc-loading p {
        color: #a0aec0;
    }
    
    .laboiteare-cc-spinner {
        border-color: #4a5568;
        border-top-color: #63b3ed;
    }
}

/* Focus styles for accessibility */
.laboiteare-cc-tooltip:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Animation for smooth appearance */
@keyframes laboiteare-cc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.laboiteare-cc-tooltip.laboiteare-cc-visible {
    animation: laboiteare-cc-fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}