/* 
 * نظام الألوان: Flutter UI Theme (Dark Slate & Violet)
 * مستوحى من الصورة المرفقة
 */
:root {
    /* الخلفيات */
    --bg-main: #060913;
    /* Deeper cosmic space color */
    --bg-card: rgba(16, 20, 30, 0.6);
    /* Glassmorphism card */
    --bg-card-hover: rgba(25, 30, 45, 0.8);

    /* الألوان الأساسية */
    --primary-blue: #00D4FF;
    /* Neon Cyan */
    --primary-dark: #0099CC;
    --accent-violet: #A855F7;
    /* Neon Purple */
    --accent-pink: #FF3366;
    /* Neon Pink */
    --success: #00FFAA;
    /* Neon Green */

    /* النصوص */
    --text-primary: #F8FAFC;
    --text-secondary: #A0ABC0;

    /* التأثيرات */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.4);

    --font-main: 'Tajawal', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* مؤشر مخصص للكمبيوتر */
}

/* إرجاع المؤشر الافتراضي للموبايل لتجنب مشاكل اللمس */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* خلفية ضبابية متدرجة */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 212, 255, 0.15), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15), transparent 40%);
    z-index: -2;
    pointer-events: none;
}

/* 
 * Custom Cursor (For Desktop) 
 */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.1s;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    box-shadow: 0 0 10px var(--primary-blue);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-violet);
    transition: all 0.15s ease-out;
}

body:hover .cursor-outline.hovered {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-blue);
    backdrop-filter: blur(2px);
}

/* 
 * Hero Section 
 */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8% 50px;
    overflow: hidden;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    pointer-events: none;
}

.hero-content>* {
    pointer-events: auto;
}

.tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary-blue);
    border-radius: 50px;
    /* Flutter Pill Shape */
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h1 {
    font-size: clamp(40px, 6vw, 72px);
    /* Responsive Font Size */
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -1px;
}

h1 span {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.description {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
}

/* زر نيون مضيئ متوافق مع المرفق */
.btn-primary {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(5px);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
    color: #fff;
}

/* زر ثانوي نيون متوهج */
.btn-secondary {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-violet);
    border: 1px solid var(--accent-violet);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5);
    color: #fff;
}

/* 
 * Section Layout 
 */
.section-container {
    padding: 80px 8%;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: clamp(24px, 4vw, 36px);
    color: #fff;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 
 * Subjects Grid (Flutter Card Style)
 */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* شريط لمعان زجاجي */
.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.subject-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-blue);
}

.subject-card.lang:hover {
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
    border-color: var(--accent-pink);
}

.subject-card.sci:hover {
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
    border-color: var(--success);
}

.subject-card.tech:hover {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    border-color: var(--accent-violet);
}

.subject-icon {
    width: 56px;
    height: 56px;
    background: rgba(30, 41, 59, 0.5);
    /* Darker inside */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--primary-blue);
    transition: 0.3s;
}

.subject-card.lang .subject-icon {
    color: var(--accent-pink);
    border-color: rgba(236, 72, 153, 0.2);
}

.subject-card.sci .subject-icon {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.subject-card.tech .subject-icon {
    color: var(--accent-violet);
    border-color: rgba(139, 92, 246, 0.2);
}

.subject-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.subject-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.subject-list {
    list-style: none;
    width: 100%;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.subject-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.subject-list li:hover {
    color: var(--primary-blue);
    padding-right: 5px;
    /* Slide effect */
}

/* 
 * Courses Grid 
 */
.courses-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Course Filter Tabs */
.filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-violet));
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

#courseSearch:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: var(--shadow-soft);
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-violet);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.3);
}

.course-img {
    width: 100%;
    height: 200px;
    background: #334155;
    position: relative;
}

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

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

.course-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.course-body {
    padding: 24px;
}

.course-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    line-height: 1.4;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.price {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 18px;
}

/* 
 * Floating WhatsApp Button 
 */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* في العربية نضعه يساراً ليكون بعيداً عن زر القائمة */
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.6);
}

/* 
 * Floating Menu Button (Existing) 
 */
.floating-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    /* يمين */
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: var(--shadow-soft);
    color: var(--text-primary);
    transition: 0.3s;
    text-decoration: none;
}

.floating-menu:hover {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero {
        padding: 100px 5% 50px;
        justify-content: center;
        text-align: center;
    }

    .hero-content {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .btn-group {
        justify-content: center;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    /* Adjust floating buttons for mobile */
    .whatsapp-float {
        left: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .floating-menu {
        right: 20px;
        bottom: 20px;
    }
}
