/* استایل‌های فرانت‌اند افزونه مدیریت جامع لیگ برتر */
:root {
    --primary-color: #2563eb; /* آبی تیره */
    --secondary-color: #60a5fa; /* آبی روشن */
    --accent-color: #10b981; /* سبز */
    --text-color: #111827; /* متن اصلی */
    --bg-color: #f9fafb; /* پس‌زمینه روشن */
    --card-bg: #ffffff; /* پس‌زمینه کارت */
    --border-color: #d1d5db; /* حاشیه */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
    --transition: all 0.2s ease;
    --dark-bg: #1f2937; /* پس‌زمینه تیره */
    --dark-card-bg: #374151; /* کارت تیره */
    --dark-text: #f3f4f6; /* متن تیره */
}

body.rtl {
    font-family:'iransans', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    direction: rtl;
}
@font-face {
    font-family: 'iransans';
    font-style: normal;
    font-weight: bold;
    src: url('fonts/IRANSans-Bold-web.woff') format('woff');
	font-display: swap;
}
@font-face {
    font-family: 'iransans';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/IRANSans-Medium-web.woff') format('woff');
	font-display: swap;
}
@font-face {
    font-family: 'iransans';
    font-style: normal;
    font-weight: 300;
    src: url('fonts/IRANSans-Light-web.woff') format('woff');
	font-display: swap;
}
@font-face {
    font-family: 'iransans';
    font-style: normal;
    font-weight: normal;
    src: url('fonts/IRANSans-web.woff') format('woff');
	font-display: swap;
}
/* استایل جدول لیگ (صفحات) */
.wplm-standings-wrap {
    max-width: 1000px;
    margin: 16px auto; /* کاهش حاشیه عمودی */
    padding: 8px; /* کاهش پدینگ */
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease-in;
    box-sizing: border-box; /* اطمینان از محاسبه حاشیه و پدینگ در عرض */
}

.wplm-standings-wrap.dark {
    background: var(--dark-card-bg);
}

.wplm-standings {
    width: 100%;
    max-width: 100%; /* جلوگیری از بیرون‌زدگی */
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    overflow-x: hidden; /* بدون اسکرول افقی */
}

.wplm-standings-wrap.dark .wplm-standings {
    background: var(--dark-card-bg);
}

.wplm-standings th,
.wplm-standings td {
    padding: 8px 6px; /* پدینگ کمتر */
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px; /* فونت کوچکتر برای خوانایی */
    transition: var(--transition);
}

.wplm-standings th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wplm-standings td {
    color: var(--text-color);
    font-weight: 500;
}

.wplm-standings-wrap.dark .wplm-standings th,
.wplm-standings-wrap.dark .wplm-standings td {
    color: var(--dark-text);
    border-bottom: 1px solid #4b5563;
}

.wplm-standings tr {
    transition: var(--transition);
}

.wplm-standings tr:hover {
    background: #f1f5f9;
}

.wplm-standings-wrap.dark .wplm-standings tr:hover {
    background: #4b5563;
}

.wplm-standings .wplm-logo {
    max-width: 24px; /* لوگو کوچکتر */
    height: auto;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    transition: var(--transition);
}

.wplm-standings .wplm-logo:hover {
    transform: scale(1.1);
}

/* استایل ابزارک جدول لیگ */
.widget-standings {
    padding: 10px;
    background: transparent;
    font-size: 14px;
    overflow-x: hidden;
}

.widget-standings .standings-header {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    margin-bottom: 8px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
}

.widget-standings .standings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.widget-standings.dark .standings-header,
.widget-standings.dark .standings-row {
    background: var(--dark-card-bg);
}

.widget-standings .standings-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.widget-standings .standings-row span,
.widget-standings .standings-header span {
    flex: 1;
    min-width: 30px;
    text-align: center;
    color: var(--text-color);
    font-size: 13px;
}

.widget-standings.dark .standings-row span {
    color: var(--dark-text);
}

