:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --success-color: #4ade80;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --gray-color: #6b7280;
    
    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    /* --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); */
    --gradient-accent: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-sm: 8px;
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== شريط التنقل العصري ===== */
.navbar {
       background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    transition: var(--transition);
    z-index: 1000;
}

.navbar.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: var(--shadow-lg);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.8rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-right: 2.5rem;
    transition: var(--transition);
}

.navbar-brand::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: var(--gradient-primary);
    border-radius: 10px;
    z-index: -1;
}

.navbar-brand i {
    margin-left: 0.5rem;
    font-size: 1.6rem;
}

.nav-item {
    margin: 0 0.3rem;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-link i {
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover i {
    transform: scale(1.2);
}

.dropdown-menu {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    color: #fff;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.2rem 0;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gradient-primary);
    transform: translateX(-5px);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--gradient-primary);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

/* ===== الهيدر المتحرك (سلايدر) - التعديل الاحترافي ===== */
.hero-section {
    margin-top: -100px;
    position: relative;
    padding-top: 2rem;
}

.main-slider {
    height: 70vh;
    min-height: 450px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 0 auto;
    max-width: 1200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.swiper-slide {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* الحل الاحترافي: حاوية تحتوي على الصورة مع خلفية داكنة */
.slide-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.slide-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(26, 26, 46, 0.85) 0%,
        rgba(26, 26, 46, 0.6) 50%,
        rgba(26, 26, 46, 0.3) 100%
    );
    z-index: 2;
}

.slide-bg-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* هذه الخاصية تمنع قص الصورة */
    object-position: center;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    opacity: 0.9;
}

.swiper-slide-active .slide-bg-image {
    opacity: 1;
    transform: scale(1.02);
}

/* السلايدات الافتراضية */
.default-slide-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.default-slide-2 {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.default-slide-3 {
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
}

.slide-content .container {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
}

.slide-content h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #a8c6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards 0.3s;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.slide-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards 0.5s;
    line-height: 1.6;
    font-weight: 500;
}

.swiper-button-next,
.swiper-button-prev {
    width: 50px;
    height: 50px;
    background: rgba(115, 112, 244, 0.58);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    opacity: 0.7;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--gradient-primary);
    transform: scale(1.1);
    border-color: transparent;
    opacity: 1;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 1.2rem;
    color: white;
    font-weight: bold;
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transition: var(--transition);
}

.swiper-pagination-bullet-active {
    background: var(--gradient-primary);
    transform: scale(1.3);
}

