/* =========================================
   الإعدادات العامة
   ========================================= */

* {
    box-sizing: border-box;
}


body {

    margin: 0;

    min-height: 100vh;

    font-family: Arial, "Segoe UI", sans-serif;

    background: linear-gradient(
        135deg,
        #f4eee6,
        #ffffff
    );

    color: #2d241d;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 25px;
}


/* =========================================
   الحاوية الرئيسية
   ========================================= */

.container {

    width: 100%;

    max-width: 720px;

    background: white;

    border-radius: 22px;

    padding: 45px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.12);
}


/* =========================================
   اسم الأكاديمية
   ========================================= */

.logo {

    text-align: center;

    font-weight: bold;

    letter-spacing: 3px;

    font-size: 14px;

    color: #6b523b;
}


/* =========================================
   العنوان الرئيسي
   ========================================= */

h1 {

    text-align: center;

    margin: 12px 0 8px;

    font-size: 36px;
}


/* =========================================
   الوصف
   ========================================= */

.subtitle {

    text-align: center;

    color: #766b62;

    margin-bottom: 30px;
}


/* =========================================
   منطقة البحث
   ========================================= */

.search-area {

    display: flex;

    gap: 10px;

    position: relative;
}


/* =========================================
   مربع البحث
   ========================================= */

input {

    flex: 1;

    min-width: 0;

    padding: 16px;

    border: 1px solid #d9cec2;

    border-radius: 12px;

    font-size: 16px;

    outline: none;

    background: #ffffff;

    color: #2d241d;
}


/* عند الضغط على مربع البحث */

input:focus {

    border-color: #8b6b4a;

    box-shadow:
        0 0 0 3px rgba(
            139,
            107,
            74,
            0.10
        );
}


/* النص داخل مربع البحث */

input::placeholder {

    color: #a39a92;
}


/* =========================================
   زر البحث
   ========================================= */

button {

    border: none;

    border-radius: 12px;

    padding: 0 25px;

    background: #5a4634;

    color: white;

    font-size: 16px;

    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}


/* عند مرور الماوس */

button:hover {

    background: #463628;
}


/* عند الضغط */

button:active {

    transform: scale(0.98);
}


/* =========================================
   قائمة اقتراحات الأسماء
   ========================================= */

.suggestions {

    position: absolute;

    top: calc(100% + 5px);

    left: 0;

    right: 110px;

    background: white;

    border: 1px solid #ddd2c7;

    border-radius: 10px;

    box-shadow:
        0 8px 20px rgba(
            0,
            0,
            0,
            0.12
        );

    overflow: hidden;

    z-index: 1000;

    display: none;
}


/* =========================================
   كل اسم داخل الاقتراحات
   ========================================= */

.suggestion-item {

    padding: 12px 15px;

    cursor: pointer;

    font-size: 15px;

    color: #3b3028;

    border-bottom:
        1px solid #eee7e0;

    background: white;

    transition:
        background 0.15s ease;
}


/* إزالة الخط من آخر اسم */

.suggestion-item:last-child {

    border-bottom: none;
}


/* عند مرور الماوس على الاسم */

.suggestion-item:hover {

    background: #f5eee7;

}


/* =========================================
   الرسالة
   ========================================= */

#message {

    margin-top: 20px;

    color: #6d6259;

    font-size: 15px;
}


/* =========================================
   نتيجة الشهادة
   ========================================= */

.result {

    margin-top: 15px;

    padding: 20px;

    border: 1px solid #e5ddd5;

    border-radius: 15px;

    background: #fcfaf8;

    box-shadow:
        0 4px 12px rgba(
            0,
            0,
            0,
            0.04
        );
}


/* =========================================
   اسم صاحب الشهادة
   ========================================= */

.result-name {

    font-size: 18px;

    font-weight: bold;

    margin-bottom: 15px;

    color: #2d241d;
}


/* =========================================
   أزرار الشهادة
   ========================================= */

.actions {

    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}


/* =========================================
   الأزرار العامة
   ========================================= */

.action {

    display: inline-block;

    padding: 12px 18px;

    border-radius: 10px;

    text-decoration: none;

    font-weight: bold;

    color: white;

    background: #5a4634;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}


/* =========================================
   زر عرض الشهادة
   ========================================= */

.action.view {

    background: #8b6b4a;
}


/* عند مرور الماوس */

.action:hover {

    background: #463628;

}


/* زر العرض */

.action.view:hover {

    background: #705437;

}


/* عند الضغط */

.action:active {

    transform: scale(0.98);
}


/* =========================================
   رسالة عدم وجود شهادة
   ========================================= */

.empty {

    text-align: center;

    margin-top: 25px;

    padding: 20px;

    color: #766b62;

    background: #faf7f3;

    border-radius: 12px;
}


/* =========================================
   عدد الشهادات
   ========================================= */

.count {

    text-align: center;

    color: #9a8d82;

    font-size: 13px;

    margin-top: 20px;
}


/* =========================================
   تصميم الهاتف
   ========================================= */

@media (max-width: 600px) {

    body {

        padding: 15px;

    }


    .container {

        padding: 25px;

        border-radius: 18px;

    }


    h1 {

        font-size: 29px;

    }


    .subtitle {

        font-size: 14px;

        line-height: 1.5;

    }


    .search-area {

        flex-direction: column;

    }


    input {

        width: 100%;

    }


    button {

        width: 100%;

        height: 50px;

    }


    /* قائمة الاقتراحات في الهاتف */

    .suggestions {

        left: 0;

        right: 0;

        top: calc(100% + 5px);

    }


    .suggestion-item {

        padding: 14px;

        font-size: 14px;

    }


    .actions {

        flex-direction: column;

    }


    .action {

        width: 100%;

        text-align: center;

    }

}