.widget-standings .team-name {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.widget-standings .wplm-logo {
    max-width: 24px;
    height: auto;
    border-radius: 4px;
}

.widget-standings .wplm-full-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.widget-standings .wplm-full-link:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.widget-standings.dark .wplm-full-link {
    color: var(--secondary-color);
}

.widget-standings.dark .wplm-full-link:hover {
    color: #93c5fd;
}

.widget-standings.compact .standings-header span:not(.team-name):not(.points),
.widget-standings.compact .standings-row span:not(.team-name):not(.points) {
    display: none;
}

/* استایل بازی‌ها (صفحات) */
.wplm-matches {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease-in;
}

.wplm-matches.dark {
    background: var(--dark-card-bg);
    color: var(--dark-text);
}

.wplm-matches.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.wplm-matches.list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wplm-matches.card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.wplm-matches.table {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wplm-matches.table .match-card {
    display: table-row;
}

.wplm-matches.table .match-teams,
.wplm-matches.table .match-info,
.wplm-matches.table .match-result,
.wplm-matches.table .match-week,
.wplm-matches.table .match-date {
    display: table-cell;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.wplm-matches.table.dark .match-teams,
.wplm-matches.table.dark .match-info,
.wplm-matches.table.dark .match-result,
.wplm-matches.table.dark .match-week,
.wplm-matches.table .match-date {
    border-bottom: 1px solid #4b5563;
}

.match-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 16px;
    transition: var(--transition);
}

.wplm-matches.dark .match-card {
    background: var(--dark-card-bg);
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.match-card.pending {
    background: #fef3c7;
}

.wplm-matches.dark .match-card.pending {
    background: #78350f;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.match-teams .team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.wplm-matches.dark .match-teams .team {
    color: var(--dark-text);
}

.match-teams .vs {
    font-weight: 600;
    color: var(--primary-color);
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-result {
    font-weight: 600;
    color: var(--accent-color);
}

.match-week,
.match-date {
    font-size: 0.9em;
    color: #6b7280;
}

.wplm-matches.dark .match-week,
.wplm-matches.dark .match-date {
    color: #9ca3af;
}

.wplm-logo {
    max-width: 40px;
    height: auto;
    border-radius: 6px;
    transition: var(--transition);
}

.wplm-logo:hover {
    transform: scale(1.1);
}

/* استایل ابزارک بازی‌ها */
.widget-matches {
    padding: 10px;
    background: transparent;
}

.widget-matches .match-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.widget-matches.dark .match-card {
    background: var(--dark-card-bg);
}

.widget-matches .match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.widget-matches.compact .match-card .match-info > *:not(.match-result) {
    display: none;
}

.widget-matches.compact .match-card .match-teams .team img {
    display: none;
}

.widget-matches .match-teams {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.widget-matches .match-info {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
}

.widget-matches .wplm-logo {
    max-width: 28px;
}

/* استایل کپی‌رایت و آخرین به‌روزرسانی */
.wplm-last-updated,
.wplm-copyright {
    text-align: center;
    margin-top: 12px;
    font-size: 0.9em;
    color: #6b7280;
}

.wplm-standings-wrap.dark .wplm-last-updated,
.wplm-standings-wrap.dark .wplm-copyright,
.wplm-matches.dark .wplm-last-updated,
.wplm-matches.dark .wplm-copyright,
.widget-standings.dark .wplm-last-updated,
.widget-standings.dark .wplm-copyright,
.widget-matches.dark .wplm-last-updated,
.widget-matches.dark .wplm-copyright {
    color: #9ca3af;
}

.wplm-copyright a {
    color: var(--primary-color);
    text-decoration: none;
}

.wplm-copyright a:hover {
    text-decoration: underline;
}

/* انیمیشن */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wplm-standings-wrap,
.wplm-matches,
.match-card,
.wplm-standings tr,
.widget-standings .standings-row,
.widget-matches .match-card {
    animation: fadeIn 0.3s ease-in;
}

/* طراحی responsive */
@media (max-width: 768px) {
    .wplm-standings-wrap,
    .wplm-matches {
        margin: 10px; /* حاشیه کمتر */
        padding: 8px;
    }

    .wplm-standings th,
    .wplm-standings td {
        padding: 6px 4px;
        font-size: 12px;
    }

    .wplm-standings .wplm-logo {
        max-width: 20px;
    }

    .wplm-matches.grid,
    .wplm-matches.card {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .wplm-matches.table .match-teams,
    .wplm-matches.table .match-info,
    .wplm-matches.table .match-result,
    .wplm-matches.table .match-week,
    .wplm-matches.table .match-date {
        padding: 8px;
    }

    .widget-standings .standings-row,
    .widget-matches .match-card {
        padding: 8px;
    }

    .widget-standings .standings-row span,
    .widget-standings .standings-header span {
        min-width: 25px;
        font-size: 12px;
    }

    .widget-standings .wplm-logo {
        max-width: 20px;
    }
}

@media (max-width: 480px) {
    .wplm-standings-wrap {
        margin: 8px; /* حاشیه کمتر برای فیت شدن */
        padding: 6px;
        overflow-x: hidden;
        max-width: 100%; /* جلوگیری از بیرون‌زدگی */
    }

    .wplm-standings {
        width: 100%;
        max-width: 100%; /* عرض کامل بدون بیرون‌زدگی */
    }

    .wplm-standings th,
    .wplm-standings td {
        padding: 4px 3px; /* پدینگ خیلی کم */
        font-size: 11px; /* فونت کوچکتر */
    }

    /* مخفی کردن ستون‌های غیرضروری در موبایل */
    .wplm-standings th.played,
    .wplm-standings td.played,
    .wplm-standings th.won,
    .wplm-standings td.won,
    .wplm-standings th.drawn,
    .wplm-standings td.drawn,
    .wplm-standings th.lost,
    .wplm-standings td.lost,
    .wplm-standings th.goal-diff,
    .wplm-standings td.goal-diff,
    .wplm-standings th.goals,
    .wplm-standings td.goals {
        display: none;
    }

    .wplm-standings .wplm-logo {
        max-width: 18px; /* لوگو کوچکتر */
        margin-left: 3px;
    }

    .wplm-standings tr:hover {
        transform: none; /* غیرفعال کردن افکت hover در موبایل */
    }

    .wplm-matches.grid,
    .wplm-matches.card {
        grid-template-columns: 1fr;
    }

    .wplm-matches.table {
        display: block;
    }

    .wplm-matches.table .match-card {
        display: block;
        padding: 12px;
        margin-bottom: 12px;
    }

    .wplm-matches.table .match-teams,
    .wplm-matches.table .match-info,
    .wplm-matches.table .match-result,
    .wplm-matches.table .match-week,
    .wplm-matches.table .match-date {
        display: block;
        padding: 4px 0;
    }

    .wplm-logo {
        max-width: 30px;
    }

    .widget-standings .standings-row,
    .widget-matches .match-card {
        font-size: 12px;
    }

    .widget-standings .standings-row span,
    .widget-standings .standings-header span {
        min-width: 100%;
        text-align: right;
        padding: 4px 0;
    }

    .widget-standings .team-name {
        flex: 100%;
        justify-content: flex-end;
    }

    .widget-standings .wplm-logo {
        max-width: 18px;
    }

    .widget-standings .standings-row .played {
        display: none;
    }

    .widget-standings.compact .standings-row .points {
        font-weight: 600;
    }

    .widget-standings .wplm-full-link {
        font-size: 11px;
        padding: 6px;
    }
}
/* استایل بخش نظرسنجی */
.wplm-poll {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}
.wplm-poll h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
    text-align: center;
}
.wplm-poll p {
    font-size: 16px;
    color: #e74c3c;
    text-align: center;
    margin: 10px 0;
    font-weight: 400;
}
.wplm-poll button {
    display: inline-block;
    margin: 3px 0px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.3s ease;
}
.wplm-poll button:hover {
    background: linear-gradient(135deg, #005a87, #003d5b);
    transform: scale(1.05);
}
.wplm-poll button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* استایل نتایج نظرسنجی */
.poll-results {
    margin-top: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}
.poll-results span {
    display: block;
    font-size: 15px;
    margin: 8px 0;
    font-weight: 400;
    color: #333;
}
.poll-results span::before {
    content: '• ';
    color: #007cba;
}

/* استایل اعلان */
#wplm-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    font-family: 'IRANSans', sans-serif;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .wplm-matches.grid .match-card {
        margin: 10px;
        padding: 15px;
    }
    .wplm-matches .team {
        font-size: 14px;
    }
    .wplm-poll button {
        padding: 8px 15px;
        font-size: 14px;
    }
    .poll-results span {
        font-size: 14px;
    }
}
