/*============================================================*/
/*=== إضافة إحصائيات المجلة - ملف الأنماط ===*/
/*=== OJS 3.5 - Journal Statistics Plugin CSS ===*/
/*============================================================*/

/* ========== CSS الأساسي ========== */
.ojs-stats-widget {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(30, 58, 95, 0.08), 0 2px 8px rgba(30, 58, 95, 0.04);
    border: 1px solid rgba(30, 58, 95, 0.06);
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
    margin: 20px 0;
}
.ojs-stats-widget:hover {
    box-shadow: 0 20px 60px rgba(30, 58, 95, 0.12), 0 4px 12px rgba(30, 58, 95, 0.06);
    transform: translateY(-2px);
}
.ojs-stats-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e3a5f 0%, #c9a227 50%, #2c5282 100%);
}

/* ========== الرأس ========== */
.ojs-stats-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
    gap: 10px;
}
.ojs-stats-header h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    line-height: 1.3;
}
.ojs-stats-header h3 svg {
    color: #e8d179;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ========== زر الإحصائيات ========== */
.ojs-stats-badge-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ojs-stats-badge-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
.ojs-stats-badge-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ========== الجسم ========== */
.ojs-stats-body { padding: 28px; }

/* ========== الإحصائيات الرئيسية ========== */
.ojs-main-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

/* ========== بطاقة الإحصائية ========== */
.ojs-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.ojs-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #c9a227;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.ojs-stat-card:hover::before { transform: scaleX(1); }
.ojs-stat-card:hover {
    border-color: #c9a227;
    box-shadow: 0 8px 25px rgba(30, 58, 95, 0.08);
    transform: translateY(-4px);
}

/* ========== الأيقونات ========== */
.ojs-stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.ojs-stat-icon.articles { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); color: #1565c0; }
.ojs-stat-icon.days { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); color: #e65100; }
.ojs-stat-icon.decision { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); color: #2e7d32; }
.ojs-stat-icon.rate { background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%); color: #c62828; }

/* ========== الأرقام والعناوين ========== */
.ojs-stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1;
    margin-bottom: 6px;
}
.ojs-stat-label {
    font-size: 0.78rem;
    color: #4a5568;
    font-weight: 600;
}

/* ========== الفاصل ========== */
.ojs-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #c9a227;
}
.ojs-divider::before, .ojs-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ========== قسم الدول ========== */
.ojs-countries-section {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
}
.ojs-countries-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #c9a227;
}
.ojs-countries-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
}
.ojs-country-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.ojs-country-item:hover {
    border-color: #c9a227;
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.08);
    transform: translateY(-2px) scale(1.02);
}
.ojs-country-flag {
    width: 32px; height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ojs-country-percent {
    font-weight: 800;
    font-size: 1rem;
    color: #1e3a5f;
}
.ojs-country-name {
    font-size: 0.75rem;
    color: #4a5568;
    font-weight: 500;
    display: none !important;
}

/* ========== النافذة المنبثقة ========== */
.ojs-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.ojs-modal-overlay.active { opacity: 1; visibility: visible; }

.ojs-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ojs-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.ojs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}
.ojs-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e3a5f;
    margin: 0;
}
.ojs-modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: #e9ecef;
    color: #1e3a5f;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ojs-modal-close:hover { background: #dc3545; color: #fff; transform: rotate(90deg); }
.ojs-modal-body { padding: 24px; overflow-y: auto; }

