:root {
    --primary-color: #0d47a1;
    --secondary-color: #1976d2;
    --accent-color: #2196f3;
    --light-color: #e3f2fd;
    --dark-color: #0a2351;
    --text-color: #333;
    --light-text-color: #666;
    --white-color: #fff;
    --gray-color: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

.section-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: var(--transition);
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Hero Section */
.hero-section {
    background-color: var(--white-color);
    padding: 5rem 0;
}

.hero-section h1 {
    font-weight: 900;
    color: var(--primary-color);
}

.search-container {
    max-width: 600px;
    position: relative;
    display: flex;
    margin: 0 auto;
}

.search-container input {
    flex-grow: 1;
    padding: 12px 20px;
    border-radius: 0 30px 30px 0;
    border: 2px solid var(--primary-color);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

/* Bootstrap input-group overrides for search bar */
.search-container .input-group .form-control {
    border-radius: 0 30px 30px 0 !important;
    border: 2px solid var(--primary-color);
}

.search-container .input-group .btn {
    border-radius: 30px 0 0 30px !important;
    padding: 0 25px;
}

/* General input-group styling for all pages */
.input-group .form-control {
    border-radius: 0 30px 30px 0 !important;
    border: 2px solid var(--primary-color);
    padding: 12px 20px;
}

.input-group .btn {
    border-radius: 30px 0 0 30px !important;
    padding: 0 25px;
}

.search-container input:focus {
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.2);
}

.search-container .search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px 0 0 30px;
    padding: 0 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.search-container .search-btn:hover {
    background-color: var(--secondary-color);
}

.category-tags {
    margin-top: 20px;
}

.category-tags .badge {
    margin: 5px;
    padding: 8px 15px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 20px;
    background-color: var(--light-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.category-tags .badge:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* Stats Section */
.stat-card {
    padding: 2rem;
    background-color: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-text {
    font-size: 1.2rem;
    color: var(--light-text-color);
}

/* Categories Section */
.category-card {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-description {
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.category-link {
    font-weight: 500;
    color: var(--primary-color);
    display: inline-block;
}

.category-link i {
    margin-right: 0.5rem;
    transition: var(--transition);
}

.category-link:hover i {
    transform: translateX(-5px);
}

/* Terms Section */
.term-card {
    background-color: var(--white-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.term-card:hover {
    transform: translateY(-5px);
}

.term-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.term-title {
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.term-subtitle {
    color: var(--light-text-color);
    font-style: italic;
    margin-bottom: 0;
}

.term-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.term-image {
    margin-top: 1rem;
    border-radius: 5px;
    overflow: hidden;
}

.term-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.term-meta {
    display: flex;
    gap: 1rem;
    color: var(--light-text-color);
}

.term-meta span {
    display: flex;
    align-items: center;
}

.term-meta i {
    margin-left: 0.5rem;
}

/* About Section */
.about-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
}

.about-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 48%;
    background-color: var(--white-color);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.about-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-color);
}

.about-feature-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
    border-radius: 50%;
}

.about-feature-text h4 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.about-feature-text p {
    color: var(--light-text-color);
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: var(--white-color);
}

.cta-title {
    font-weight: 700;
}

.cta-text {
    max-width: 700px;
    margin: 0 auto;
}

/* Footer */
.footer-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white-color);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-color);
    color: var(--white-color);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--white-color);
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    padding-right: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.footer-contact li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-left: 0.75rem;
    color: var(--accent-color);
}

.newsletter h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-divider {
    margin: 2rem 0;
    border-color: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    color: var(--white-color);
    opacity: 0.8;
}

/* Term Page Styles */
.term-page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: var(--white-color);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.term-page-title {
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.term-page-subtitle {
    font-style: italic;
    opacity: 0.8;
}

.term-section {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    margin-bottom: 2rem;
}

.term-section-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-color);
}

.term-image-large {
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
}

.term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.term-tag {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.term-references {
    list-style: none;
    padding: 0;
}

.term-references li {
    margin-bottom: 0.75rem;
    padding-right: 1rem;
    position: relative;
}

.term-references li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--primary-color);
}

.related-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.related-term {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}

.related-term:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Interactive Features Styles */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: right;
}

.suggestion-item:hover {
    background-color: var(--light-color);
}

.search-result-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h4 {
    margin-bottom: 5px;
}

.search-result-item p {
    color: var(--light-text-color);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.share-buttons a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.share-buttons a:hover {
    transform: translateY(-3px);
}

.toast-container {
    z-index: 1060;
}

.toast {
    background-color: var(--white-color);
    border-radius: 5px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

/* Animation Styles */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-section {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    .stat-card, .category-card, .term-card {
        margin-bottom: 1.5rem;
    }
    
    .about-feature {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .about-feature-icon {
        margin-bottom: 1rem;
    }
    
    .search-suggestions {
        max-height: 150px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
}



/* Article Cards */
.article-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    background: var(--light-color);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-excerpt {
    color: var(--light-text-color);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--light-text-color);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}




/* Category Stats */
.category-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--light-text-color);
}

.category-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

