/* ArzPaya Plugin Buy/Sell Price Styles */

/* Buy-Etherium Page Container */
.arzpaya-buysell-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin: 20px 0;
}

.arzpaya-buysell-container .arzpaya-card {
    flex: 1;
    max-width: 50%;
    margin: 0;
}

.arzpaya-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.arzpaya-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.arzpaya-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: arzpaya-spin 1s linear infinite;
}

.arzpaya-loading-dots {
    display: flex;
    gap: 4px;
}

.arzpaya-loading-dots span {
    width: 6px;
    height: 6px;
    background-color: #3498db;
    border-radius: 50%;
    animation: arzpaya-dots 1.4s ease-in-out infinite both;
}

.arzpaya-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.arzpaya-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.arzpaya-loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

.arzpaya-progress-bar {
    width: 100%;
    height: 3px;
    background-color: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.arzpaya-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 2px;
    animation: arzpaya-progress 2s ease-in-out infinite;
}

.arzpaya-price-widget {
    position: relative;
    transition: opacity 0.3s ease;
}

.arzpaya-price-widget.loading {
    opacity: 0.7;
}

.arzpaya-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 300px;
    margin: 10px 0;
}

.arzpaya-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.arzpaya-card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.arzpaya-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
}

/* Buy type styling */
.arzpaya-buy .arzpaya-title {
    color: var(--accent-primary, #007bff);
}

/* Sell type styling */
.arzpaya-sell .arzpaya-title {
    color: #e74c3c;
}

.arzpaya-prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.arzpaya-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    direction: ltr;
    text-align: start;
}

.arzpaya-currency-label {
    color: #9a9999;
    font-weight: 500;
    font-size: 12px;
}

.arzpaya-price-widget .price-irt,
.arzpaya-price-widget .price-usdt {
    transition: all 0.3s ease;
    font-weight: 600;
    color: #333333;
}

.arzpaya-price-widget .price-up {
    color: #27ae60 !important;
    transform: scale(1.05);
}

.arzpaya-price-widget .price-down {
    color: #e74c3c !important;
    transform: scale(1.05);
}

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

@keyframes arzpaya-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes arzpaya-dots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.arzpaya-price-widget .loading-pulse {
    animation: arzpaya-pulse 1.5s ease-in-out infinite;
}

@keyframes arzpaya-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.arzpaya-price-widget .error-text {
    color: #e74c3c !important;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile: Stack containers vertically */
    .arzpaya-buysell-container {
        flex-direction: column !important;
        gap: 16px;
        margin: 16px 0;
    }
    
    .arzpaya-buysell-container .arzpaya-card {
        flex: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0;
    }
    
    .arzpaya-card {
        max-width: 100%;
        padding: 16px;
        margin: 8px 0;
    }
    
    .arzpaya-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .arzpaya-title {
        font-size: 14px;
    }
    
    .arzpaya-prices {
        width: 100%;
        text-align: left;
    }
    
    .arzpaya-price-row {
        justify-content: space-between;
    }
    
    /* Responsive theme adjustments */
    [data-theme="dark"] .arzpaya-card {
        padding: 14px;
    }
    
    [data-theme="light"] .arzpaya-card {
        padding: 14px;
    }
    
    :root:not([data-theme="light"]) .arzpaya-card {
        padding: 14px;
    }
}

/* Light Theme Styles (explicit) */
[data-theme="light"] .arzpaya-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #333333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .arzpaya-title {
    color: #333333;
}