/* ========== الدوائر ========== */
.ojs-circles-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 28px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4a6e 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}
.ojs-circle-item { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ojs-circle-ring {
    width: 90px; height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}
.ojs-circle-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
}
.ojs-circle-ring.red::before { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15); }
.ojs-circle-ring.blue::before { border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15); }
.ojs-circle-ring.white::before { border-color: #ffffff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
.ojs-circle-number { font-size: 1.6rem; font-weight: 800; color: #fff; }
.ojs-circle-label { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.9); }

/* ========== الجدول ========== */
.ojs-stats-table { width: 100%; border-collapse: collapse; }
.ojs-stats-table tr { border-bottom: 1px solid #e9ecef; transition: background 0.2s ease; }
.ojs-stats-table tr:last-child { border-bottom: none; }
.ojs-stats-table tr:hover { background: #f8f9fa; }
.ojs-stats-table td { padding: 14px 16px; font-size: 0.95rem; }
.ojs-stats-table td:first-child { text-align: right; font-weight: 700; color: #1a202c; }
.ojs-stats-table td:last-child { text-align: left; font-weight: 800; color: #1e3a5f; }
.ojs-stats-table tr.highlight-accept { background: #e3f2fd; }
.ojs-stats-table tr.highlight-accept:hover { background: #bbdefb; }
.ojs-stats-table tr.highlight-accept td:last-child { color: #1565c0; }
.ojs-stats-table .text-green { color: #27ae60 !important; }
.ojs-stats-table .text-red { color: #e74c3c !important; }

/* ============================================================ */
/* ========== تصميم متجاوب للجوال ========== */
/* ============================================================ */

/* شاشات أقل من 768px (تابلت) */
@media (max-width: 768px) {
    .ojs-stats-header {
        padding: 14px 18px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .ojs-stats-header h3 {
        font-size: 0.95rem;
        gap: 8px;
    }
    .ojs-stats-header h3 svg {
        width: 18px;
        height: 18px;
    }
    .ojs-stats-badge-btn {
        font-size: 0.75rem;
        padding: 5px 12px;
        gap: 4px;
    }
    .ojs-stats-badge-btn svg {
        width: 10px;
        height: 10px;
    }
    .ojs-stats-body { padding: 20px; }
    .ojs-main-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .ojs-stat-card { padding: 18px 10px; }
    .ojs-stat-icon {
        width: 44px; height: 44px;
        margin-bottom: 10px;
    }
    .ojs-stat-icon svg {
        width: 20px; height: 20px;
    }
    .ojs-stat-number {
        font-size: 1.4rem;
    }
    .ojs-stat-label {
        font-size: 0.7rem;
    }
    .ojs-countries-section { padding: 18px; }
    .ojs-country-item {
        padding: 8px 12px;
    }
    .ojs-country-flag {
        width: 28px; height: 20px;
    }
    .ojs-circles-row {
        gap: 24px;
        padding: 20px 12px;
    }
    .ojs-circle-ring {
        width: 70px; height: 70px;
    }
    .ojs-circle-number {
        font-size: 1.2rem;
    }
    .ojs-circle-label {
        font-size: 0.7rem;
    }
    .ojs-stats-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
}

/* شاشات أقل من 480px (هاتف) */
@media (max-width: 480px) {
    .ojs-stats-widget {
        border-radius: 14px;
        margin: 12px 0;
    }
    .ojs-stats-header {
        padding: 10px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }
    .ojs-stats-header h3 {
        font-size: 0.8rem;
        gap: 5px;
        line-height: 1.2;
    }
    .ojs-stats-header h3 svg {
        width: 14px;
        height: 14px;
    }
    .ojs-stats-badge-btn {
        font-size: 0.65rem;
        padding: 4px 8px;
        gap: 3px;
        border-radius: 20px;
    }
    .ojs-stats-badge-btn svg {
        width: 8px;
        height: 8px;
    }
    .ojs-stats-body { padding: 16px; }
    .ojs-main-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    .ojs-stat-card {
        padding: 14px 8px;
        border-radius: 12px;
    }
    .ojs-stat-icon {
        width: 38px; height: 38px;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    .ojs-stat-icon svg {
        width: 18px; height: 18px;
    }
    .ojs-stat-number {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    .ojs-stat-label {
        font-size: 0.65rem;
    }
    .ojs-divider {
        margin: 16px 0;
        gap: 8px;
    }
    .ojs-countries-section {
        padding: 14px;
        border-radius: 12px;
    }
    .ojs-countries-title {
        font-size: 0.9rem;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    .ojs-countries-grid {
        gap: 10px;
    }
    .ojs-country-item {
        padding: 6px 10px;
        border-radius: 10px;
        gap: 6px;
    }
    .ojs-country-flag {
        width: 24px; height: 18px;
        border-radius: 3px;
    }
    .ojs-country-percent {
        font-size: 0.85rem;
    }
    .ojs-country-name {
        font-size: 0.7rem;
    }
    .ojs-modal {
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }
    .ojs-modal-header {
        padding: 14px 16px;
    }
    .ojs-modal-header h2 {
        font-size: 0.95rem;
    }
    .ojs-modal-body {
        padding: 16px;
    }
    .ojs-circles-row {
        gap: 16px;
        padding: 16px 8px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    .ojs-circle-ring {
        width: 60px; height: 60px;
    }
    .ojs-circle-ring::before {
        border-width: 3px;
    }
    .ojs-circle-number {
        font-size: 1rem;
    }
    .ojs-circle-label {
        font-size: 0.65rem;
    }
    .ojs-stats-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}

/* شاشات صغيرة جداً (أقل من 360px) */
@media (max-width: 360px) {
    .ojs-main-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .ojs-stat-card {
        padding: 12px 6px;
    }
    .ojs-stat-number {
        font-size: 1.1rem;
    }
    .ojs-stat-label {
        font-size: 0.6rem;
    }
    .ojs-country-item {
        padding: 5px 8px;
    }
    .ojs-country-flag {
        width: 20px; height: 15px;
    }
    .ojs-country-percent {
        font-size: 0.8rem;
    }
    .ojs-circle-ring {
        width: 50px; height: 50px;
    }
    .ojs-circle-number {
        font-size: 0.9rem;
    }
}