/* علامة مميزة للصورة */
.slide-badge {
    position: absolute;
    top: 20px;
    background: var(--gradient-accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 4;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
    animation: float 3s ease-in-out infinite;
}

/* ===== أزرار التحسين ===== */
.btn {
    border: none;
    border-radius: 20px;
    padding: 0.8rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    filter: brightness(0.8);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #4361ee;
    color: #4361ee;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.btn-success {
    background: var(--gradient-accent);
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
}

/* ===== بطاقات الشروحات ===== */
.tutorial-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: none;
    height: 100%;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.tutorial-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.tutorial-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.tutorial-card:hover::before {
    opacity: 0.05;
}

.tutorial-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.tutorial-card:hover .card-img-top {
    transform: scale(1.05);
}

.tutorial-card .badge {
    background: var(--gradient-primary);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    z-index: 2;
}

.tutorial-card .card-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.tutorial-card:hover .card-title {
    color: var(--primary-color);
}

.tutorial-card .card-text {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== بطاقات التطبيقات ===== */
.app-card {
    background: white;
    border-radius: var(--border-radius);
    border: none;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.app-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.app-card:hover::before {
    opacity: 0.05;
}

.app-card i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    padding: 0.5rem;
}

.app-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.app-card .card-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.app-card .badge {
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    border-radius: 6px;
}

.app-card .btn-success {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

/* ===== عناوين الأقسام ===== */
.section-title {
    font-weight: 800;
    font-size: 2rem;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section-title i {
    font-size: 1.8rem;
    margin-left: 0.5rem;
}

/* ===== الفوتر ===== */
footer {
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
}

footer h5 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--gradient-primary);
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding-right: 1.5rem;
}

footer ul li a::before {
    content: '›';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
}

footer ul li a:hover {
    color: white;
    padding-right: 2rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-left: 0.5rem;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--gradient-primary);
    transform: translateY(-3px);
}

/* ===== تأثيرات متحركة ===== */
@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== تحسينات التجاوب ===== */
@media (max-width: 992px) {
    .main-slider {
        height: 55vh;
        min-height: 400px;
    }
    
    .slide-content h1 {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .main-slider {
        height: 50vh;
        min-height: 350px;
    }
    
    .slide-content h1 {
        font-size: 1.8rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .main-slider {
        height: 45vh;
        min-height: 300px;
        border-radius: 10px;
    }
    
    .slide-content h1 {
        font-size: 1.5rem;
    }
    
    .slide-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.8rem;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ===== تأثيرات خاصة ===== */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.glow-effect {
    position: relative;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.4);
    opacity: 0;
    transition: var(--transition);
    border-radius: inherit;
}

.glow-effect:hover::after {
    opacity: 1;
}

/* ===== أقسام إضافية ===== */
.stats-section {
    color: #3027af00;
    padding: 3rem 0;
    margin: 3rem 0;
    border-radius: var(--border-radius);
}

/* الهيدر النصي */
.stats-header {
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.platform-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.platform-description {
    font-size: 1.05rem;
    line-height: 1.9;
    opacity: 0.9;
}

/* زر التحميل */
.download-wrapper {
    margin-top: 1.5rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #6a5cff, #8f7bff);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* الإحصائيات */
.stat-item {
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a8c6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.feature-section {
    padding: 4rem 0;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: var(--transition);
    border: 1px solid #eaeaea;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* ===== نظام الدردشة المباشرة ===== */
.chat-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

.chat-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient-accent);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(247, 37, 133, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(247, 37, 133, 0.6);
}

.chat-toggle.active {
    background: var(--gradient-primary);
    transform: rotate(45deg);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.chat-container {
    position: absolute;
    bottom: 90px;
    left: 0;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.chat-container.with-saved {
    width: 730px;
}

.chat-container.with-saved .chat-body {
    width: calc(100% - 350px);
}

.chat-container.active {
    display: flex;
}

.chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.chat-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
}

.chat-status {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    margin-left: 8px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* زر تاريخ المحادثات في الهيدر */
.chat-history-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 1;
}

.chat-history-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.history-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== قسم المحادثات المحفوظة ===== */
.saved-conversations {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: white;
    border-right: 1px solid #e0e0e0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.saved-conversations.active {
    transform: translateX(0);
}

.saved-header {
    padding: 1.2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

.saved-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.saved-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.saved-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

.saved-item {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.3s ease forwards;
    opacity: 0;
}

.saved-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.saved-item.active {
    border-right: 4px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05) 0%, rgba(67, 97, 238, 0.02) 100%);
}

.saved-item.closed {
    border-right: 4px solid #ff4757;
    opacity: 0.8;
}

.saved-item.closed::after {
    content: 'مغلقة';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4757;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.saved-item-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-item-title .message-count {
    background: var(--gradient-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.saved-item-preview {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
}

.saved-item-date {
    direction: ltr;
    text-align: left;
}

.saved-item-status {
    font-weight: 600;
}

.saved-item-status.active {
    color: #00b894;
}

.saved-item-status.closed {
    color: #ff4757;
}

.saved-item-status.saved {
    color: var(--primary-color);
}

.saved-actions {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.btn-save-chat {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save-chat:hover {
    background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-save-chat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.support {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message.bot {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6e9ff 100%);
    border: 1px solid #d0d5ff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.message.support .message-time,
.message.bot .message-time {
    text-align: left;
}

/* إضافة اسم المرسل للدعم الفني */
.message.support .sender-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 3px;
    font-size: 0.85rem;
}

.message.bot .sender-name {
    font-weight: bold;
    color: #f72585;
    margin-bottom: 3px;
    font-size: 0.85rem;
}

.chat-footer {
    padding: 1.2rem;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chat-form {
    display: flex;
    gap: 0.8rem;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 0.8rem 1.2rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.chat-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-send:hover {
    background: var(--gradient-accent);
    transform: scale(1.05);
}

.chat-login {
    padding: 2rem;
    text-align: center;
}

.chat-login h6 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 700;
}

.chat-login input {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    text-align: center;
}

.chat-login input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-start-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.chat-start-btn:hover {
    background: var(--gradient-accent);
    transform: translateY(-2px);
}

.chat-notice {
    font-size: 0.8rem;
    color: #666;
    margin-top: 1rem;
}

/* ===== نظام عداد الزوار الاحترافي - تصميم عرضي نحيف ===== */
.visitor-counter {
    width: 100%;
    background: linear-gradient(90deg, rgba(175,17,169,0.1) 0%, rgba(175,17,169,0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    color: #af11a9cf;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    border: 1px solid rgba(178, 97, 97, 0.2);
    margin: 0 auto;
}

.visitor-counter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgb(22 130 110 / 71%) 0%, rgb(5 8 6 / 35%) 50%);
    pointer-events: none;
}

.counter-header {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding-left: 1rem;
}

.counter-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-shadow: 0 0 5px rgba(175,17,169,0.5);
}

.counter-header h3 i {
    font-size: 1.2rem;
    color: #ffd700;
}

.counter-stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-content: space-between;
}

.counter-item {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    border-radius: 40px;
    padding: 0.3rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    border: 1px solid rgba(178, 97, 97, 0.25);
    min-width: 130px;
}

.counter-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(175,17,169,0.5);
    box-shadow: 0 5px 15px rgba(175,17,169,0.2);
}

.counter-icon {
    font-size: 1rem;
    margin-bottom: 0;
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(175,17,169,0.2);
    color: #fff;
}

.counter-number {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0;
    background: linear-gradient(135deg, #d10000 0%, #e3d5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.counter-label {
    font-size: 0.8rem;
    opacity: 0.9;
    color: #080808;
    margin-right: auto;
}

.counter-trend {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    margin-left: 0.3rem;
}

.trend-up {
    color: #00ff88;
}

.trend-down {
    color: #ff4757;
}

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .visitor-counter {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 30px;
    }
    
    .counter-header {
        justify-content: center;
        padding-left: 0;
        margin-bottom: 0.8rem;
    }
    
    .counter-stats {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .counter-item {
        min-width: calc(50% - 0.4rem);
        flex: 1 1 auto;
    }
}

@media (max-width: 480px) {
    .counter-item {
        min-width: 100%;
    }
}
/* ===== تحسينات الدردشة للموبايل ===== */
@media (max-width: 768px) {
    .chat-container {
        width: 320px;
        height: 500px;
        left: -10px;
    }
    
    .chat-container.with-saved {
        width: 100%;
        left: 0;
        height: 100vh;
        border-radius: 0;
    }
    
    .saved-conversations {
        width: 100%;
        position: fixed;
    }
    
    .chat-container.with-saved .chat-body {
        width: 100%;
    }
    
    .chat-toggle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .chat-widget {
        bottom: 20px;
        left: 20px;
    }
    
    .chat-history-btn {
        left: 10px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .counter-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .counter-number {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .chat-container {
        width: 280px;
        height: 450px;
        left: -20px;
    }
    
    .counter-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== الأسئلة الشائعة ===== */
.faq-questions {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    max-height: 200px;
    overflow-y: auto;
}

.faq-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.8rem;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}

.faq-item:hover {
    background: #e9ecef;
    transform: translateX(-5px);
}

.faq-item i {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

/* زر طلب الدعم الفني */
.request-human-btn {
    display: block;
    width: 100%;
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.request-human-btn:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.request-human-btn i {
    margin-left: 0.5rem;
}

.chat-controls {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-question {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.quick-question:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
}

/* رسائل التنبيه */
.alert {
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ===== قسم المساعدة المتقدم ===== */
.help-section {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.help-back-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-back-btn:hover {
    background: var(--gradient-accent);
    transform: translateX(-3px);
}

.help-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    text-align: center;
    flex-grow: 1;
}

.help-categories {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.help-category {
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.help-category-header {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.help-category-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.help-category-header.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.help-category-header.active .help-category-icon {
    color: white;
    transform: rotate(180deg);
}

.help-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.help-category-icon {
    color: var(--primary-color);
    transition: var(--transition);
    font-size: 0.9rem;
}

.help-subcategories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
}

.help-subcategories.active {
    max-height: 500px;
}

.help-subcategory {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-subcategory:hover {
    background: white;
    padding-right: 1.5rem;
    border-right: 3px solid var(--primary-color);
}

.help-subcategory:last-child {
    border-bottom: none;
}

.help-subcategory-title {
    font-size: 0.9rem;
    color: #555;
}

.help-subcategory-icon {
    color: #999;
    font-size: 0.8rem;
}

.help-problems {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.help-problems.active {
    max-height: 300px;
}

.help-problem {
    padding: 0.6rem 1rem 0.6rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    color: #666;
}

.help-problem:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    padding-right: 1.5rem;
}

.help-problem:last-child {
    border-bottom: none;
}

.help-problem i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

/* ===== زر أحتاج مساعدة المخصص ===== */
.need-help-btn {
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
}

.need-help-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.4);
    background: linear-gradient(135deg, #b5179e 0%, #f72585 100%);
}