body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: #f0f2f5;
}
.public-page-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}
.public-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}
h1.page-title-custom {
    color: #0d6efd; /* Primary blue */
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 20px;
    border-bottom: 3px solid #0d6efd;
    padding-bottom: 10px;
    font-weight: 700;
}
h2 {
    font-size: 1.6em;
    color: #2c3e50;
    margin-top: 10px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Search Form Styling */
.search-form-custom {
    display: flex;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}
.search-form-custom input[type="text"] {
    flex-grow: 1;
    padding: 14px 20px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 0;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.search-form-custom input[type="text"]:focus {
    border-color: #0d6efd;
    outline: none;
}
.search-form-custom button {
    padding: 14px 25px;
    background-color: #0d6efd;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    border-radius: 0;
}
.search-form-custom button:hover {
    background-color: #0b5ed7;
}

/* Result Item (Top Achievers/Search List) */
.result-item-custom {
    background: #f8f9fa;
    margin-bottom: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    border-right: 5px solid #28a745; /* Green success border */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s, background 0.2s;
}
.result-item-custom:hover {
    background: #f1f1f1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.result-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.result-info .rank-number {
    font-weight: bold;
    margin-left: 20px;
    color: #dc3545; /* Red for rank */
    font-size: 1.2em;
}
.result-info a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.1em;
    transition: color 0.2s;
}
.result-info a:hover {
    color: #0d6efd;
}
.achievement-summary {
    font-size: 0.9em;
    color: #6c757d;
    margin-right: 15px;
}
.achievement-count-badge {
    background-color: #28a745; /* Green */
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}

/* Profile View Styling */
.profile-header-custom {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}
.profile-header-custom h2 {
    color: white;
    margin: 0;
    border-bottom: none;
    font-size: 1.8em;
}

/* Achievement List Styling */
.achievement-item-custom {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
}
.achievement-item-custom:last-child {
    border-bottom: none;
}

.rank-badge-wrapper {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    padding-top: 5px;
}
.achievement-medal {
    font-size: 2.2em;
    display: block;
    margin-bottom: 5px;
}
.achievement-content {
    flex-grow: 1;
    padding-right: 20px;
}
.achievement-content strong {
    font-size: 1.1em;
    color: #2c3e50;
}
.level-tag {
    background: #ffc107;
    color: #333;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-left: 10px;
    font-weight: 500;
}
.type-info-text {
    display: block;
    color: #7f8c8d;
    font-size: 0.85em;
    margin-top: 5px;
}
.achievement-description {
    margin: 5px 0 0 0;
    font-style: italic;
    font-size: 0.9em;
    color: #666;
    border-top: 1px dotted #f0f0f0;
    padding-top: 5px;
}
.no-results-message {
    padding: 30px;
    text-align: center;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}


/* Mobile Adjustments */
@media (max-width: 600px) {
    .public-page-wrapper {
        margin: 20px auto;
    }
    .search-form-custom input, .search-form-custom button {
        border-radius: 0;
    }
    .result-item-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .result-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-info .rank-number { margin-left: 0; }
    .achievement-summary { margin-right: 0; }
}
.trophy-icon {
    /* Sets the color of the icon */
    color: gold;
    /* Sets the margin on the left side of the icon (for spacing before the text) */
    margin-left: 10px;
}

/* Add any other specific styles for the heading here */
.page-title-custom {
    /* For example, if you wanted to change the font size or alignment: */
    /* font-size: 2em; */
    /* text-align: center; */
}
/* استایل هدر لیست برترین‌ها */
.top-students {
    display: inline-flex;        /* آیکون و متن کنار هم قرار بگیرند */
    align-items: center;
    gap: 0.5rem;                 /* فاصله بین آیکون و متن */
    font-size: 1.25rem;          /* اندازه متن */
    font-weight: 600;
    color: #222;                 /* رنگ متن (در صورت نیاز تغییر بده) */
    margin: 0.5rem 0;            /* فاصله بالا-پایین */
}

/* استایل ستاره (آیکون Font Awesome) */
.top-students i.fas.fa-star {
    color: gold;                 /* رنگ ستاره */
    /* فاصله منطقی که با جهت متن سازگار است */
    margin-inline-end: 0.5rem;
    font-size: 1.05em;           /* اندازه آیکون نسبت به متن */
    line-height: 1;
}
/* ======= ساختار کلی صفحه ======= */
body {
    background-color: #f3f5f8;
    font-family: "Vazirmatn", sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
    direction: rtl;
}

/* ======= هدر ======= */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
}
.logo a {
    font-weight: 800;
    font-size: 1.4rem;
    color: #1e47ff;
    text-decoration: none;
}
.main-nav a {
    margin-inline: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}
