/**
 * Frontend CSS for TGJU Gold Price Shortcode
 * 
 * استایل نمایش شورت‌کد قیمت لحظه‌ای طلا
 */

.tgju-gold-price-widget {
    display: inline-block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border: 2px solid #d4af37;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 200px;
    transition: all 0.3s ease;
}

.tgju-gold-price-widget:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.tgju-gold-price-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.tgju-gold-price-value {
    font-size: 24px;
    font-weight: bold;
    color: #d4af37;
    margin: 10px 0;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.tgju-gold-price-value .tgju-currency {
    font-size: 16px;
    color: #888;
    font-weight: normal;
    margin-right: 5px;
}

.tgju-gold-price-time {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    font-style: italic;
}

/* Loading state */
.tgju-gold-price-value.tgju-loading {
    opacity: 0.6;
    position: relative;
}

.tgju-gold-price-value.tgju-loading::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #d4af37;
    border-top-color: transparent;
    border-radius: 50%;
    animation: tgju-spin 0.8s linear infinite;
}

/* Loading state for TGJU grid items */
.tgju-gold-price-tgju-item.tgju-loading {
    opacity: 0.7;
    position: relative;
}

.tgju-gold-price-tgju-item.tgju-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #d4af37;
    border-top-color: transparent;
    border-radius: 50%;
    animation: tgju-spin 0.8s linear infinite;
}

@keyframes tgju-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Updated state animation */
.tgju-gold-price-value.tgju-updated,
.tgju-gold-price-tgju-value.tgju-updated,
.tgju-price-updated {
    animation: tgju-price-update 0.5s ease;
}

@keyframes tgju-price-update {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #b8941f;
    }
    100% {
        transform: scale(1);
    }
}

/* Error state */
.tgju-gold-price-error {
    padding: 10px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    text-align: center;
    direction: rtl;
}

/* All prices display */
.tgju-gold-price-all-widget {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 500px;
    margin: 0 auto;
}

.tgju-gold-price-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.tgju-gold-price-header h4 {
    margin: 0 0 10px 0;
    color: #d4af37;
    font-size: 18px;
    font-weight: 600;
}

.tgju-gold-price-list {
    display: grid;
    gap: 12px;
}

.tgju-gold-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tgju-gold-price-item:hover {
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.tgju-gold-price-item .tgju-gold-price-name {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    margin: 0;
}

.tgju-gold-price-item .tgju-gold-price-value {
    font-size: 16px;
    font-weight: bold;
    color: #d4af37;
    margin: 0;
    white-space: nowrap;
}

.tgju-gold-price-item .tgju-currency {
    font-size: 12px;
    color: #888;
    font-weight: normal;
    margin-right: 4px;
}

/* TGJU-style layout (like the website) */
.tgju-gold-price-tgju-widget {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

.tgju-gold-price-tgju-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #d4af37;
}

.tgju-gold-price-tgju-header h3 {
    margin: 0;
    color: #d4af37;
    font-size: 20px;
    font-weight: 600;
}

.tgju-gold-price-tgju-time {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.tgju-gold-price-tgju-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tgju-gold-price-tgju-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tgju-gold-price-tgju-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.tgju-gold-price-tgju-name {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
}

.tgju-gold-price-tgju-price {
    margin-bottom: 8px;
}

.tgju-gold-price-tgju-value {
    font-size: 18px;
    font-weight: bold;
    color: #d4af37;
    display: block;
    line-height: 1.4;
}

.tgju-gold-price-tgju-currency {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

.tgju-gold-price-tgju-change {
    font-size: 12px;
    margin-top: 5px;
}

.tgju-gold-price-tgju-change-value,
.tgju-gold-price-tgju-change-percent {
    display: inline-block;
    margin: 0 2px;
}

.tgju-gold-price-tgju-change-value.positive,
.tgju-gold-price-tgju-change-percent.positive {
    color: #28a745;
}

.tgju-gold-price-tgju-change-value.negative,
.tgju-gold-price-tgju-change-percent.negative {
    color: #dc3545;
}

/* Gold product info on product page */
.tgju-gold-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tgju-gold-info h3 {
    color: #d4af37;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.tgju-gold-info p {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.tgju-gold-info p:last-child {
    border-bottom: none;
}

.tgju-gold-info strong {
    color: #495057;
    font-weight: 600;
}

.tgju-gold-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin-top: 15px;
    font-size: 13px;
}

/* Responsive design */
@media (max-width: 768px) {
    .tgju-gold-price-widget {
        padding: 12px 15px;
        min-width: 150px;
    }

    .tgju-gold-price-value {
        font-size: 20px;
    }

    .tgju-gold-price-value .tgju-currency {
        font-size: 14px;
    }

    .tgju-gold-price-name {
        font-size: 12px;
    }

    .tgju-gold-price-time {
        font-size: 11px;
    }

    /* Responsive for all prices widget */
    .tgju-gold-price-all-widget {
        padding: 15px;
        max-width: 100%;
    }

    .tgju-gold-price-header h4 {
        font-size: 16px;
    }

    .tgju-gold-price-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .tgju-gold-price-item .tgju-gold-price-name {
        font-size: 13px;
    }

    .tgju-gold-price-item .tgju-gold-price-value {
        font-size: 15px;
        align-self: flex-end;
    }

    /* Responsive for gold info */
    .tgju-gold-info {
        padding: 15px;
        margin: 15px 0;
    }

    .tgju-gold-info h3 {
        font-size: 16px;
    }
}

