/**
 * Frontend Styles for Advanced Multi-Currency Manager
 * 
 * @package AdvancedMultiCurrency
 */

/* Price container styling */
.amc-price-container {
    display: inline-block;
    font-weight: normal;
}

.amc-try-price {
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.amc-original-price {
    font-size: 0.85em;
    color: #777;
    text-decoration: line-through;
    margin-left: 8px;
}

.amc-price-separator {
    color: #ccc;
    margin: 0 5px;
    font-weight: normal;
}

/* Price info sections */
.amc-price-info {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
}

.amc-price-info p {
    margin: 5px 0;
    color: #666;
}

.amc-original-price-info,
.amc-rate-info {
    line-height: 1.4;
}

.amc-shop-price-info {
    margin-top: 8px;
    text-align: center;
}

.amc-shop-price-info small {
    color: #888;
    font-size: 0.8em;
    font-style: italic;
}

/* Currency converter widget */
.amc-currency-converter {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.amc-currency-converter h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1em;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 10px;
}

.amc-converter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.amc-converter-input {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.amc-converter-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

.amc-converter-select {
    min-width: 100px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.amc-converter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

.amc-convert-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.amc-convert-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.amc-convert-button:active {
    transform: translateY(0);
}

.amc-convert-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.amc-converter-result {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: none;
    border-left: 4px solid #0073aa;
}

.amc-converter-result.error {
    background: #fee;
    color: #d63638;
    border-left-color: #d63638;
}

/* WooCommerce integration */
.woocommerce .amc-price-container,
.woocommerce-page .amc-price-container {
    display: inline-block;
}

/* Single product page */
.single-product .amc-price-info {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}

/* Shop page */
.woocommerce ul.products li.product .amc-shop-price-info {
    margin-top: 5px;
    text-align: center;
}

/* Cart page */
.woocommerce-cart .amc-price-container {
    white-space: nowrap;
}

/* Checkout page */
.woocommerce-checkout .amc-price-container {
    font-weight: normal;
}

/* Account page */
.woocommerce-account .amc-price-container {
    font-size: inherit;
}

/* Price display variants */
.amc-price-large {
    font-size: 1.2em;
}

.amc-price-small {
    font-size: 0.9em;
}

.amc-price-emphasis {
    background: linear-gradient(120deg, #fffbf0, #fff4e0);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #f4b942;
}

/* Currency symbols styling */
.amc-currency-symbol {
    font-weight: bold;
    margin-right: 2px;
}

/* Loading states */
.amc-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.amc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: amc-spin 1s linear infinite;
}

@keyframes amc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .amc-converter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .amc-converter-input,
    .amc-converter-select,
    .amc-convert-button {
        width: 100%;
        margin-bottom: 0;
    }
    
    .amc-currency-converter {
        padding: 15px;
        margin: 15px 0;
    }
    
    .amc-price-info {
        padding: 12px;
        margin: 12px 0;
    }
    
    .amc-original-price {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
    
    .amc-price-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .amc-currency-converter {
        padding: 12px;
        margin: 12px 0;
    }
    
    .amc-currency-converter h4 {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    .amc-converter-input,
    .amc-converter-select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .amc-convert-button {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .amc-price-info {
        font-size: 0.85em;
        padding: 10px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .amc-price-container {
        border: 1px solid;
    }
    
    .amc-currency-converter {
        border: 2px solid;
    }
    
    .amc-price-info {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .amc-convert-button {
        transition: none;
    }
    
    .amc-convert-button:hover {
        transform: none;
    }
    
    .amc-loading::after {
        animation: none;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .amc-price-info {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .amc-currency-converter {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .amc-converter-input,
    .amc-converter-select {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .amc-converter-result {
        background: #333;
        color: #e0e0e0;
    }
    
    .amc-try-price {
        color: #e0e0e0;
    }
    
    .amc-original-price {
        color: #aaa;
    }
}

/* Print styles */
@media print {
    .amc-currency-converter {
        display: none;
    }
    
    .amc-price-info {
        background: none;
        border: 1px solid #000;
    }
    
    .amc-original-price {
        text-decoration: none;
        font-style: italic;
    }
    
    .amc-price-separator {
        display: inline;
    }
}

/* Accessibility improvements */
.amc-convert-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.amc-converter-input:focus,
.amc-converter-select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* Screen reader only content */
.amc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Custom scrollbar for converter results */
.amc-converter-result::-webkit-scrollbar {
    width: 6px;
}

.amc-converter-result::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.amc-converter-result::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.amc-converter-result::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation for result display */
@keyframes amc-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amc-converter-result.show {
    animation: amc-fade-in 0.3s ease-out;
}

/* Tooltip styles for currency info */
.amc-currency-tooltip {
    position: relative;
    cursor: help;
}

.amc-currency-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0.9;
}

.amc-currency-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 117%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Integration with popular themes */
.theme-astra .amc-price-container,
.theme-oceanwp .amc-price-container,
.theme-generatepress .amc-price-container {
    font-family: inherit;
}

.theme-storefront .amc-currency-converter {
    border-color: #96588a;
}

.theme-storefront .amc-convert-button {
    background: linear-gradient(135deg, #96588a 0%, #7a4870 100%);
}

.theme-storefront .amc-convert-button:hover {
    background: linear-gradient(135deg, #7a4870 0%, #644060 100%);
}