/* تصميم موقع سوقنا */

/* الخطوط العربية */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

/* المتغيرات */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

/* الإعدادات العامة */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

/* تحسين الروابط */
a {
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: none;
}

/* تحسين الأزرار */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

/* تحسين البطاقات */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

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

/* بطاقات الفئات */
.category-card {
    border: 2px solid transparent;
    transition: var(--transition);
}

.category-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* بطاقات الإعلانات */
.ad-card {
    position: relative;
    overflow: hidden;
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(13, 110, 253, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

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

/* قسم البطل */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* قسم البحث */
.search-section {
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.search-section .card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* شريط التنقل */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--warning-color) !important;
}

/* القائمة المنسدلة */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius);
}

.dropdown-item {
    transition: var(--transition);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
}

/* النماذج */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    background: var(--light-color);
    color: var(--secondary-color);
}

/* التنبيهات */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1edff 0%, #a7d8f0 100%);
    color: #0c5460;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #abdde5 100%);
    color: #0c5460;
}

/* الشارات */
.badge {
    font-weight: 500;
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
}

/* قسم الإحصائيات */
.stats-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    position: relative;
}

.stats-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 100 100"><polygon points="0,100 100,0 100,100" fill="rgba(255,255,255,0.1)"/></svg>');
}

.stats-section .container {
    position: relative;
    z-index: 2;
}

/* التذييل */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer a:hover {
    color: var(--warning-color) !important;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .search-section {
        margin-top: 0;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .stats-section h3 {
        font-size: 1.5rem;
    }
}

/* تحسينات إضافية */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
}

/* تأثيرات التحميل */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* تحسين الجداول */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    border: none;
}

.table td {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

/* تحسين الصفحات */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