.main-nav a:hover {
    color: #1e47ff;
}
.button {
    background-color: #1e47ff;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    text-decoration: none;
    transition: background 0.2s ease;
}
.button:hover {
    background-color: #003ef3;
}

/* ======= عنوان اصلی ======= */
.page-title-custom {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e47ff;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.trophy-icon {
    color: gold;
    font-size: 1.6rem;
}

/* ======= فرم جستجو ======= */
.search-form-custom {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px auto;
    width: 100%;
    max-width: 600px;
}
.search-form-custom input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px 0 0 10px;
    outline: none;
    font-size: 0.95rem;
}
.search-form-custom button {
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

/* ======= کارت محتوا ======= */
.public-card {
    background-color: #fff;
    border-radius: 16px;
    padding: 24px;
    margin: 0 auto 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 720px;
}

/* ======= عنوان بخش برترین‌ها ======= */
.top-students {
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #1e47ff20;
    padding-bottom: 8px;
}
.top-students i {
    color: gold;
    font-size: 1.2rem;
}

/* ======= لیست نتایج ======= */
.result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.result-item-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fbff;
    border: 1px solid #e1e6f9;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: 0.2s ease;
}
.result-item-custom:hover {
    background: #edf3ff;
    transform: translateY(-2px);
}
.result-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.result-info a {
    text-decoration: none;
    color: #1e47ff;
    font-weight: 600;
}
.rank-number {
    color: #d62e00;
    font-weight: 700;
}
.achievement-summary {
    font-size: 0.9rem;
    color: #666;
}
.achievement-count-badge {
    background-color: #22c55e;
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ======= پروفایل ======= */
.profile-header-custom {
    text-align: center;
    margin-bottom: 25px;
}
.profile-header-custom h2 {
    margin-bottom: 5px;
}
.achievement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.achievement-item-custom {
    background: #f9fbff;
    border: 1px solid #e1e6f9;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
}
.rank-badge-wrapper {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.achievement-content strong {
    color: #1e47ff;
}
.level-tag {
    background: #eff3ff;
    color: #003ef3;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.8rem;
    margin-inline-start: 6px;
}
.achievement-description {
    font-size: 0.9rem;
    color: #555;
    margin-top: 6px;
}

/* ======= پیغام بدون نتیجه ======= */
.no-results-message {
    text-align: center;
    background-color: #fff5f5;
    border: 1px solid #ffdada;
    border-radius: 12px;
    padding: 20px;
    color: #c62828;
    font-weight: 500;
}

/* ======= فوتر ======= */
.main-footer {
    background: #fff;
    color: #333;
    border-top: 1px solid #eee;
    margin-top: 60px;
}
/* --- Footer Styles --- */
.main-footer { background-color: #212529; color: #adb5bd; padding: 40px 5%; }
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.footer-col h4 { color: #fff; margin-bottom: 20px; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ''; position: absolute; right: 0; bottom: 0; width: 50px; height: 2px; background-color: #0d6efd; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li a { text-decoration: none; color: #adb5bd; }
.social-links a { display: inline-block; width: 40px; height: 40px; line-height: 40px; text-align: center; background-color: #343a40; color: #fff; border-radius: 50%; margin-left: 10px; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid #343a40; font-size: 13px; }

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 30px 5%;
}
.footer-col h4 {
    color: #1e47ff;
    font-weight: 700;
    margin-bottom: 10px;
}
.footer-col a {
    text-decoration: none;
    color: #333;
}
.footer-col a:hover {
    color: #1e47ff;
}
.social-links a {
    margin-left: 10px;
    color: #555;
    font-size: 1.2rem;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid #eee;
    padding: 10px;
    font-size: 0.9rem;
}
/* ================================
   نسخه ریسپانسیو برای موبایل
   ================================ */
@media (max-width: 768px) {
    .main-content-wrapper,
    .public-page-wrapper {
        padding: 15px;
        margin: 20px auto;
        box-shadow: none;
        border-radius: 10px;
    }

    /* عنوان اصلی */
    .page-title-custom {
        font-size: 1.2rem;
        text-align: center;
        line-height: 1.6;
    }

    /* فرم جستجو */
    .search-form-custom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-form-custom input {
        width: 100%;
        min-width: unset;
        font-size: 0.95rem;
    }

    .search-form-custom button {
        width: 100%;
        font-size: 1rem;
    }

    /* کارت‌ها و لیست نتایج */
    .result-item-custom {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
        padding: 12px;
    }

    .result-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .rank-number {
        font-size: 1rem;
        color: #1976d2;
        font-weight: bold;
    }

    .achievement-count-badge {
        align-self: flex-start;
        margin-top: 8px;
        font-size: 0.9rem;
        padding: 4px 10px;
    }

    /* دستاوردها در صفحه پروفایل */
    .achievement-item-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .achievement-content strong {
        display: block;
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .achievement-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* متن‌ها و تیترها */
    .top-students {
        font-size: 1.1rem;
        margin: 15px 0;
    }

    .profile-header-custom h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    .profile-header-custom p {
        text-align: center;
        font-size: 0.9rem;
    }
}

body {font-family:"Vazirmatn",sans-serif;background:#f8f9fa;color:#333;}
.container {max-width:1000px;margin:auto;padding:20px;}
h1 {text-align:center;color:#007bff;margin-bottom:30px;}
table {width:100%;border-collapse:collapse;margin-bottom:40px;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,0.1);}
th,td {padding:10px 14px;text-align:center;border-bottom:1px solid #eee;}
th {background:#007bff;color:#fff;}
tr:hover {background:#f1f9ff;cursor:pointer;}
.rank-number {font-weight:bold;}
.subtitle {color:#555;margin-bottom:8px;font-size:18px;}
/* 🎯 دکمه‌های فیلتر دستاوردها */
.filter-buttons-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 25px 0 35px;
    flex-wrap: wrap;
}

.filter-button {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.25s ease;
    background: linear-gradient(145deg, #ffffff, #f1f3f6);
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filter-button:hover {
    background: #f8fbff;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
}

/* حالت فعال */
.filter-button.active {
    background: linear-gradient(135deg, #007bff, #0056d8);
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}

/* حالت کلیک */
.filter-button:active {
    transform: scale(0.97);
}

/* 1. استایل پایه برای تمام آیکون‌های دستاورد */
.achievement-icon {
    display: inline-block;
    transition: transform 0.3s, color 0.3s;
    margin-left: 10px;
    /* تنظیم سایز پایه (1.0x) */
    font-size: 1.5em;
}

/* 2. سطوح مقیاس‌بندی و رنگ‌ها */

/* سطح SCHOOL (پیش‌فرض) */
.level-school {
    color: #CD7F32; /* Bronze */
    transform: scale(1.0);
}

/* سطح DISTRICT (منطقه) */
.level-district {
    color: #A9B8C3; /* Silver */
    transform: scale(1.3);
}

/* سطح PROVINCE (استان) */
.level-province {
    color: #FFD700; /* Gold */
    transform: scale(1.6);
}

/* سطح NATIONAL (کشور) */
.level-national {
    color: #E5E4E2; /* Platinum */
    transform: scale(2.0);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7); /* افکت درخشش */
}
