/* =========================================================
   Words Page - Modern Responsive Design
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at 10% 0%, rgba(118, 103, 245, 0.08), transparent 30%),
        #f7f8fc;

    color: #171827;

    font-family:
        Arial,
        Tahoma,
        sans-serif;

    direction: rtl;
}


/* =========================================================
   الأزرار
   ========================================================= */

button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   الشريط العلوي
   ========================================================= */

.topbar {

    width: 100%;

    height: 76px;

    padding: 12px 22px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background: rgba(255, 255, 255, 0.92);

    border-bottom: 1px solid #eeeeF3;

    box-shadow:
        0 3px 18px rgba(20, 20, 50, 0.05);

    position: sticky;

    top: 0;

    z-index: 100;
}


.back-btn,
.home-btn {

    border: none;

    background: #f3f2ff;

    color: #5c51dc;

    cursor: pointer;

    transition:
        transform .15s ease,
        background .15s ease;

}


.back-btn {

    min-height: 44px;

    padding: 0 17px;

    border-radius: 14px;

    font-size: 14px;

    font-weight: bold;
}


.home-btn {

    width: 44px;

    height: 44px;

    border-radius: 14px;

    font-size: 20px;
}


.back-btn:active,
.home-btn:active {

    transform: scale(.94);

}


.back-btn:hover,
.home-btn:hover {

    background: #e9e7ff;

}


.title {

    font-size: 20px;

    font-weight: 800;

    color: #202134;

}


/* =========================================================
   الحاوية الرئيسية
   ========================================================= */

.container {

    width: 100%;

    max-width: 720px;

    margin: 0 auto;

    padding: 22px 18px 28px;
}


/* =========================================================
   منطقة التقدم
   ========================================================= */

.progress-area {

    background: white;

    border-radius: 18px;

    padding: 14px 16px;

    margin-bottom: 15px;

    box-shadow:
        0 5px 20px rgba(20, 20, 50, 0.06);

    border: 1px solid #eeeeF3;
}


.progress-info {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 9px;

    font-size: 13px;

    color: #858594;
}


.progress-info strong {

    color: #5b50dc;

    font-size: 14px;
}


.progress-bar {

    width: 100%;

    height: 9px;

    background: #eeeef5;

    border-radius: 20px;

    overflow: hidden;
}


#progressFill {

    width: 0%;

    height: 100%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #7669f3,
            #5b4ee8
        );

    transition: width .35s ease;
}


/* =========================================================
   بطاقة الكلمة
   ========================================================= */

.word-card {

    background: white;

    border-radius: 27px;

    padding: 20px;

    border: 1px solid #eeeeF3;

    box-shadow:
        0 10px 30px rgba(20, 20, 50, 0.07);

    overflow: hidden;
}


/* =========================================================
   الصورة
   ========================================================= */

.image-container {

    width: 100%;

    height: 235px;

    border-radius: 21px;

    background:
        linear-gradient(
            145deg,
            #f2f1ff,
            #f8f8fd
        );

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    margin-bottom: 18px;

    border: 1px solid #ecebf7;
}


.word-image {

    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 100px;

    overflow: hidden;
}


.word-image img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;
}


/* =========================================================
   محتوى الكلمة
   ========================================================= */

.word-content {

    text-align: center;
}


.english-word {

    font-size: 36px;

    line-height: 1.15;

    font-weight: 800;

    color: #191a2b;

    margin-bottom: 7px;

    direction: ltr;
}


.arabic-word {

    font-size: 21px;

    font-weight: 600;

    color: #777787;

    margin-bottom: 13px;
}


/* =========================================================
   زر سماع الكلمة
   ========================================================= */

.sound-btn {

    border: none;

    background:
        linear-gradient(
            135deg,
            #7669f3,
            #5b4ee8
        );

    color: white;

    border-radius: 15px;

    padding: 11px 19px;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;

    box-shadow:
        0 6px 15px rgba(92, 80, 230, .20);

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}


.sound-btn:active {

    transform: scale(.96);

    box-shadow:
        0 3px 9px rgba(92, 80, 230, .15);
}


/* =========================================================
   المثال
   ========================================================= */

.example {

    margin-top: 17px;

    padding: 15px 17px;

    background: #f8f8fc;

    border: 1px solid #eeeeF4;

    border-radius: 18px;

    text-align: right;
}


.example > span {

    display: block;

    color: #5c51dc;

    font-size: 13px;

    font-weight: bold;

    margin-bottom: 8px;
}


.example p {

    margin: 0 0 5px;

    color: #252638;

    font-size: 15px;

    font-weight: 600;

    direction: ltr;

    text-align: left;
}


