@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    background-color: #e6f0f3;
    color: #333;
    line-height: 1.6;
    margin: 0;
}

.menu-item {
    transition: all 0.3s ease;
}

.menu-item:hover {
    transform: scale(1.05);
}

.option-card {
    transition: all 0.3s ease;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* استایل‌های بخش یادگیری زبان */
.learn-words-container {
    margin: auto;
    width: 100%;
    padding: 1rem;
}

@media (min-width: 768px) {
    .learn-words-container {
        max-width: 75%;
    }
}

@media (min-width: 1024px) {
    .learn-words-container {
        max-width: 60%;
    }
}

.learn-words-card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.learn-words-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.learn-words-option {
    background-color: #f0f4f8;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
    font-weight: 500;
}

.learn-words-option:hover {
    background-color: #e2e8f0;
    transform: scale(1.02);
}

.learn-words-correct {
    background-color: #a7f3d0 !important;
    color: #1a2e35;
    animation: learnWordsPulse 1s;
}

.learn-words-incorrect {
    background-color: #fecaca !important;
    color: #451a03;
    animation: learnWordsShake 0.5s;
}

#learn-words-image-container {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 0.75rem;
}

#learn-words-word-image {
    max-width: 100%;
    max-height: 95%;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    transition: opacity 0.3s ease-in-out;
}

#learn-words-word-image.loading {
    opacity: 0.5;
}

#learn-words-image-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

#learn-words-error-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
}

#learn-words-play-audio {
    background-color: #6366f1;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

#learn-words-play-audio:hover {
    background-color: #4f46e5;
    transform: scale(1.05);
}

#learn-words-next-button {
    background-color: #10b981;
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1.15rem;
    font-weight: 600;
}

#learn-words-next-button:hover {
    background-color: #059669;
    transform: scale(1.03);
}

@keyframes learnWordsPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes learnWordsShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
    100% { transform: translateX(0); }
}
/* اطمینان از نمایش صحیح محتوای زبان */
#language-section .container {
    max-width: 100%;
}

/* استایل‌های بازی حافظه جدید */
#games-section .game-title {
    margin-bottom: 10px;
    color: #333;
}
 #games-section .game-description {
    margin-bottom: 20px;
    color: #555;
 }
.memory-game {
    width: 440px;
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-gap: 10px;
    margin: 0 auto;
}
.memory-card {
    width: 100px;
    height: 100px;
    position: relative;
    cursor: pointer;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform 0.5s;
}
.memory-card.flipped {
    transform: rotateY(180deg);
}
.memory-card .front,
.memory-card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    backface-visibility: hidden;
}
.memory-card .front {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #333;
    border: 2px solid #ccc;
}
.memory-card .back {
    background: #ccc;
    transform: rotateY(180deg);
}
/* public_html/css/style.css */

/* --- Memory Game Styles --- */

.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 ستون برای کارت‌ها */
    grid-gap: 10px; /* فاصله بین کارت‌ها */
    width: 100%;
    max-width: 680px; /* حداکثر عرض برای بازی */
    height: 600px; /* ارتفاع برای بازی */
    margin: 40px auto; /* مرکز قرار دادن بازی */
    perspective: 1000px; /* پرسپکتیو برای افکت 3D */
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.memory-card {
    width: 100%;
    height: 150px; /* ارتفاع ثابت برای هر کارت */
    position: relative;
    transform-style: preserve-3d; /* فعال کردن افکت 3D برای چرخش */
    transition: transform 0.6s ease; /* انیمیشن چرخش */
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* برای اینکه محتوای کارت از مرز آن بیرون نزند */
}

/* کلاس 'flipped' برای چرخش کارت */
.memory-card.flipped {
    transform: rotateY(180deg);
}

/* روی و پشت کارت */
.front-face,
.back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden; /* پنهان کردن سمت دیگر کارت هنگام چرخش */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px; /* پدینگ داخلی برای محتوا */
    box-sizing: border-box; /* اطمینان از اینکه پدینگ به عرض/ارتفاع اضافه نشود */
}

