:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --secondary: #0f172a;
    --text-main: #1e293b;
    --text-sec: #64748b;
    --bg-light: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.7;
    scroll-behavior: smooth;
}

h1, h2, h3 { font-family: 'Cairo', sans-serif; }

/* =========================================
    الخلفية الديناميكية
========================================= */
.bg-orbs { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; overflow: hidden; z-index: -1; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: floatOrb 10s infinite alternate ease-in-out; }
.orb-1 { top: -10%; right: -5%; width: 50vw; height: 500px; background: rgba(79, 70, 229, 0.3); }
.orb-2 { bottom: 10%; left: -10%; width: 40vw; height: 400px; background: rgba(168, 85, 247, 0.2); animation-delay: -5s; }
@keyframes floatOrb { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 50px) scale(1.1); } }

/* =========================================
    النافبار
========================================= */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; background: var(--glass-bg); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); position: fixed; width: 100%; top: 0;
    z-index: 1000; border-bottom: 1px solid var(--glass-border); transition: all 0.3s;
}
.navbar.scrolled { padding: 10px 5%; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

.logo img { height: 45px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: block;}
.logo:hover img { transform: scale(1.05) rotate(-5deg); }

.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 1.1rem; transition: 0.3s; position: relative; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 3px; background: var(--primary); bottom: -5px; right: 0; transition: 0.3s; border-radius: 5px; }
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

/* =========================================
    الهيرو (Hero)
========================================= */
.hero { position: relative; padding: 160px 5% 80px; display: flex; align-items: center; justify-content: space-between; min-height: 100vh; gap: 50px; }
.hero-text { flex: 1.1; max-width: 650px; animation: fadeInUp 1s forwards cubic-bezier(0.16, 1, 0.3, 1); }
.hero-text h1 { font-size: 4rem; font-weight: 900; line-height: 1.2; color: var(--secondary); margin-bottom: 25px; }
.hero-text h1 span { background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-text p { font-size: 1.25rem; color: var(--text-sec); margin-bottom: 40px; font-weight: 500; line-height: 1.8; }

.chrome-btn-wrapper { position: relative; display: inline-block; transition: 0.3s; z-index: 2;}
.chrome-btn-wrapper::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), #8b5cf6); border-radius: 16px; filter: blur(15px); opacity: 0.6; animation: pulseGlow 2s infinite alternate; z-index: -1; }
@keyframes pulseGlow { 0% { transform: scale(0.95); opacity: 0.5; } 100% { transform: scale(1.05); opacity: 0.8; } }

.chrome-btn {
    position: relative; display: inline-flex; align-items: center; gap: 15px;
    background: var(--secondary); color: white; padding: 18px 45px; border-radius: 16px;
    font-family: 'Cairo', sans-serif; font-size: 1.4rem; font-weight: 800; text-decoration: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1), 0 10px 20px rgba(0,0,0,0.2);
}
.chrome-btn::after { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transform: skewX(-20deg); transition: 0.5s; }
.chrome-btn:hover { transform: translateY(-5px) scale(1.02); box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 20px 40px rgba(15, 23, 42, 0.4); background: #000; }
.chrome-btn:hover::after { left: 200%; }
.chrome-btn svg { width: 32px; height: 32px; }

.availability { margin-top: 20px; font-size: 0.95rem; color: var(--text-sec); font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* =========================================
    المحاكي التفاعلي متعدد النوافذ
========================================= */
.hero-interactive { flex: 1; display: flex; justify-content: center; perspective: 1000px; animation: fadeInUp 1.2s forwards cubic-bezier(0.16, 1, 0.3, 1); animation-delay: 0.2s; opacity: 0; z-index: 10; }
.mockup-window {
    background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px;
    width: 100%; max-width: 440px; box-shadow: 0 30px 60px rgba(15, 23, 42, 0.1);
    transform: rotateY(-10deg) rotateX(5deg); transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); overflow: hidden;
}
.mockup-window:hover { transform: rotateY(0) rotateX(0) translateY(-10px); box-shadow: 0 40px 80px rgba(79, 70, 229, 0.2); }
.mockup-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: rgba(255,255,255,0.5); border-bottom: 1px solid rgba(255,255,255,0.4); }
.mockup-dots { display: flex; gap: 8px; }
.mockup-dot { width: 12px; height: 12px; border-radius: 50%; }