.example small {

    display: block;

    color: #888895;

    font-size: 12px;

    line-height: 1.6;
}


/* =========================================================
   أزرار نطق المثال
   ========================================================= */

.example-sound-buttons {

    display: flex;

    gap: 8px;

    margin-top: 12px;
}


.example-sound-btn {

    flex: 1;

    min-height: 38px;

    border: 1px solid #e2e1ed;

    background: white;

    color: #555566;

    border-radius: 11px;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    transition:
        transform .15s ease,
        background .15s ease;
}


.example-sound-btn:active {

    transform: scale(.97);

}


.example-sound-btn:hover {

    background: #f5f4ff;

}


/* =========================================================
   أزرار أعرف / لا أعرف
   ========================================================= */

.knowledge-buttons {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 11px;

    margin-top: 15px;
}


.knowledge-buttons button {

    min-height: 55px;

    border: none;

    border-radius: 17px;

    font-size: 15px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}


.knowledge-buttons button:active {

    transform: scale(.97);
}


.dont-know {

    background: #fff0f3;

    color: #e04762;

    box-shadow:
        0 5px 15px rgba(224, 71, 98, .08);
}


.know {

    background: #e6f8ef;

    color: #23925e;

    box-shadow:
        0 5px 15px rgba(35, 146, 94, .08);
}


/* =========================================================
   الإجراءات
   ========================================================= */

.actions {

    display: grid;

    grid-template-columns: 90px 1fr;

    gap: 10px;

    margin-top: 12px;
}


.actions button {

    min-height: 54px;

    border-radius: 17px;

    cursor: pointer;

    font-size: 14px;

    font-weight: bold;

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}


.actions button:active {

    transform: scale(.97);
}


/* حفظ */

#favoriteBtn {

    border: 1px solid #e6e4ef;

    background: white;

    color: #f0a51b;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 1px;

    font-size: 22px;
}


#favoriteBtn span {

    font-size: 10px;

    color: #777783;
}


/* الكلمة التالية */

.next-btn {

    border: none;

    color: white;

    background:
        linear-gradient(
            135deg,
            #7669f3,
            #5b4ee8
        );

    box-shadow:
        0 7px 18px rgba(92, 80, 230, .20);
}


/* =========================================================
   شاشات الكمبيوتر الكبيرة
   ========================================================= */

@media (min-width: 800px) {

    .container {

        padding-top: 28px;

    }

    .word-card {

        padding: 24px;

    }

    .image-container {

        height: 285px;

    }

    .english-word {

        font-size: 42px;

    }

}


/* =========================================================
   الجوال
   مهم: نخلي كل الصفحة أقرب ما يمكن لشاشة واحدة
   ========================================================= */

@media (max-width: 600px) {

    body {

        min-height: 100vh;

        overflow-x: hidden;

    }


    .topbar {

        height: 62px;

        padding: 8px 12px;

    }


    .title {

        font-size: 16px;

    }


    .back-btn {

        min-height: 39px;

        padding: 0 12px;

        border-radius: 12px;

        font-size: 12px;

    }


    .home-btn {

        width: 39px;

        height: 39px;

        border-radius: 12px;

        font-size: 17px;

    }


    .container {

        max-width: 500px;

        padding:

            10px

            11px

            14px;

    }


    .progress-area {

        padding: 10px 13px;

        margin-bottom: 9px;

        border-radius: 15px;

    }


    .progress-info {

        margin-bottom: 6px;

        font-size: 11px;

    }


    .progress-info strong {

        font-size: 12px;

    }


    .progress-bar {

        height: 7px;

    }


    .word-card {

        padding: 11px;

        border-radius: 21px;

    }


    .image-container {

        height: 150px;

        border-radius: 16px;

        margin-bottom: 9px;

    }


    .word-image {

        font-size: 65px;

    }


    .english-word {

        font-size: 28px;

        margin-bottom: 3px;

    }


    .arabic-word {

        font-size: 17px;

        margin-bottom: 7px;

    }


    .sound-btn {

        padding: 8px 15px;

        border-radius: 12px;

        font-size: 12px;

    }


    .example {

        margin-top: 9px;

        padding: 9px 11px;

        border-radius: 14px;

    }


    .example > span {

        font-size: 11px;

        margin-bottom: 4px;

    }


    .example p {

        font-size: 12px;

        margin-bottom: 2px;

    }


    .example small {

        font-size: 10px;

    }


    .example-sound-buttons {

        margin-top: 7px;

        gap: 6px;

    }


    .example-sound-btn {

        min-height: 31px;

        border-radius: 9px;

        font-size: 10px;

    }


    .knowledge-buttons {

        gap: 7px;

        margin-top: 8px;

    }


    .knowledge-buttons button {

        min-height: 43px;

        border-radius: 13px;

        font-size: 12px;

    }


    .actions {

        grid-template-columns: 72px 1fr;

        gap: 7px;

        margin-top: 7px;

    }


    .actions button {

        min-height: 43px;

        border-radius: 13px;

        font-size: 12px;

    }


    #favoriteBtn {

        font-size: 18px;

    }


    #favoriteBtn span {

        font-size: 8px;

    }

}


