/* إعدادات أساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    direction: rtl;
    text-align: right;
}

/* متغيرات الألوان */
:root {
    --primary-color: #2D1B69;        /* البنفسجي الداكن */
    --secondary-color: #00D4AA;      /* الأخضر المتدرج */
    --primary-dark: #1a0f45;         /* بنفسجي أغمق */
    --primary-light: #4a2c8a;        /* بنفسجي فاتح */
    --primary-very-light: #6b46c1;   /* بنفسجي فاتح جداً */
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;             /* الخلفية الفاتحة الأصلية */
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #00D4AA 0%, #2D1B69 100%);
    --gradient-reverse: linear-gradient(135deg, #2D1B69 0%, #00D4AA 100%);
    --purple-gradient: linear-gradient(135deg, #2D1B69 0%, #4a2c8a 50%, #6b46c1 100%);
}

/* تنسيقات عامة */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(45, 27, 105, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 27, 105, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

/* الهيدر */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 20px rgba(45, 27, 105, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-menu a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* الهامبورغر للجوال */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    transition: 0.3s;
}

/* المحتوى الرئيسي */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* سيكشن البطل */
.hero-section {
    background: var(--gradient);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><polygon fill="rgba(255,255,255,0.1)" points="1000,100 1000,0 0,100"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* سيكشن الخدمات - تم الاحتفاظ بالتخطيط الأصلي */
.services-section {
    padding: 5rem 0;
    background: var(--bg-light); /* الخلفية الفاتحة الأصلية */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color); /* اللون البنفسجي للعنوان */
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* التخطيط الأصلي */
    gap: 2rem;
    margin-bottom: 3rem;
}

.service-card {
    background: white; /* خلفية بيضاء كما في الأصل */
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(45, 27, 105, 0.15); /* ظل بنفسجي خفيف */
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px); /* التأثير الأصلي */
    box-shadow: 0 15px 40px rgba(45, 27, 105, 0.25); /* ظل بنفسجي عند التحويم */
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient);
}

.service-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* سيكشن الباقات */
.packages-section {
    padding: 5rem 0;
    background: var(--white); /* خلفية بيضاء كما في الأصل */
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.package-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(45, 27, 105, 0.15); /* ظل بنفسجي */
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(45, 27, 105, 0.25); /* ظل بنفسجي عند التحويم */
}

.package-card.featured {
    transform: scale(1.05);
    border: 3px solid var(--secondary-color);
}

.package-header {
    background: var(--gradient);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.package-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.package-name-ar {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.package-price {
    font-size: 2.5rem;
    font-weight: 700;
}

.package-currency {
    font-size: 1.2rem;
    vertical-align: top;
}

.package-body {
    padding: 2rem;
}

.package-features {
    list-style: none;
    margin-bottom: 2rem;
}

.package-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-right: 2rem;
}

.package-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.package-features li:last-child {
    border-bottom: none;
}

/* سيكشن العملاء */
.clients-section {
    padding: 5rem 0;
    background: var(--bg-light); /* الخلفية الفاتحة الأصلية */
    overflow: hidden;
}

.clients-section .section-title {
    color: var(--primary-color); /* اللون البنفسجي للعنوان */
}

.clients-slider {
    display: flex;
    animation: slide 20s infinite linear;
    gap: 3rem;
    align-items: center;
}

.client-logo {
    height: 80px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
    filter: grayscale(100%) brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(248deg) brightness(100%) contrast(92%); /* فلتر لجعل الشعارات بنفسجية */
}

.client-logo:hover {
    opacity: 1;
    filter: none; /* إزالة الفلتر عند التحويم لإظهار الشعار الأصلي */
}

@keyframes slide {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* الفوتر */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 3rem 0 1rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: white;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: white;
    color: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* نماذج */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(45, 27, 105, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: white; /* خلفية بيضاء */
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

/* صفحات التسجيل والدخول */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
}

.auth-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(45, 27, 105, 0.2);
    width: 100%;
    max-width: 450px;
}

.auth-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* بوابة العميل */
.client-portal {
    padding: 2rem 0;
}

.portal-header {
    background: var(--gradient);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 15px;
}

.welcome-message {
    font-size: 1.5rem;
    font-weight: 600;
}

.orders-grid {
    display: grid;
    gap: 1.5rem;
}

.order-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(45, 27, 105, 0.1);
    border-right: 5px solid var(--secondary-color);
}

.order-status {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.status-new { background: #e3f2fd; color: #1976d2; }
.status-under_review { background: #fff3e0; color: #f57c00; }
.status-accepted { background: #e8f5e8; color: #388e3c; }
.status-in_progress { background: #f3e5f5; color: #7b1fa2; }
.status-completed { background: #e0f2f1; color: #00796b; }
.status-cancelled { background: #ffebee; color: #d32f2f; }

/* لوحة التحكم الإدارية */
.admin-sidebar {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 250px;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    padding: 2rem 0;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(45, 27, 105, 0.3);
}

.admin-content {
    margin-right: 250px;
    padding: 2rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 1rem 2rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--secondary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(45, 27, 105, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* جداول الإدارة */
.admin-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(45, 27, 105, 0.1);
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-color);
}

.admin-table tr:hover {
    background: rgba(0, 212, 170, 0.05);
}

/* أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

/* نافذة منبثقة للتأكيد */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(45, 27, 105, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
}

/* نافذة تأكيد الطلب */
.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(45, 27, 105, 0.3);
    text-align: center;
    z-index: 2000;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.success-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    animation: checkmark 0.5s ease 0.3s both;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-message {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.success-submessage {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        flex-direction: column;
        gap: 0;
        box-shadow: 0 5px 20px rgba(45, 27, 105, 0.3);
        padding: 1rem 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu a {
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.9);
    }
    
    .nav-menu a:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-buttons {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .package-card.featured {
        transform: none;
    }
    
    .admin-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
    
    .auth-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .package-price {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

/* تحسينات للطباعة */
@media print {
    .header,
    .footer,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .admin-content {
        margin-right: 0;
    }
}

/* تحسينات الوصولية */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تأثيرات تحميل */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}