/*
Plugin Name: WP Price Updater
Description: أنماط CSS لإضافة تحديث الأسعار.
Version: 3.0
Author: Manus AI
*/

/* أنماط عامة للمربعات */
.wp-price-grid,
.wp-price-carousel-container {
    direction: rtl;
    text-align: right;
    font-family: 'Arial', sans-serif;
    color: #333;
}

.wp-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.price-item {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px; /* ارتفاع أدنى */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    max-width: 280px; /* عرض أقصى */
    margin: 0 auto; /* توسيط المربعات */
}

.price-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.price-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #555;
}

.price-item .price-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

.price-item .price-link:hover {
    color: #007bff; /* لون عند التحويم */
}

.price-item span {
    font-size: 1.8em;
    font-weight: bold;
    color: #007bff;
    display: block;
    margin-bottom: 5px;
}

.price-item .last-updated {
    font-size: 0.8em;
    color: #888;
    margin-top: 10px;
}

/* ألوان وتدرجات خاصة لكل نوع */
.price-item.gold {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
}

.price-item.dollar {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.price-item.steel {
    border-left: 4px solid #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.price-item.cement {
    border-left: 4px solid #17a2b8;
    background: linear-gradient(135deg, #f0fcff 0%, #ffffff 100%);
}

.price-item.custom {
    border-left: 4px solid #6f42c1;
    background: linear-gradient(135deg, #f8f0ff 0%, #ffffff 100%);
}

/* أنماط العرض الدوار (Carousel) */
.wp-price-carousel-container {
    position: relative;
    width: 100%;
    max-width: 600px; /* عرض أقصى للعرض الدوار */
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: #f9f9f9;
    padding: 20px;
}

.wp-price-carousel {
    display: flex;
    transition: transform 0.5s ease-in-out;
    animation: slideShow 12s infinite;
}

.wp-price-carousel-item {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.wp-price-carousel-content {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    text-align: center;
    width: 80%;
    max-width: 400px;
}

.wp-price-carousel-content h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: #333;
}

.wp-price-carousel-content .price-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
}

.wp-price-carousel-content .last-updated {
    font-size: 0.9em;
    color: #777;
}

/* ألوان خاصة للعرض الدوار */
.wp-price-carousel-item:nth-child(1) .wp-price-carousel-content { /* Gold */
    border-bottom: 5px solid #ffc107;
    color: #b8860b;
}
.wp-price-carousel-item:nth-child(1) .price-value { color: #ffc107; }

.wp-price-carousel-item:nth-child(2) .wp-price-carousel-content { /* Dollar */
    border-bottom: 5px solid #28a745;
    color: #228b22;
}
.wp-price-carousel-item:nth-child(2) .price-value { color: #28a745; }

.wp-price-carousel-item:nth-child(3) .wp-price-carousel-content { /* Steel */
    border-bottom: 5px solid #6c757d;
    color: #5a6268;
}
.wp-price-carousel-item:nth-child(3) .price-value { color: #6c757d; }

.wp-price-carousel-item:nth-child(4) .wp-price-carousel-content { /* Cement */
    border-bottom: 5px solid #17a2b8;
    color: #138496;
}
.wp-price-carousel-item:nth-child(4) .price-value { color: #17a2b8; }

/* مؤشرات العرض الدوار */
.wp-carousel-indicators {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.wp-carousel-indicator {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    transition: background-color 0.3s ease;
}

/* تفعيل المؤشر النشط */
.wp-price-carousel-container:hover .wp-carousel-indicator:nth-child(1),
.wp-price-carousel-container:not(:hover) .wp-carousel-indicator:nth-child(1) {
    animation: indicatorActive 12s infinite;
}
.wp-price-carousel-container:hover .wp-carousel-indicator:nth-child(2),
.wp-price-carousel-container:not(:hover) .wp-carousel-indicator:nth-child(2) {
    animation: indicatorActive 12s infinite 3s;
}
.wp-price-carousel-container:hover .wp-carousel-indicator:nth-child(3),
.wp-price-carousel-container:not(:hover) .wp-carousel-indicator:nth-child(3) {
    animation: indicatorActive 12s infinite 6s;
}
.wp-price-carousel-container:hover .wp-carousel-indicator:nth-child(4),
.wp-price-carousel-container:not(:hover) .wp-carousel-indicator:nth-child(4) {
    animation: indicatorActive 12s infinite 9s;
}

@keyframes indicatorActive {
    0%, 20% { background-color: #007bff; }
    21%, 100% { background-color: #ccc; }
}

/* إيقاف الحركة عند التحويم */
.wp-price-carousel-container:hover .wp-price-carousel {
    animation-play-state: paused;
}

/* إيقاف حركة المؤشرات عند التحويم */
.wp-price-carousel-container:hover .wp-carousel-indicator {
    animation-play-state: paused;
}

/* Keyframes للعرض الدوار */
@keyframes slideShow {
    0%, 20% { transform: translateX(0%); }
    25%, 45% { transform: translateX(-100%); }
    50%, 70% { transform: translateX(-200%); }
    75%, 95% { transform: translateX(-300%); }
    100% { transform: translateX(0%); }
}

/* أنماط صفحة الإعدادات */
.wrap h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.wrap h2 {
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.widefat {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.widefat th,
.widefat td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

.widefat th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.form-table th {
    width: 150px;
}

.form-table input[type="text"],
.form-table input[type="number"] {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-primary {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 1px 0 rgba(0,0,0,.15);
    text-decoration: none;
}

.button-secondary {
    background-color: #f3f3f3;
    color: #222;
    border-color: #ccc;
    box-shadow: 0 1px 0 rgba(0,0,0,.05);
    text-decoration: none;
}

.notice-success {
    background-color: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.details-link-container {
    text-align: center;
    margin-top: 15px;
}

.details-link-container a {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.details-link-container a:hover {
    background-color: #0056b3;
}