/* =========================================================
   الجوالات الصغيرة جدًا
   ========================================================= */

@media (max-width: 380px) {

    .container {

        padding-left: 8px;

        padding-right: 8px;

    }


    .topbar {

        padding-left: 8px;

        padding-right: 8px;

    }


    .image-container {

        height: 132px;

    }


    .english-word {

        font-size: 25px;

    }


    .arabic-word {

        font-size: 15px;

    }


    .example {

        padding: 7px 9px;

    }


    .example-sound-btn {

        font-size: 9px;

    }


    .knowledge-buttons button {

        min-height: 40px;

    }


    .actions button {

        min-height: 40px;

    }

}


/* =========================================================
   منع تحديد النص بالضغط المطول على الأزرار
   ========================================================= */

button {

    user-select: none;

}


/* =========================================================
   تحسين الصور
   ========================================================= */

img {

    max-width: 100%;

}


/* =========================================================
   إذا كانت الشاشة قصيرة جدًا
   نقلل الارتفاعات أكثر
   ========================================================= */

@media (max-width: 600px) and (max-height: 700px) {

    .image-container {

        height: 125px;

    }


    .word-card {

        padding: 9px;

    }


    .example {

        margin-top: 7px;

        padding: 7px 9px;

    }


    .knowledge-buttons {

        margin-top: 6px;

    }


    .actions {

        margin-top: 6px;

    }

}


/* =========================================================
   شاشة جوال قصيرة جدًا
   ========================================================= */

@media (max-width: 600px) and (max-height: 620px) {

    .topbar {

        height: 56px;

    }


    .container {

        padding-top: 7px;

    }


    .progress-area {

        padding: 7px 10px;

        margin-bottom: 6px;

    }


    .image-container {

        height: 105px;

        margin-bottom: 6px;

    }


    .english-word {

        font-size: 23px;

    }


    .arabic-word {

        font-size: 14px;

        margin-bottom: 5px;

    }


    .sound-btn {

        padding: 6px 12px;

    }


    .example {

        margin-top: 6px;

        padding: 6px 8px;

    }


    .example-sound-buttons {

        margin-top: 5px;

    }


    .example-sound-btn {

        min-height: 27px;

    }


    .knowledge-buttons button {

        min-height: 37px;

    }


    .actions button {

        min-height: 37px;

    }

}/* ==========================================
   زر إظهار الترجمة
========================================== */

.translation-btn {

    display: block;

    margin: 12px auto 18px;

    padding: 10px 18px;

    border: 1px solid #dfe3eb;

    border-radius: 12px;

    background: #f7f8fb;

    color: #333;

    font-size: 15px;

    font-family: inherit;

    cursor: pointer;

    transition: 0.2s ease;

}


.translation-btn:hover {

    background: #eef1f7;

    transform: translateY(-1px);

}


.translation-btn:active {

    transform: scale(0.98);

}


/* الترجمة */

.arabic-word {

    margin-top: 5px;

    margin-bottom: 8px;

}

/* =========================================================
   الإعلان أعلى بطاقة التعلّم
   ========================================================= */

.learning-ad-area {
    width: min(100%, 680px);
    margin: 0 auto 16px;
    padding: 12px 14px 10px;
    border: 1px solid #e4e2f2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(65, 54, 130, 0.08);
    text-align: center;
}

.learning-ad-area[hidden] {
    display: none !important;
}

.learning-ad-area.show {
    animation: adSlideDown 0.24s ease-out;
}

.ad-label {
    margin-bottom: 7px;
    color: #8a8a98;
    font-size: 12px;
}

.learning-ad-container {
    display: flex;
    width: 300px;
    height: 250px;
    max-width: 100%;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-wait-message {
    margin-top: 8px;
    color: #777;
    font-size: 13px;
}

@keyframes adSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .learning-ad-area {
        margin-bottom: 10px;
        padding-inline: 8px;
        border-radius: 15px;
    }
}
