/* ═══════════════════════════════════════
   أدوات الأستاذ — التنسيق الرئيسي
   ═══════════════════════════════════════ */

/* ── إعادة تعيين أساسية ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── الهيدر ── */
#main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Hero Slider ── */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4ff 0%, #f4f7fc 50%, #e6fff9 100%);
}

.hero-slider {
    position: relative;
    min-height: 480px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

.hero-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 16px 0;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c5d3e8;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-dot.active {
    background: #1a3c6e;
    width: 32px;
    border-radius: 5px;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #1a3c6e;
    font-size: 18px;
}

.hero-arrow:hover {
    background: #1a3c6e;
    color: white;
    box-shadow: 0 6px 20px rgba(26, 60, 110, 0.3);
}

.hero-arrow.prev {
    right: 16px;
}

.hero-arrow.next {
    left: 16px;
}

/* Hero Slide Image Mockup */
.hero-mockup {
    position: relative;
    width: 100%;
    max-width: 520px;
}

.hero-mockup-inner {
    background: linear-gradient(145deg, #ffffff, #f0f4f8);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 25px 60px rgba(26, 60, 110, 0.15), 0 0 0 1px rgba(26, 60, 110, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-mockup-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 176, 155, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ── بطاقات الأدوات ── */
.tool-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e8edf5;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to left, #1a3c6e, #00b09b);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(26, 60, 110, 0.12);
    border-color: transparent;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #eef4ff, #e6fff9);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

.tool-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a3c6e;
    margin-bottom: 8px;
    line-height: 1.5;
}

.tool-card-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 16px;
}

.tool-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.tool-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1a3c6e, #244d87);
    color: white;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.tool-card-btn:hover {
    background: linear-gradient(135deg, #00b09b, #009a88);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 176, 155, 0.3);
}

.tool-card-usage {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ── قسم العناوين ── */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-title h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a3c6e;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.section-title h2::before,
.section-title h2::after {
    content: '';
    width: 40px;
    height: 3px;
    background: linear-gradient(to left, #1a3c6e, #00b09b);
    border-radius: 2px;
}

.section-title p {
    color: #6b7280;
    margin-top: 8px;
    font-size: 0.95rem;
}

/* ── الإحصائيات ── */
.stats-section {
    background: linear-gradient(135deg, #1a3c6e 0%, #244d87 50%, #1a3c6e 100%);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.stat-card {
    text-align: center;
    padding: 24px;
    position: relative;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

/* ── التقييمات Slider ── */
.testimonials-slider {
    position: relative;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card {
    min-width: 100%;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .testimonial-card {
        min-width: 50%;
    }
}

@media (min-width: 1024px) {
    .testimonial-card {
        min-width: 25%;
    }
}

.testimonial-inner {
    background: white;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid #e8edf5;
    position: relative;
    height: 100%;
    transition: all 0.3s ease;
}

.testimonial-inner:hover {
    box-shadow: 0 10px 30px rgba(26, 60, 110, 0.08);
}

.testimonial-quote {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 3rem;
    color: #e8edf5;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eef4ff;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1a3c6e, #00b09b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.testimonial-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a3c6e;
    margin-bottom: 2px;
}

.testimonial-job {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 8px;
}

.testimonial-comment {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.8;
}

/* Stars */
.stars-rating {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 12px;
}

.star {
    font-size: 1rem;
}

.star.filled {
    color: #fbbf24;
}

.star.empty {
    color: #d1d5db;
}

/* ── الفيديوهات ── */
.video-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s ease;
    background: white;
    border: 1px solid #e8edf5;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(26, 60, 110, 0.12);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4ff, #e6fff9);
}

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

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

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(26, 60, 110, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.video-card:hover .video-play-btn {
    background: #00b09b;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-info {
    padding: 16px;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a3c6e;
    margin-bottom: 6px;
    line-height: 1.5;
}

.video-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.6;
}

/* ── Video Modal ── */
#video-modal {
    transition: opacity 0.3s ease;
}

#video-modal.active {
    display: flex;
    opacity: 1;
}

/* ── صفحة الأدوات — البحث والفلاتر ── */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e8edf5;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
}

.search-box input:focus {
    outline: none;
    border-color: #1a3c6e;
    box-shadow: 0 0 0 4px rgba(26, 60, 110, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid #e8edf5;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
    background: #1a3c6e;
    color: white;
    border-color: #1a3c6e;
}

/* ── صفحة الأداة الواحدة ── */
.tool-page-header {
    background: linear-gradient(135deg, #eef4ff 0%, #f4f7fc 50%, #e6fff9 100%);
    padding: 32px 0 24px 0;
    margin-bottom: 0;
}

.help-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e8edf5;
    margin-bottom: 24px;
    overflow: hidden;
}

.help-toggle {
    width: 100%;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a3c6e;
}

.help-toggle .arrow {
    transition: transform 0.3s ease;
}

.help-toggle.open .arrow {
    transform: rotate(180deg);
}

.help-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.help-content.open {
    max-height: 500px;
}

/* ── أداة — منطقة العمل ── */
.tool-workspace {
    background: white;
    border-radius: 16px;
    border: 1px solid #e8edf5;
    padding: 32px;
}

/* ── سحب وإفلات الملفات ── */
.file-drop-zone {
    border: 2px dashed #c5d3e8;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafbfe;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #00b09b;
    background: #f0fdf9;
}

.file-drop-zone .icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.file-drop-zone .text {
    font-size: 0.95rem;
    color: #6b7280;
}

.file-drop-zone .hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 8px;
}

/* ── أزرار عامة ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1a3c6e, #244d87);
    color: white;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #122b52, #1a3c6e);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 60, 110, 0.25);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #00b09b, #009a88);
    color: white;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #009a88, #008474);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 176, 155, 0.25);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    background: white;
    color: #1a3c6e;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #1a3c6e;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.btn-outline:hover {
    background: #1a3c6e;
    color: white;
    transform: translateY(-2px);
}

/* ── Spinner ── */
.spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
}

.spinner.active {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── رسائل Flash ── */
.flash-message {
    animation: slideDown 0.4s ease;
}

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

/* ── صفحة التواصل ── */
.contact-form {
    background: white;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid #e8edf5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8edf5;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a3c6e;
    box-shadow: 0 0 0 4px rgba(26, 60, 110, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ── لا توجد نتائج ── */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.no-results .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-slider {
        min-height: 380px;
    }
    
    .hero-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .hero-arrow.prev { right: 8px; }
    .hero-arrow.next { left: 8px; }
    
    .section-title h2 {
        font-size: 1.35rem;
    }
    
    .section-title h2::before,
    .section-title h2::after {
        width: 24px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .tool-workspace {
        padding: 20px;
    }
    
    .file-drop-zone {
        padding: 24px;
    }
}

/* ── الأنيميشن ── */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* تأخير متتالي للبطاقات */
.fade-in-up:nth-child(1) { transition-delay: 0.1s; }
.fade-in-up:nth-child(2) { transition-delay: 0.2s; }
.fade-in-up:nth-child(3) { transition-delay: 0.3s; }
.fade-in-up:nth-child(4) { transition-delay: 0.4s; }
.fade-in-up:nth-child(5) { transition-delay: 0.5s; }
.fade-in-up:nth-child(6) { transition-delay: 0.6s; }

/* ── Scrollbar مخصص ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f4f7fc;
}

::-webkit-scrollbar-thumb {
    background: #c5d3e8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a3c6e;
}

/* ── Selection ── */
::selection {
    background: rgba(0, 176, 155, 0.2);
    color: #1a3c6e;
}
