/* ===============================
   WP Speed Checker - Clean CSS
================================ */

.wpsc-wrapper {
    direction: rtl;
    max-width: 1250px;
    margin: 24px auto;
    font-family: inherit;
}

.wpsc-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.wpsc-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.wpsc-description {
    color: #64748b;
    margin-bottom: 18px;
}

/* ===============================
   Form
================================ */

.wpsc-form {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.wpsc-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    border-radius: 10px;
    padding: 13px 16px !important;
    font-size: 15px;
    color: #111827;
    direction: ltr;
    text-align: left;
    box-shadow: none !important;
}

.wpsc-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.wpsc-button {
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 700;
    min-height: 46px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s ease;
}

.wpsc-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* ===============================
   Notices
================================ */

.wpsc-loading {
    margin-top: 16px;
    padding: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 10px;
}

.wpsc-error {
    margin-top: 16px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
}

/* ===============================
   Results / Summary
================================ */

.wpsc-results h3 {
    margin-top: 0;
    color: #111827;
}

.wpsc-score-box {
    text-align: center;
    font-size: 20px;
    color: #1e293b;
    padding: 20px;
    background: #f8fafc;
    margin-bottom: 10px;
    border-radius: 10px;
}

.wpsc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wpsc-summary-grid div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    border-radius: 9px;
}

.wpsc-summary-grid strong {
    display: block;
    color: #374151;
    margin-bottom: 5px;
}

.wpsc-summary-grid span {
    color: #111827;
    word-break: break-word;
}

.wpsc-warnings {
    margin-top: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-right: 4px solid #f97316;
    color: #9a3412;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.9;
    max-height: 360px;
    overflow: auto;
}

.wpsc-warnings div,
.wpsc-warnings p,
.wpsc-warnings li {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.wpsc-ok-item {
    color: #047857;
}

/* ===============================
   Main Resource Table
================================ */

/* اجبار جدول به چیدمان چپ به راست برای تراز شدن ستون‌ها */
.wpsc-table-wrap {
    direction: ltr !important;
    margin-top: 20px;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.wpsc-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important; /* بسیار مهم برای فیکس شدن عرض ستون‌ها */
    direction: ltr !important;
    text-align: left !important;
}

/* تنظیم دقیق عرض ستون‌ها */
.wpsc-col-file   { width: 50% !important; text-align: left !important; }
.wpsc-col-type   { width: 10% !important; text-align: center !important; }
.wpsc-col-size   { width: 11% !important; text-align: center !important; }
.wpsc-col-time   { width: 11% !important; text-align: center !important; }
.wpsc-col-status { width: 10% !important; text-align: center !important; }

.wpsc-col-file {
    width: 40% !important;
    text-align: left !important;
    word-break: break-all !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    font-size: 11px !important;
}


.wpsc-table th {
    background: #f8fafc !important;
    padding: 12px 8px !important;
    font-weight: bold !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.wpsc-table td {
    padding: 10px 8px !important;
    border-bottom: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
    word-break: break-all !important;
}

/* استایل لینک فایل */
.wpsc-table td a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

/* استایل بج‌ها */
.wpsc-code-ok {
    background: #ecfdf5 !important;
    color: #047857 !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    display: inline-block !important;
}


/* ===============================
   Badges / Status
================================ */

.wpsc-code-ok,
.wpsc-code-error,
.wpsc-status-200,
.wpsc-status-300,
.wpsc-status-error {
    display: inline-block;
    min-width: 44px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;
    text-align: center;
}

.wpsc-code-ok,
.wpsc-status-200 {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.wpsc-status-300 {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.wpsc-code-error,
.wpsc-status-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.wpsc-tag-ext,
.wpsc-tag-warn {
    display: inline-block;
    margin-top: 4px;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.wpsc-tag-ext {
    background: #e0f2fe;
    color: #0369a1;
}

.wpsc-tag-warn {
    background: #fee2e2;
    color: #b91c1c;
}

.wpsc-row-error {
    background: #fff7f7 !important;
}

.wpsc-error-text {
    margin-top: 4px;
    color: #b91c1c;
    font-size: 11px;
    direction: ltr;
    text-align: left;
}

/* ===============================
   Waterfall
================================ */

.wpsc-waterfall-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpsc-waterfall-item {
    display: grid;
    grid-template-columns: 180px 1fr 80px;
    gap: 10px;
    align-items: center;
}

.wpsc-waterfall-name {
    direction: ltr;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #374151;
}

.wpsc-waterfall-track {
    background: #f3f4f6;
    border-radius: 999px;
    height: 18px;
    overflow: hidden;
    position: relative;
}

.wpsc-waterfall-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
    border-radius: 999px;
    min-width: 3px;
}

.wpsc-waterfall-time {
    direction: ltr;
    text-align: left;
    color: #111827;
    font-size: 13px;
}

/* ===============================
   Responsive
================================ */

@media (max-width: 768px) {
    .wpsc-wrapper {
        margin: 16px auto;
    }

    .wpsc-card {
        padding: 14px;
    }

    .wpsc-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .wpsc-button {
        width: 100%;
        padding: 12px 18px;
    }

    .wpsc-summary-grid {
        grid-template-columns: 1fr;
    }

    .wpsc-table {
        min-width: 850px;
    }

    .wpsc-waterfall-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .wpsc-waterfall-time {
        text-align: right;
    }
}
.wpsc-table tbody tr.wpsc-row-error {
    background-color: #fef2f2;
    border-left: 3px solid #ef4444;
}

.wpsc-table tbody tr.wpsc-row-warning {
    background-color: #fffbeb;
    border-left: 3px solid #f59e0b;
}

.wpsc-code-error {
    color: #b91c1c;
    font-weight: bold;
}

.wpsc-code-ok {
    color: #15803d;
}
.wpsc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.wpsc-table th,
.wpsc-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpsc-table th {
    background: #f9fafb;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.wpsc-table th:nth-child(1) { width: 40%; }
.wpsc-table th:nth-child(2) { width: 12%; }
.wpsc-table th:nth-child(3) { width: 12%; }
.wpsc-table th:nth-child(4) { width: 12%; }
.wpsc-table th:nth-child(5) { width: 12%; }

.wpsc-table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

