/**
 * Shortcodes CSS for Live Gold Coin Prices plugin
 */

/* =========================================
   1. Single Price Display
========================================= */
.lgcp-single-price-container {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px !important ;
    border-radius: 12px !important ;
}

.lgcp-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.lgcp-item-label {
    flex: 1;
}

.lgcp-price-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.lgcp-update-time {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* =========================================
   2. Price Table
========================================= */
.lgcp-price-table-container {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-update-time {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.price-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 1rem;
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.table-row:last-child {
    border-bottom: none;
}

.item-unit {
    font-size: 0.9rem;
    opacity: 0.8;
    /* استفاده از margin-inline-end به جای margin-right برای پشتیبانی خودکار از چپ‌چین و راست‌چین */
    margin-inline-end: 0.5rem; 
}

.row-price {
    text-align: center;
    font-weight: 600;
}

.row-source {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Two column layout when source is hidden */
.lgcp-price-table-container:not([data-show-source="yes"]) .table-header,
.lgcp-price-table-container:not([data-show-source="yes"]) .table-row {
    grid-template-columns: 2fr 1fr;
}

/* =========================================
   3. Error Messages (Base Styles Added)
========================================= */
.lgcp-error {
    padding: 1rem;
    margin: 1rem 0;
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
}

/* =========================================
   4. Responsive Design
========================================= */
@media (max-width: 768px) {
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table-header > div,
    .table-row > div {
        padding: 0.25rem 0;
    }
    
    .table-header > div:first-child,
    .table-row > div:first-child {
        font-weight: 700;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* =========================================
   5. RTL Support Explicit Overrides
========================================= */
[dir="rtl"] .lgcp-price-display {
    direction: rtl;
}

/* بخش مربوط به .item-unit حذف شد چون با margin-inline-end به طور هوشمند و خودکار هندل می‌شود */

[dir="rtl"] .lgcp-error {
    border-left: none;
    border-right: 4px solid #e74c3c;
}