/* پشت کارت (initial state) */
.back-face {
    background: linear-gradient(135deg, #1A759F, #16A085); /* یک گرادیانت زیبا برای پشت کارت */
    color: white;
    font-size: 2em;
    font-weight: bold;
    /* می‌توانید یک آیکون یا لوگو برای پشت کارت اضافه کنید */
    /* مثلاً یک آیکون ستاره */
    content: "★";
    display: flex; /* برای مرکزیت محتوا */
    align-items: center;
    justify-content: center;
}

/* روی کارت (after flip) */
.front-face {
    background-color: #FFFFFF;
    transform: rotateY(180deg); /* در ابتدا رو به پشت است */
}

.memory-card.flipped .front-face {
    transform: rotateY(0deg); /* وقتی flip شد، رو به ما باشد */
}

.memory-card.flipped .back-face {
    transform: rotateY(180deg); /* وقتی flip شد، پشت آن رو به ما باشد */
}


.card-image {
    max-width: 90%;
    max-height: 70%; /* فضای بیشتری برای نام و دکمه صوتی */
    object-fit: contain; /* حفظ نسبت تصویر */
    border-radius: 5px;
    margin-bottom: 5px;
}

.card-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-top: 5px;
    direction: ltr; /* اطمینان از نوشتن از چپ به راست */
    white-space: nowrap; /* جلوگیری از شکستن کلمات */
    overflow: hidden; /* مخفی کردن سرریز */
    text-overflow: ellipsis; /* نمایش ... برای متن سرریز */
    max-width: 100%; /* برای کار کردن text-overflow */
}

