/*courses.css*/

/* --- بداية النمط المشترك 1: تعريف المتغيرات الجذرية (Root Variables) --- */
:root {
    --primary-color: #0c4366; 
    --secondary-color: #00a896; 
    --light-blue: #e0f2f7; 
    --text-color: #333; 
    --bg-color: #f7f9fc; 
    --shadow-light: 0 3px 6px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15), 0 6px 6px rgba(0, 0, 0, 0.1);
}
/* --- نهاية النمط المشترك 1: تعريف المتغيرات الجذرية (Root Variables) --- */

/* --- بداية النمط المشترك 2: التنسيق الأساسي لـ Body و HTML --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif; 
    color: var(--text-color); 
    scroll-behavior: smooth;
    background: linear-gradient(120deg, #f7f9fc, #e0f7fa, #dff6ff); 
    overflow-x: hidden; 
}
/* --- نهاية النمط المشترك 2: التنسيق الأساسي لـ Body و HTML --- */

.courses-page {
    padding: 20px;
}

/* --- بداية النمط المشترك 3: تنسيق الحاوية الرئيسية (Container) --- */
.container {
    max-width: 1100px; 
    margin: auto;
    padding: 20px;
    text-align: center;
}
/* --- نهاية النمط المشترك 3: تنسيق الحاوية الرئيسية (Container) --- */

/* --- بداية النمط المشترك 5: تنسيق عناوين الأقسام (Section Titles) - H1 --- */
h1 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary-color); 
    margin-bottom: 20px;
    position: relative;
}
h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}
/* --- نهاية النمط المشترك 5: تنسيق عناوين الأقسام (Section Titles) - H1 --- */

.search-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* --- بداية النمط المشترك 6: تنسيق عناصر الإدخال (Form Inputs) --- */
.search-container input {
    width: 300px;
    padding: 10px 15px;
    border: 1px solid #ccc; 
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
}
.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(12, 67, 102, 0.5); 
}
/* --- نهاية النمط المشترك 6: تنسيق عناصر الإدخال (Form Inputs) --- */

.search-container button {
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.search-container button:hover {
    background-color: #007969;
    transform: translateY(-2px);
}
.home-button {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 30px;
    background-color: var(--light-blue);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
}
.home-button:hover {
    background-color: #c7e5f0;
    transform: translateY(-2px);
}
section {
    background: #fff; 
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    margin-bottom: 30px;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #f0f4f8;
    padding: 15px 20px;
    border-radius: 10px; 
    margin-bottom: 10px;
    transition: background-color 0.3s, transform 0.3s;
}
.section-title:hover {
    background-color: #e0eaf3;
    transform: translateY(-2px);
}

/* --- بداية النمط المشترك 5: تنسيق عناوين الأقسام (Section Titles) - H2 --- */
.section-title h2 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color); 
}
/* --- نهاية النمط المشترك 5: تنسيق عناوين الأقسام (Section Titles) - H2 --- */

.section-title i {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.3s;
}
.section-title.active i {
    transform: rotate(180deg);
}
.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out, opacity 0.5s ease;
    opacity: 0;
}
.course-grid.active {
    max-height: 2000px;
    padding: 10px;
    opacity: 1;
}

/* ---------------------------------------------------------------- */
/* التنسيق المعدل لزر الدورة لضمان ظهور النص (تمت إزالة اللون الأبيض من a لتفادي التعارض) */
/* ---------------------------------------------------------------- */

/* التنسيق الأساسي للزر */
.course-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 1em; 
}

/* تنسيق النص داخل الزر (مع الفرض القسري للون والحجم) */
.course-button span {
    color: white !important; 
    font-size: 1em !important; 
    font-weight: 600 !important; 
    opacity: 1 !important; 
    line-height: 1.2;
    margin-top: 5px; 
    /* إعدادات الحل القسري التي أضيفت سابقًا */
    visibility: visible !important; 
    font-family: 'Tajawal', sans-serif !important; 
    max-height: none !important; 
    overflow: visible !important; 
    white-space: normal !important; 
}

.course-button:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.course-button i {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: white;
    transition: transform 0.3s ease;
}
.course-button:hover i {
    transform: scale(1.1);
}
/* ---------------------------------------------------------------- */
/* تحديث أسماء مُعرِّفات الأقسام (ID) لتطابق بيانات Apps Script */
/* ---------------------------------------------------------------- */
#QURN .course-button {
    background: linear-gradient(135deg, #0f9b8e, #0c4366);
}
#LANG .course-button {
    background: linear-gradient(135deg, #74ebd5, #9face6);
}
#PROG .course-button {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}
#CYBR .course-button { /* كان سابقاً #cybersecurity-it */
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}
#MGMT .course-button { /* كان سابقاً #management-leadership */
    background: linear-gradient(135deg, #f5d020, #f83600);
}
#ENTR .course-button { /* كان سابقاً #entrepreneurship-project-management */
    background: linear-gradient(135deg, #f5d020, #f83600);
}
#MKTG .course-button { /* كان سابقاً #marketing-e-commerce */
    background: linear-gradient(135deg, #f77062, #fe5196);
}
#MEDI .course-button { /* كان سابقاً #visual-audio-media */
    background: linear-gradient(135deg, #ff69b4, #ff1493);
}
#WRIT .course-button { /* كان سابقاً #writing-digital-journalism */
    background: linear-gradient(135deg, #e67e22, #f39c12);
}
#HDEV .course-button { /* كان سابقاً #human-development */
    background: linear-gradient(135deg, #ff6f61, #ffcc33);
}
#EDUC .course-button { /* كان سابقاً #education-training */
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
}
#NGOV .course-button { /* كان سابقاً #civil-society-management */
    background: linear-gradient(135deg, #8e44ad, #b96ee6);
}
#HLTH .course-button { /* كان سابقاً #health-wellness */
    background: linear-gradient(135deg, #1abc9c, #2ecc71);
}
#LIFE .course-button { /* كان سابقاً #crafts-life-skills */
    background: linear-gradient(135deg, #e67e22, #c0392b);
}
/* ---------------------------------------------------------------- */
/* نهاية تحديث أسماء الـ ID */
/* ---------------------------------------------------------------- */


.search-info {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
    height: 20px;
}

/* --- بداية النمط المشترك 8: رسائل الحالة (Status Messages) - رسالة الخطأ --- */
.no-results {
    color: #e74c3c; 
    font-weight: bold;
    text-align: center;
    padding: 20px;
}
/* --- نهاية النمط المشترك 8: رسائل الحالة (Status Messages) - رسالة الخطأ --- */

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    .search-container input, .search-container button {
        width: 100%;
    }
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-title h2 {
        font-size: 1.2rem;
    }
}
