/**
 * أنماط الواجهة الأمامية الحديثة (Modern & Responsive Frontend Stylesheet)
 * دعم كامل للغة العربية والاتجاه من اليمين لليسار (RTL Support)
 */

:root {
    --rcc-primary: #2563eb;
    --rcc-primary-hover: #1d4ed8;
    --rcc-bg-card: #ffffff;
    --rcc-border-color: #e2e8f0;
    --rcc-text-main: #0f172a;
    --rcc-text-muted: #64748b;
    --rcc-success: #10b981;
    --rcc-danger: #ef4444;
    --rcc-star: #f59e0b;
    --rcc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --rcc-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --rcc-radius: 12px;
}

.rcc-wrapper {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--rcc-text-main);
    line-height: 1.6;
    margin: 2rem 0;
    width: 100%;
}

.rcc-wrapper * {
    box-sizing: border-box;
}

/* دعم اتجاه الكتابة */
.rcc-wrapper.rcc-rtl {
    direction: rtl;
    text-align: right;
}

.rcc-wrapper.rcc-ltr {
    direction: ltr;
    text-align: left;
}

/* =========================================================
   1. شبكة أعمدة المقارنة (Comparison Columns Grid)
   ========================================================= */
.rcc-columns-container {
    display: grid;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.rcc-cols-1 { grid-template-columns: 1fr; }
.rcc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rcc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rcc-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .rcc-cols-3, .rcc-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .rcc-cols-2, .rcc-cols-3, .rcc-cols-4 { grid-template-columns: 1fr; }
}

/* بطاقة المنتج الفردية */
.rcc-column-card {
    background: var(--rcc-bg-card);
    border: 1px solid var(--rcc-border-color);
    border-radius: var(--rcc-radius);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--rcc-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.rcc-column-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rcc-shadow-hover);
    border-color: #cbd5e1;
}

/* البطاقة المميزة */
.rcc-column-card.rcc-featured-card {
    border: 2px solid var(--rcc-primary);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.15);
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

/* شارة التمييز */
.rcc-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    background: var(--rcc-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rcc-ltr .rcc-badge {
    right: auto;
    left: 1.5rem;
}

/* صورة المنتج */
.rcc-card-image {
    text-align: center;
    margin-bottom: 1.25rem;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rcc-card-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* عنوان ووصف المنتج */
.rcc-card-header {
    text-align: center;
    margin-bottom: 1rem;
}

.rcc-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rcc-text-main);
    margin: 0 0 0.25rem 0;
}

.rcc-card-subtitle {
    font-size: 0.875rem;
    color: var(--rcc-text-muted);
}

/* الدرجة والنجوم */
.rcc-card-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.rcc-score-circle {
    background: #f1f5f9;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 800;
    color: var(--rcc-text-main);
}

.rcc-score-circle .rcc-score-num {
    font-size: 1.15rem;
    color: var(--rcc-primary);
}

.rcc-score-circle .rcc-score-max {
    font-size: 0.8rem;
    color: var(--rcc-text-muted);
}

.rcc-score-stars {
    color: var(--rcc-star);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* السعر */
.rcc-card-price {
    text-align: center;
    margin-bottom: 1.25rem;
}

.rcc-price-amount {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--rcc-text-main);
}

.rcc-price-period {
    font-size: 0.85rem;
    color: var(--rcc-text-muted);
}

/* زر التحويل CTA */
.rcc-card-cta {
    margin-bottom: 1.5rem;
}

.rcc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.rcc-btn-primary {
    background: var(--rcc-primary);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.rcc-btn-primary:hover {
    background: var(--rcc-primary-hover);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
    color: #ffffff !important;
}

.rcc-btn-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.rcc-rtl .rcc-btn:hover .rcc-btn-arrow {
    transform: translateX(-4px);
}

.rcc-ltr .rcc-btn:hover .rcc-btn-arrow {
    transform: translateX(4px);
}

/* الإيجابيات والسلبيات */
.rcc-card-pros-cons {
    border-top: 1px dashed var(--rcc-border-color);
    padding-top: 1.25rem;
    margin-top: auto;
}

.rcc-list-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.rcc-pros-heading { color: var(--rcc-success); }
.rcc-cons-heading { color: var(--rcc-danger); margin-top: 1rem; }

.rcc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.rcc-list li {
    position: relative;
    padding-right: 1.25rem;
    margin-bottom: 0.35rem;
    color: #334155;
}

.rcc-ltr .rcc-list li {
    padding-right: 0;
    padding-left: 1.25rem;
}

.rcc-pros-list li::before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--rcc-success);
    font-weight: bold;
}

.rcc-ltr .rcc-pros-list li::before {
    right: auto;
    left: 0;
}

.rcc-cons-list li::before {
    content: "✕";
    position: absolute;
    right: 0;
    color: var(--rcc-danger);
    font-weight: bold;
}

.rcc-ltr .rcc-cons-list li::before {
    right: auto;
    left: 0;
}

/* =========================================================
   2. صندوق المراجعة وأشرطة التقدم (Review Box & Rating Bars)
   ========================================================= */
.rcc-review-box {
    background: #ffffff;
    border: 1px solid var(--rcc-border-color);
    border-radius: var(--rcc-radius);
    padding: 2rem;
    box-shadow: var(--rcc-shadow);
    margin-bottom: 2rem;
}

.rcc-review-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rcc-border-color);
    margin-bottom: 1.75rem;
}