.mockup-tabs { display: flex; gap: 5px; background: rgba(0,0,0,0.05); padding: 4px; border-radius: 12px; }
.tab-btn { background: transparent; border: none; padding: 6px 12px; border-radius: 8px; font-family: inherit; font-size: 0.8rem; font-weight: 700; color: var(--text-sec); cursor: pointer; transition: 0.3s; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.mockup-body { padding: 20px; min-height: 320px; position: relative; }
.mockup-content { display: none; animation: fadeIn 0.4s ease forwards; height: 100%; flex-direction: column; justify-content: space-between; }
.mockup-content.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- تصميم جدول المنسق --- */
.grid-schedule { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; background: #e2e8f0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; height: 200px; margin-bottom: 15px;}
.grid-col { display: flex; flex-direction: column; background: white; }
.grid-header { font-size: 0.65rem; text-align: center; background: #f8fafc; padding: 5px 0; border-bottom: 1px solid #e2e8f0; font-weight: 800; color: var(--text-sec);}
.grid-slot { flex: 1; position: relative; padding: 2px; }
.course-block { position: absolute; width: 90%; left: 5%; border-radius: 6px; color: white; font-size: 0.6rem; font-weight: bold; text-align: center; display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.1); line-height: 1.2; padding: 2px;}
.course-block.show { opacity: 1; transform: scale(1); }
.c-blue { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.c-purple { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.c-green { background: linear-gradient(135deg, #10b981, #059669); }
.c-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.c-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); }

.proposals-area { display: flex; gap: 10px; margin-bottom: 15px; }
.prop-btn { flex: 1; padding: 8px; border: 1px solid var(--border-color); background: white; border-radius: 8px; font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s; color: var(--text-main); }
.prop-btn:hover { border-color: var(--primary); background: #eef2ff; }
.prop-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* --- تصميم التقييم --- */
.rating-card { background: white; border-radius: 16px; padding: 20px; text-align: center; border: 1px solid #e2e8f0; position: relative; overflow: hidden; min-height: 220px;}
.avatar { font-size: 3rem; margin-bottom: 5px; }
.prof-name { font-size: 1.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 5px; }
.stars { font-size: 1.5rem; color: #f59e0b; margin-bottom: 10px; }
.badges-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 15px;}
.prof-badge { background: #dcfce7; color: #166534; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; border: 1px solid #86efac; }
.prof-badge.blue { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

.comments-view { position: absolute; inset: 0; background: white; padding: 20px; transform: translateY(100%); transition: 0.3s ease; display: flex; flex-direction: column; text-align: right; z-index: 10;}
.comments-view.open { transform: translateY(0); }
.comment-item { background: var(--bg-light); padding: 10px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; margin-bottom: 8px; border: 1px solid #e2e8f0; }

/* --- تصميم جوجل --- */
.sync-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 20px; background: white; padding: 10px; border-radius: 12px; border: 1px solid #e2e8f0; }
.cal-box { aspect-ratio: 1; background: var(--bg-light); border-radius: 6px; border: 1px dashed #cbd5e1; transition: 0.4s; }
.cal-box.filled { background: var(--primary); border: none; box-shadow: 0 2px 5px rgba(79,70,229,0.3); animation: popIn 0.3s forwards; }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* أزرار الإجراء */
.action-btn { width: 100%; padding: 12px; border: none; border-radius: 12px; font-family: inherit; font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: 0.3s; }
.btn-outline { background: rgba(79, 70, 229, 0.1); color: var(--primary); border: 1px dashed var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; transform: translateY(-2px); }
.btn-solid { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); }
.btn-solid:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);}

/* =========================================
   شبكة المميزات (Bento Grid) مع الـ 3D Tilt
========================================= */
.features { padding: 100px 5%; background: white; position: relative; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 3rem; color: var(--secondary); font-weight: 900; margin-bottom: 15px; }
.section-header p { font-size: 1.2rem; color: var(--text-sec); }
.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; max-width: 1200px; margin: 0 auto; perspective: 1000px; }

.bento-card { 
    background: var(--bg-light); border-radius: 30px; padding: 40px; border: 1px solid #e2e8f0; 
    position: relative; overflow: hidden; z-index: 1; 
    opacity: 0; transform: translateY(40px); /* للأنيميشن عند السكرول */
    
    /* إعدادات تأثير الـ 3D */
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg));
    transition: transform 0.1s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

/* 🔮 تأثير تتبع الماوس المضيء */
.bento-card::before { 
    content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; 
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(79, 70, 229, 0.1), transparent 40%); 
    z-index: -1; opacity: 0; transition: opacity 0.3s; pointer-events: none; 
}

.bento-card:hover { 
    box-shadow: 0 30px 60px rgba(79, 70, 229, 0.15); 
    border-color: #cbd5e1; 
}
.bento-card:hover::before { opacity: 1; }

.bento-card.bento-large { 
    grid-column: span 2; 
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%); 
    border: none; 
}

/* 🎯 إصلاح لون الكرت الداكن */
.bento-card.bento-large h3 { color: #ffffff !important; transform: translateZ(30px); }
.bento-card.bento-large p { color: #cbd5e1 !important; transform: translateZ(20px); }

.bento-icon { 
    width: 70px; height: 70px; background: white; border-radius: 20px; 
    display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 25px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.05); transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
    transform: translateZ(40px); /* يبرز للأمام في تأثير الـ 3D */
}
.bento-card.bento-large .bento-icon { background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); color: white;}
.bento-card:hover .bento-icon { transform: translateZ(50px) scale(1.15) rotate(10deg); }

.bento-card h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 15px; color: var(--secondary); transform: translateZ(30px); }
.bento-card p { font-size: 1.1rem; color: var(--text-sec); line-height: 1.7; transform: translateZ(20px); }

/* =========================================
    الفوتر
========================================= */
.footer { background: var(--bg-light); padding: 50px 5%; text-align: center; border-top: 1px solid #e2e8f0; }
.footer-links { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-sec); text-decoration: none; font-weight: 700; font-size: 1.1rem; transition: 0.2s; }
.footer-links a:hover { color: var(--primary); }

/* --- الأنيميشنات والتجاوب --- */
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0) rotateX(0) rotateY(0); } }
.reveal.active { animation: fadeInUp 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1); }

@media (max-width: 1024px) {
    .hero { flex-direction: column; text-align: center; padding-top: 150px; }
    .hero-text { flex: none; width: 100%; align-items: center; display: flex; flex-direction: column; }
    .hero-text h1 { font-size: 3.5rem; }
    .hero-interactive { width: 100%; margin-top: 40px;}
    .mockup-window { transform: scale(1); }
    .mockup-window:hover { transform: scale(1.02); }
    .bento-card.bento-large { grid-column: span 1; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding-top: 120px; }
    .hero-text h1 { font-size: 2.8rem; }
    .chrome-btn { padding: 15px 30px; font-size: 1.2rem; width: 100%; justify-content: center;}
    .chrome-btn-wrapper { width: 100%; }
    .section-header h2 { font-size: 2.3rem; }
    .bento-card { padding: 30px 20px; transform: none !important; /* إلغاء 3D في الجوال */ }
    .bento-grid { grid-template-columns: 1fr; perspective: none;}
}
