/* ======================================
   Color Variables
   ====================================== */
:root {
    /* Primary Brand Colors */
    --primary-green: #28a745;
    --primary-green-hover: #218838;
    --primary-green-dark: #45a049;
    --primary-text: #0e0c41;
    --primary-text-secondary: #0e0c41c2;
    
    /* Background Colors */
    --main-bg: rgb(242, 239, 227);
    --secondary-bg: #f8f6f3;
    --white-bg: #ffffff;
    --card-bg: #f8f6f3;
    
    /* Text Colors */
    --text-dark: #333;
    --text-medium: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #b8c5d1;
    --text-white: #ffffff;
    --text-black: #000;
    --text-placeholder: #999;
    
    /* Accent Colors */
    --accent-orange: rgb(237, 111, 45);
    --accent-purple: #9c27b0;
    --accent-blue: #2196F3;
    --accent-red: #FF5722;
    
    /* Gradient Colors */
    --gradient-brown-start: #ada49e;
    --gradient-brown-end: #f3f2f2;
    --gradient-green-start: #4CAF50;
    --gradient-green-end: #45a049;
    
    /* Social Media Colors */
    --telegram: #0088cc;
    --whatsapp: #25d366;
    --tiktok: #000000;
    --twitter: #000000;
    --youtube: #ff0000;
    --instagram: #E4405F;
    
    /* State Colors */
    --success: #4CAF50;
    --success-bg: #e8f5e8;
    --info: #2196F3;
    --info-bg: #e3f2fd;
    --warning: #FF5722;
    --warning-bg: #fbe9e7;
    --error: #f44336;
    --error-bg: #ffebee;
    
    /* Footer Colors */
    --footer-bg: #1a2332;
    --footer-border: #2a3441;
    
    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --shadow-brown: rgba(139, 69, 19, 0.1);
    --shadow-brown-hover: rgba(139, 69, 19, 0.2);
    --shadow-white: rgba(255, 255, 255, 0.1);
    --shadow-green: rgba(25, 135, 84, 0.2);
    
    /* Border Colors */
    --border-light: rgba(0, 0, 0, 0.05);
    --border-medium: rgba(0, 0, 0, 0.1);
    --border-dark: rgba(0, 0, 0, 0.15);
    
    /* Transition */
    --transition: all 0.5s ease;
    --transition-fast: all 0.2s ease;
    --transition-slow: all 0.5s ease;
}

/* ======================================
   Global Styles
   ====================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--secondary-bg);
    direction: rtl;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: var(--primary-green);
    color: var(--text-white);
}

::-moz-selection {
    background: var(--primary-green);
    color: var(--text-white);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green-hover);
}

/* ======================================
   Section Headers
   ====================================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-green);
    border-radius: 2px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-medium);
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* ======================================
   Button Styles
   ====================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--text-white);
    box-shadow: 0 4px 15px var(--shadow-green);
}

.btn-primary:hover {
    background: var(--primary-green-hover);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-green);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* ======================================
   Header & Navigation
   ====================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    background-color: var(--white-bg) !important;
    backdrop-filter: blur(10px);
    transition: var(--transition);
     --bs-navbar-padding-y: 1rem;
}
 
.navbar.scrolled {
    --bs-navbar-padding-y: 0.5rem;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.navbar-brand img {
    transition: var(--transition);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav {
    align-items: center;
}

.nav-link {
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-dark) !important;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--primary-green) !important;
}

.authButtons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* زرار أساسي */
.btn {
    display: inline-block;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

/* تسجيل الدخول - Outline */
.login-btn {
    color: var(--primary-green);
    background: transparent;
    border: 1px solid var(--primary-green);
}

.login-btn:hover {
    background: var(--primary-green);
    color: var(--text-white);
}

/* إنشاء حساب - Filled */
.create-account-btn {
    background: var(--primary-green);
    color: var(--text-white);
    border: 1px solid var(--primary-green);
}

.create-account-btn:hover {
    background: var(--primary-green-hover);
}

/* Mobile Navigation */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* User Dropdown Styles */
.authButtons {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* قائمة المستخدم المنسدلة */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 15px 6px 6px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-dropdown-toggle:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Avatar المستخدم */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green-hover) 0%,  var(--primary-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* اسم المستخدم */
.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.dropdown-arrow {
    color: #333;
    font-size: 1rem;
}

.user-dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* القائمة المنسدلة */
.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    padding: 8px 0;
    margin-top: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.show .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* عناصر القائمة */
.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

.dropdown-item-custom:hover {
    background-color: #f8f9fa;
    color: var(--primary-green);
    text-decoration: none;
}

.dropdown-item-custom i {
    font-size: 16px;
    width: 16px;
    text-align: center;
}

/* عنصر تسجيل الخروج */
.logout-item {
    color: #dc3545 !important;
    border-top: 1px solid #e9ecef;
    margin-top: 8px;
    padding-top: 16px;
}

.logout-item:hover {
    background-color: #fff5f5;
    color: #dc3545 !important;
}

/* الفاصل */
.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 8px 0;
    border: none;
}

/* الأحرف الأولى للاسم */
.avatar-initials {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
}

.user-dropdown-toggle:focus {
    outline: none;
}

.dropdown-item-custom:focus {
    outline: none;
    background-color: #f8f9fa;
}    

@media (max-width: 991px) {
    .authButtons {
        justify-content: center;
        margin-top: 20px;
        flex-wrap: wrap;
        flex-direction: column;
    }
    
    .custom-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-top: 8px;
        display: none;
        min-width: auto;
        width: 100%;
        transition: none;
    }
    
    .user-dropdown.show .custom-dropdown-menu {
        display: block;
    }
    
    .navbar-collapse {
        text-align: center;
        padding-top: 20px;
    }
}