.audio-button {
    background: none;
    border: none;
    color: #1A759F;
    font-size: 1.5em;
    cursor: pointer;
    margin-top: 5px;
    padding: 5px;
    display: flex; /* برای مرکزیت آیکون */
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.audio-button:hover {
    color: #16A085;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .memory-game {
        grid-template-columns: repeat(3, 1fr); /* 3 ستون در تبلت */
        max-width: 500px;
        height: auto;
    }
    .memory-card {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .memory-game {
        grid-template-columns: repeat(2, 1fr); /* 2 ستون در موبایل */
        max-width: 320px;
        height: auto;
        margin: 20px auto;
    }
    .memory-card {
        height: 100px;
    }
    .card-text {
        font-size: 1em;
    }
    .audio-button {
        font-size: 1.2em;
    }
}
/* public_html/css/style.css */

/* --- Memory Game Styles --- */

.memory-game {
    display: grid;
    /* این مقدار دهی اولیه در دسکتاپ است، بعداً با @media تغییر می کند */
    grid-template-columns: repeat(4, 1fr); 
    grid-gap: 10px;
    width: 100%;
    max-width: 680px; 
    /* ارتفاع به صورت خودکار تنظیم می‌شود تا از سرریز جلوگیری شود */
    height: auto; /* Changed from fixed height */
    aspect-ratio: 4 / 3; /* نسبت ابعاد تقریبی برای حفظ شکل کلی */
    margin: 40px auto;
    perspective: 1000px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.memory-card {
    width: 100%;
    /* ارتفاع ثابت حذف شد، با padding-bottom ابعاد مربع یا مستطیل ثابت می‌شود */
    padding-bottom: 100%; /* Makes the card square, based on its width */
    height: 0; /* Set height to 0 to rely on padding-bottom */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; 
}

/* کلاس 'flipped' برای چرخش کارت */
.memory-card.flipped {
    transform: rotateY(180deg);
}

/* روی و پشت کارت */
.front-face,
.back-face {
    position: absolute; /* استفاده از absolute برای قرارگیری کامل درون کارت */
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px; 
    box-sizing: border-box; 
    /* اضافه کردن پس‌زمینه برای front-face برای جلوگیری از سفیدی */
    background-color: #FFFFFF; 
}

/* پشت کارت (initial state) */
.back-face {
    background: linear-gradient(135deg, #1A759F, #16A085); 
    color: white;
    font-size: 2em;
    font-weight: bold;
    /* می توانید یک آیکون یا لوگو برای پشت کارت اضافه کنید */
}

/* روی کارت (after flip) */
.front-face {
    transform: rotateY(180deg); /* در ابتدا رو به پشت است */
}

/* برای کارت‌هایی که جفت شده‌اند، اطمینان حاصل شود که حالت flipped حفظ می‌شود */
.memory-card.matched {
    cursor: default; /* عدم قابلیت کلیک مجدد */
    /* می توانید یک افکت نوری یا رنگی برای کارت‌های جفت شده اضافه کنید */
    box-shadow: 0 0 15px 5px rgba(0, 255, 0, 0.5); /* مثلاً یک سایه سبز */
}


.card-image {
    max-width: 90%;
    max-height: 70%; 
    object-fit: contain; 
    border-radius: 5px;
    margin-bottom: 5px;
}

.card-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-top: 5px;
    direction: ltr; /* اطمینان از نوشتن از چپ به راست */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%; 
}

.audio-button {
    background: none;
    border: none;
    color: #1A759F;
    font-size: 1.5em;
    cursor: pointer;
    margin-top: 5px;
    padding: 5px;
    display: flex; 
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.audio-button:hover {
    color: #16A085;
}

/* --- Responsive Adjustments --- */

/* عمومی برای فونت و پدینگ در موبایل */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* تنظیمات برای تبلت و صفحه نمایش‌های متوسط */
@media (max-width: 768px) {
    .memory-game {
        grid-template-columns: repeat(3, 1fr); /* 3 ستون در تبلت */
        max-width: 500px;
        aspect-ratio: 3 / 4; /* تنظیم نسبت ابعاد برای 3 ستون */
        margin: 20px auto;
    }
    .memory-card {
        padding-bottom: 100%; /* همچنان مربع */
    }
    .card-text {
        font-size: 1em; /* کاهش سایز فونت */
    }
    .audio-button {
        font-size: 1.3em;
    }
    .option-card { /* برای کارت‌های صفحه اصلی */
        padding: 1rem;
    }
    .option-card h3 {
        font-size: 1.1em;
    }
    .option-card p {
        font-size: 0.9em;
    }
    .option-card button {
        padding: 0.5rem 1rem;
        font-size: 0.9em;
    }
}

/* تنظیمات برای موبایل‌های کوچک */
@media (max-width: 480px) {
    .memory-game {
        grid-template-columns: repeat(2, 1fr); /* 2 ستون در موبایل */
        max-width: 95%; /* کمی کمتر از 100% برای پدینگ کناری */
        aspect-ratio: 2 / 3; /* تنظیم نسبت ابعاد برای 2 ستون */
        margin: 10px auto;
        grid-gap: 8px;
    }
    .memory-card {
        padding-bottom: 100%; /* همچنان مربع */
    }
    .card-text {
        font-size: 0.8em; /* کاهش بیشتر سایز فونت */
        margin-top: 2px;
    }
    .audio-button {
        font-size: 1em;
        margin-top: 2px;
        padding: 3px;
    }
    .card-image {
        max-height: 60%; /* فضای بیشتر برای متن و دکمه */
    }
    /* تنظیمات برای هدر و فوتر در موبایل */
    header .container, footer .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    header span {
        font-size: 1.5rem; /* کوچکتر کردن عنوان هدر */
    }
    footer p, footer a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* اطمینان از اینکه تصاویر در لودینگ حالتی را نشان نمی‌دهند */
#learn-words-word-image.loading {
    background-color: #f0f0f0; /* یک رنگ خاکستری روشن */
    border: 1px solid #ddd; /* یک بوردر برای قاب */
}