/* =============================================
   تعریف فونت نازنین
   ============================================= */
@font-face {
    font-family: 'Nazanin';
    src: url('fonts/Nazanin.eot');
    src: url('fonts/Nazanin.eot?#iefix') format('embedded-opentype'),
         url('fonts/Nazanin.woff') format('woff'),
         url('fonts/Nazanin.ttf') format('truetype'),
         url('fonts/Nazanin.svg#Nazanin') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* =============================================
   متغیرها و استایل‌های کلی (Desktop First)
   ============================================= */
:root {
    --iran-green: #239F40;
    --iran-white: #FFFFFF;
    --iran-red: #DA0000;
    --card-bg-light: #f8f8f8;
    --text-color: #333;
}

body {
    font-family: 'Nazanin', 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0f2f5;
}

/* استایل عنوان صفحه */
.entry-content h1, .entry-content h2, .page-title, .hof-page-title {
    font-family: 'Nazanin', sans-serif;
    text-align: center;
    color: var(--iran-red);
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--iran-green);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.15);
}

/* =============================================
   طراحی اصلی کارت‌ها (Desktop)
   ============================================= */
.hof-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
    padding: 40px;
}

.athlete-card {
    position: relative;
    background: linear-gradient(135deg, var(--card-bg-light), #e9ecef);
    border-radius: 20px;
    padding: 0;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.athlete-card:hover {
    transform: translateY(-10px) rotateX(2deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

/* افکت پرچم ایران روی کارت */
.athlete-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 70px;
    height: 140px;
    background: linear-gradient(to bottom, var(--iran-green) 0%, var(--iran-green) 33.33%, var(--iran-white) 33.33%, var(--iran-white) 66.66%, var(--iran-red) 66.66%, var(--iran-red) 100%);
    z-index: 2;
    border-top-right-radius: 20px;
    box-shadow: -2px 2px 5px rgba(0,0,0,0.2);
}

.athlete-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: -10px;
    width: 10px;
    height: 140px;
    background: var(--iran-red);
    z-index: 1;
    transform: rotateY(90deg);
    transform-origin: left center;
    box-shadow: -5px 0 10px rgba(0,0,0,0.3) inset;
}

/* محتوای داخلی کارت */
.athlete-card-content {
    padding: 30px 30px 30px 30px;
}

.athlete-photo {
    width: 280px;
    height: 280px;
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto 25px auto;
    border: 6px solid var(--iran-white);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 3;
}

.athlete-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.athlete-card:hover .athlete-photo img {
    transform: scale(1.05);
}

.athlete-photo.no-image {
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.athlete-photo.no-image span {
    color: #999;
    font-size: 18px;
}

.athlete-name {
    font-family: 'Nazanin', sans-serif;
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text-color);
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.athlete-sport {
    font-family: 'Nazanin', sans-serif;
    font-size: 1.4em;
    color: var(--iran-green);
    font-weight: bold;
    margin: 0 0 25px 0;
}

.athlete-medals-summary {
    font-size: 3em;
    font-weight: bold;
    color: #444;
    margin: 20px 0 35px 0;
    letter-spacing: 12px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.athlete-medals-summary span {
    margin: 0 5px;
    display: inline-block;
    transform: scale(1.1);
}

.athlete-medals-summary .medal-number {
    font-family: 'Arial', sans-serif;
    font-size: 0.6em;
    vertical-align: super;
    font-weight: 900;
    color: var(--iran-red);
}

.details-btn {
    background: linear-gradient(45deg, var(--iran-green), #1a7a2f);
    color: var(--iran-white);
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-family: 'Nazanin', sans-serif;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(35, 159, 64, 0.3);
}

.details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(35, 159, 64, 0.4);
}

/* =============================================
   استایل پاپ‌آپ (Modal)
   ============================================= */
.hof-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.4s;
}

.hof-modal-content {
    font-family: 'Nazanin', sans-serif;
    background-color: var(--iran-white);
    margin: 2% auto;
    padding: 40px;
    border: 3px solid var(--iran-red);
    border-radius: 20px;
    width: 90%;
    max-width: 750px;
    text-align: center;
    position: relative;
    animation: slideIn 0.5s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hof-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.hof-modal-close:hover { color: var(--iran-red); }

.modal-image-container {
    width: 500px;
    height: 500px;
    margin: 0 auto 30px auto;
    border-radius: 15px;
    overflow: hidden;
    border: 8px solid var(--iran-white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-name {
    font-family: 'Nazanin', sans-serif;
    font-size: 3em;
    color: var(--iran-red);
    margin-bottom: 15px;
}

.modal-details {
    text-align: right;
    font-size: 1.3em;
    line-height: 2;
}

.modal-details p {
    background-color: #f9f9f9;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-right: 6px solid var(--iran-green);
}

.modal-details ul {
    list-style: none;
    padding: 0;
}

.modal-details ul li {
    background-color: #f0f0f0;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-right: 6px solid var(--iran-red);
    font-size: 1.2em;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* =============================================
   واکنش‌گرایی برای تبلت (Tablet)
   ============================================= */
@media (max-width: 768px) {
    .hof-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
        padding: 25px;
    }

    .athlete-card-content {
        padding: 20px;
    }

    .athlete-photo {
        width: 220px;
        height: 220px;
    }

    .athlete-name { font-size: 1.8em; }
    .athlete-sport { font-size: 1.2em; }
    .athlete-medals-summary { font-size: 2.5em; letter-spacing: 8px; }
    .details-btn { font-size: 1.1em; padding: 12px 25px; }

    .hof-modal-content {
        padding: 25px;
        margin: 5% auto;
    }
    .modal-image-container {
        width: 350px;
        height: 350px;
    }
    .modal-name { font-size: 2.2em; }
    .modal-details { font-size: 1.1em; }
}


/* =============================================
   واکنش‌گرایی برای موبایل (Mobile)
   ============================================= */
@media (max-width: 480px) {
    .hof-container {
        grid-template-columns: 1fr; /* تک ستونه */
        gap: 20px;
        padding: 15px;
    }
    
    .entry-content h1, .page-title, .hof-page-title {
        font-size: 2.2em;
        margin-bottom: 25px;
    }

    .athlete-card-content {
        padding: 15px;
    }

    .athlete-photo {
        width: 85%; /* واکنش‌گرا */
        max-width: 250px;
        height: auto; /* حفظ نسبت */
        aspect-ratio: 1 / 1; /* مربعی باقی بماند */
    }

    .athlete-name { font-size: 1.6em; }
    .athlete-sport { font-size: 1.1em; }
    .athlete-medals-summary {
        font-size: 2.2em;
        letter-spacing: 5px;
        margin: 15px 0 25px 0;
    }
    .details-btn { font-size: 1em; padding: 10px 20px; }

    /* تغییرات پاپ‌آپ برای موبایل */
    .hof-modal-content {
        padding: 20px;
        margin: 10% auto;
        width: 95%;
    }
    .hof-modal-close {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }
    .modal-image-container {
        width: 90%; /* واکنش‌گرا */
        height: auto;
        aspect-ratio: 1 / 1;
    }
    .modal-name { font-size: 1.8em; }
    .modal-details {
        font-size: 1em;
        line-height: 1.7;
    }
    .modal-details p, .modal-details ul li {
        padding: 10px 15px;
        font-size: 0.95em;
    }
}