/* ArzPaya Price Plugin Styles */

.arzpaya-price-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    font-family: IRANSansWeb, sans-serif;
    text-align: right;
    direction: rtl;
}

/* Dark Theme Support */
[data-theme="dark"] .arzpaya-price-error {
    background-color: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Auto dark theme support based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .arzpaya-price-error {
        background-color: rgba(220, 38, 38, 0.1);
        color: #fca5a5;
        border: 1px solid rgba(220, 38, 38, 0.3);
    }
}

/* Price container styles */
.arzpaya-price-container {
    display: inline-block;
    font-family: IRANSansWeb, sans-serif;
    direction: rtl;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Loading state */
.arzpaya-price-container.arzpaya-price-loading {
    opacity: 0.6;
    position: relative;
    background-color: rgba(0, 0, 0, 0.05);
}

.arzpaya-price-container.arzpaya-price-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -20px;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 0;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: arzpaya-spin 1s linear infinite;
}

@keyframes arzpaya-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Price animation states */
.arzpaya-price-container.price-up {
    background-color: rgba(34, 197, 94, 0.2);
    color: #16a34a;
    transform: scale(1.05);
}

.arzpaya-price-container.price-down {
    background-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transform: scale(1.05);
}

/* Success and error states */
.arzpaya-price-container.arzpaya-price-success {
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.arzpaya-price-container.arzpaya-price-error {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.1);
}

.arzpaya-price-error-text {
    color: #dc2626;
    font-size: 0.9em;
}

/* Hover effect */
.arzpaya-price-container:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Dark theme support */
[data-theme="dark"] .arzpaya-price-container.arzpaya-price-loading::after {
    border-color: #666;
    border-top-color: #fff;
}

[data-theme="dark"] .arzpaya-price-container.arzpaya-price-loading {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arzpaya-price-container:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .arzpaya-price-container.price-up {
    background-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

[data-theme="dark"] .arzpaya-price-container.price-down {
    background-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

[data-theme="dark"] .arzpaya-price-error-text {
    color: #f87171;
}

/* Auto dark theme support based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .arzpaya-price-container.arzpaya-price-loading::after {
        border-color: #666;
        border-top-color: #fff;
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-container.arzpaya-price-loading {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-container:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-container.price-up {
        background-color: rgba(34, 197, 94, 0.3);
        color: #4ade80;
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-container.price-down {
        background-color: rgba(239, 68, 68, 0.3);
        color: #f87171;
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-error-text {
        color: #f87171;
    }
}

/* Price Wrapper with Progress Bar */
.arzpaya-price-wrapper {
    display: inline-block;
    position: relative;
}

.arzpaya-price-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent-primary);
    z-index: 0;
    transition: width 0s;
}

.arzpaya-price-wrapper.progress-active::after {
    width: 100%;
    transition: width linear var(--progress-duration, 30s);
}

.arzpaya-price-wrapper > * {
    position: relative;
    z-index: 1;
}

/* Dark Theme Support for Progress Bar */
[data-theme="dark"] .arzpaya-price-wrapper::after {
    background: var(--accent-primary);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .arzpaya-price-wrapper::after {
        background: var(--accent-primary);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .arzpaya-price-error {
        font-size: 0.9em;
        padding: 8px;
    }
}