/* ======================================
   Articles Section (UPDATED MINIMAL DESIGN)
   ====================================== */
#articles {
    padding: 80px 0; /* Reduced padding matches books/courses */
    background: var(--main-bg);
    position: relative;
}

/* Main Card Style */
.article-card {
    background: var(--white-bg);
    border-radius: 12px; /* Consistent rounded corners */
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-light); /* Softer shadow */
    transition: var(--transition);
    height: 100%;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-medium);
}

/* Image Container */
.article-image {
    width: 100%;
    height: 220px; /* Fixed height matches books/courses */
    position: relative;
    overflow: hidden;
    padding: 0;
    background: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* Touches 4 corners */
    transition: var(--transition);
}

/* Placeholder for when no image exists */
.article-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
    font-size: 3rem;
}

.article-card:hover .article-image img {
    transform: scale(1.03);
}

/* Views Badge */
.article-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-green);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Content Area */
.article-content {
    padding: 15px; /* Compact padding */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.1rem;
    color: var(--text-medium);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: auto;
    /* Limit to 1 line */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-excerpt {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 0.9rem;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

/* Footer - Compact Row Layout */
.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
}

/* Author Style */
.article-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.article-author i {
    color: var(--primary-green);
}

/* Button Styling (Minimal) */
.article-button {
    background: var(--primary-green);
    border: none;
    color: var(--text-white);
    padding: 6px 18px;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    display: inline-flex;
}

.article-button:hover {
    background: var(--primary-green-hover);
    color: var(--text-white);
    transform: translateY(-1px);
}

/* ======================================
   Footer
   ====================================== */
.footer {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--footer-bg);
    color: var(--text-white);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
}

.footer-section {
    background-color: var(--footer-bg);
    padding: 80px 0 50px;
    color: var(--text-white);
}

.footer-widget {
    margin-bottom: 40px;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-white);
    position: relative;
}

.footer-description {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    padding-right: 15px;
}

.footer-links a::before {
    content: '◄';
    position: absolute;
    right: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
    color: var(--primary-green);
}

.footer-links a:hover {
    color: var(--text-white);
    padding-right: 25px;
}

.footer-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.contact-info {
    margin-top: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.contact-item:hover {
    color: var(--text-white);
}

.contact-item i {
    color: var(--primary-green);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: var(--transition);
}

.social-icon:hover::before {
    transform: scale(1);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.social-icon.telegram {
    background-color: var(--telegram);
    color: var(--text-white);
}

.social-icon.whatsapp {
    background-color: var(--whatsapp);
    color: var(--text-white);
}

.social-icon.tiktok {
    background-color: var(--tiktok);
    color: var(--text-white);
}

.social-icon.twitter {
    background-color: var(--twitter);
    color: var(--text-white);
}

.social-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: var(--text-white);
}

.social-icon.youtube {
    background-color: var(--youtube);
    color: var(--text-white);
}

.bottom-footer {
    background-color: var(--footer-bg);
    padding: 30px 0;
    border-top: 1px solid var(--footer-border);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: flex-end;
}

.footer-bottom-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--primary-green);
}

/* ======================================
   Responsive Design
   ====================================== */
@media (max-width: 1200px) {
    .section-title,
    .main-title {
        font-size: 2.1rem;
    }
}

@media (max-width: 768px) {
    .section-title,
    .main-title {
        font-size: 1.9rem;
    }
    
    .article-card {
        margin-bottom: 25px;
    }
    
    .article-title {
        font-size: 1.1rem;
        min-height: auto;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        justify-content: center;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .section-header {
        margin-top: 60px;
    }
    
    .article-footer {
        flex-direction: row; 
        gap: 10px;
    }
    
    .article-button {
        width: auto;
    }
}

@media (max-width: 576px) {
    .section-title,
    .main-title {
        font-size: 1.7rem;
    }
    
    .article-content {
        padding: 12px;
    }

    .footer-section {
        padding: 60px 0 40px;
    }
    
    .footer-widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .contact-item {
        justify-content: center;
    }
}
 
/* ======================================
   End of CSS File
   ====================================== */