.rcc-review-box-title h4 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--rcc-text-main);
}

.rcc-overall-badge {
    background: linear-gradient(135deg, var(--rcc-primary) 0%, var(--rcc-primary-hover) 100%);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--rcc-radius);
    text-align: center;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.rcc-badge-score {
    font-size: 1.85rem;
    font-weight: 900;
    display: inline-block;
}

.rcc-badge-scale {
    font-size: 0.95rem;
    opacity: 0.85;
}

.rcc-badge-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.15rem;
    text-transform: uppercase;
}

.rcc-criteria-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.rcc-bar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--rcc-text-main);
}

.rcc-bar-track {
    background: #e2e8f0;
    height: 12px;
    border-radius: 9999px;
    overflow: hidden;
}

.rcc-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.rcc-verdict-content {
    background: #f8fafc;
    border-right: 4px solid var(--rcc-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    font-size: 0.975rem;
    color: #334155;
}

.rcc-ltr .rcc-verdict-content {
    border-right: none;
    border-left: 4px solid var(--rcc-primary);
}

/* =========================================================
   3. الرسم البياني الراداري / الشبكي (SVG Radar Chart)
   ========================================================= */
.rcc-radar-container {
    background: #ffffff;
    border: 1px solid var(--rcc-border-color);
    border-radius: var(--rcc-radius);
    padding: 2rem;
    box-shadow: var(--rcc-shadow);
    text-align: center;
    margin-bottom: 2rem;
}

.rcc-radar-heading {
    margin: 0 0 1.5rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rcc-text-main);
}

.rcc-radar-svg-wrapper {
    max-width: 460px;
    margin: 0 auto 1.5rem auto;
}

.rcc-radar-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.rcc-radar-grid {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 1;
    stroke-dasharray: 2, 2;
}

.rcc-radar-axis {
    stroke: #e2e8f0;
    stroke-width: 1.5;
}

.rcc-radar-label {
    font-size: 13px;
    font-weight: 600;
    fill: #475569;
}

.rcc-radar-polygon {
    fill-opacity: 0.25;
    stroke-width: 2.5;
    stroke-linejoin: round;
    transition: fill-opacity 0.25s ease;
}

.rcc-radar-polygon:hover {
    fill-opacity: 0.45;
}

.rcc-radar-point {
    transition: r 0.2s ease;
}

.rcc-radar-point:hover {
    r: 7;
}

.rcc-radar-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.rcc-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.rcc-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}


/* =========================================================
   4. مخطط مقارنة الأداء والبنشمارك الأفقي (Benchmark Bar Chart)
   مطابق تماماً للرسم البياني المرفق لاختبارات السرعة والعتاد
   ========================================================= */
.rcc-benchmark-wrapper {
    border-radius: 12px;
    padding: 2.5rem 2rem 2rem 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    margin: 2rem 0;
    font-family: inherit;
    overflow: hidden;
}

/* الثيم الداكن (Dark Theme - مطابق للصورة المرفقة) */
.rcc-benchmark-wrapper.rcc-theme-dark {
    background-color: #383838;
    color: #ffffff;
    border: 1px solid #4a4a4a;
}

.rcc-benchmark-wrapper.rcc-theme-light {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.rcc-bench-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.rcc-bench-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.5px;
    color: inherit;
}

.rcc-bench-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0.35rem;
    opacity: 0.9;
}

.rcc-bench-chart-area {
    width: 100%;
    margin-bottom: 2rem;
}

.rcc-bench-categories {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rcc-bench-group {
    display: flex;
    align-items: center;
    position: relative;
}

.rcc-bench-label {
    width: 220px;
    min-width: 220px;
    padding-left: 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
    color: inherit;
}

.rcc-ltr .rcc-bench-label {
    text-align: right;
    padding-left: 0;
    padding-right: 1.25rem;
}

.rcc-bench-bars-slot {
    flex-grow: 1;
    position: relative;
    padding: 0.5rem 0;
}

/* خطوط الشبكة الخلفية */
.rcc-bench-grid-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.rcc-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.12);
}

.rcc-theme-light .rcc-grid-line {
    background-color: rgba(0, 0, 0, 0.08);
}

/* حزمة الأشرطة لكل فئة */
.rcc-bench-bars-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
}

.rcc-bench-bar-row {
    height: 18px;
    position: relative;
}

.rcc-bench-bar-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.rcc-bench-bar-fill {
    height: 100%;
    border-radius: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rcc-bench-val-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
    padding-left: 4px;
}

/* المحور السيني X-Axis */
.rcc-bench-xaxis {
    display: flex;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
}

.rcc-theme-light .rcc-bench-xaxis {
    border-top-color: rgba(0, 0, 0, 0.2);
}

.rcc-bench-xaxis-spacer {
    width: 220px;
    min-width: 220px;
}

.rcc-bench-xaxis-ticks {
    flex-grow: 1;
    position: relative;
    height: 24px;
}

.rcc-xaxis-tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: inherit;
    opacity: 0.85;
}

/* دليل الألوان Legend */
.rcc-bench-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rcc-theme-light .rcc-bench-legend {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.rcc-bench-legend-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: inherit;
}

.rcc-bench-legend-box {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .rcc-bench-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .rcc-bench-label {
        width: 100%;
        text-align: left;
        margin-bottom: 0.35rem;
        padding: 0;
    }
    .rcc-bench-bars-slot {
        width: 100%;
    }
    .rcc-bench-xaxis-spacer {
        display: none;
    }
}