/* Buy type styling in light theme */
[data-theme="light"] .arzpaya-buy .arzpaya-title {
    color: var(--accent-primary, #007bff);
}

/* Sell type styling in light theme */
[data-theme="light"] .arzpaya-sell .arzpaya-title {
    color: #e74c3c;
}

[data-theme="light"] .arzpaya-currency-label {
    color: #666666;
}

[data-theme="light"] .arzpaya-price-widget .price-irt,
[data-theme="light"] .arzpaya-price-widget .price-usdt {
    color: #333333;
}

[data-theme="light"] .arzpaya-loading-overlay {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .arzpaya-loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
}

[data-theme="light"] .arzpaya-loading-dots span {
    background-color: #3498db;
}

[data-theme="light"] .arzpaya-progress-bar {
    background-color: #f0f0f0;
}

[data-theme="light"] .arzpaya-progress-fill {
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

/* Light theme container */
[data-theme="light"] .arzpaya-buysell-container {
    background: transparent;
}

/* Dark Theme Styles */
[data-theme="dark"] .arzpaya-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-body);
    box-shadow: var(--shadow-card);
}

[data-theme="dark"] .arzpaya-title {
    color: var(--text-body);
}

/* Buy type styling in dark theme */
[data-theme="dark"] .arzpaya-buy .arzpaya-title {
    color: var(--accent-primary);
}

/* Sell type styling in dark theme */
[data-theme="dark"] .arzpaya-sell .arzpaya-title {
    color: #dc2626;
}

[data-theme="dark"] .arzpaya-currency-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .arzpaya-price-widget .price-irt,
[data-theme="dark"] .arzpaya-price-widget .price-usdt {
    color: var(--text-body);
}

[data-theme="dark"] .arzpaya-loading-overlay {
    background: rgba(26, 35, 50, 0.9);
}

[data-theme="dark"] .arzpaya-loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-primary);
}

[data-theme="dark"] .arzpaya-loading-dots span {
    background-color: var(--accent-primary);
}

[data-theme="dark"] .arzpaya-progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .arzpaya-progress-fill {
    background: linear-gradient(90deg, var(--accent-primary), #2ecc71);
}

/* Dark theme container */
[data-theme="dark"] .arzpaya-buysell-container {
    background: transparent;
}

/* Auto dark theme support based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .arzpaya-card {
        background: #1a2332;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #FFFFFF;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    
    :root:not([data-theme="light"]) .arzpaya-title {
        color: #FFFFFF;
    }
    
    /* Buy type styling in auto dark mode */
    :root:not([data-theme="light"]) .arzpaya-buy .arzpaya-title {
        color: #3D72FE;
    }
    
    /* Sell type styling in auto dark mode */
    :root:not([data-theme="light"]) .arzpaya-sell .arzpaya-title {
        color: #dc2626;
    }
    
    :root:not([data-theme="light"]) .arzpaya-currency-label {
        color: rgba(255, 255, 255, 0.85);
    }
    
    :root:not([data-theme="light"]) .arzpaya-price-widget .price-irt,
    :root:not([data-theme="light"]) .arzpaya-price-widget .price-usdt {
        color: #FFFFFF;
    }
    
    :root:not([data-theme="light"]) .arzpaya-loading-overlay {
        background: rgba(26, 35, 50, 0.9);
    }
    
    :root:not([data-theme="light"]) .arzpaya-loading-spinner {
        border: 3px solid rgba(255, 255, 255, 0.1);
        border-top: 3px solid #3D72FE;
    }
    
    :root:not([data-theme="light"]) .arzpaya-loading-dots span {
        background-color: #3D72FE;
    }
    
    :root:not([data-theme="light"]) .arzpaya-progress-bar {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    :root:not([data-theme="light"]) .arzpaya-progress-fill {
        background: linear-gradient(90deg, #3D72FE, #2ecc71);
    }
    
    /* Auto dark theme container */
    :root:not([data-theme="light"]) .arzpaya-buysell-container {
        background: transparent;
    }
}

/* Tablet Breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
    .arzpaya-buysell-container {
        gap: 16px;
    }
    
    .arzpaya-buysell-container .arzpaya-card {
        flex: 1;
        max-width: 48%;
    }
}

/* Additional Mobile Breakpoint for Extra Safety */
@media (max-width: 480px) {
    .arzpaya-buysell-container {
        flex-direction: column !important;
        gap: 12px;
    }
    
    .arzpaya-buysell-container .arzpaya-card {
        flex: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
}
