:root {
    --primary: #1D6484;
    --primary-dark: #174F68;
    --primary-light: #4C8FAE;
    --accent: #5FA2BF;
    --accent-hover: #3E7F9D;
    --text: #1C2B34;
    --text-light: #5F7380;
    --bg: #F6F9FB;
    --bg-secondary: #EEF3F6;
    --border: #D6E0E6;
    --success: #1FA97A;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.06);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.14);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.16);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Header & Navigation */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 1rem;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: calc(100% - 2rem);
}

.dropdown-menu {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: calc(var(--radius) - 0.25rem);
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* ADD THESE STYLES to your blog CSS file (public/css/blog.css or similar) */

/* Enhanced Search Container */
.search-container {
  position: relative;
  min-width: 320px;
}

.search-container .form-control {
  padding-right: 2.5rem;
  border-radius: 25px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.search-container .form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
}

/* Search Section */
.search-section {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.search-section:last-child {
  border-bottom: none;
}

.search-section-title {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
}

/* Search Result Items */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #212529;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
}

/* Category & Tag Items */
.category-item,
.tag-item {
  font-size: 0.9rem;
}

.category-item i,
.tag-item i {
  font-size: 1rem;
}

/* Post Items with Thumbnails */
.post-item {
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.search-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-thumbnail-placeholder {
  width: 60px;
  height: 60px;
  background-color: #e9ecef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #adb5bd;
  font-size: 1.5rem;
}

.search-post-content {
  flex: 1;
  min-width: 0;
}

.search-post-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.search-post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.search-post-meta .badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
}

/* No Results State */
.search-no-results {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}

.search-error {
  padding: 1rem;
  text-align: center;
  color: #dc3545;
}

/* Scrollbar Styling */
.search-results-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-results-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.search-results-dropdown::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-container {
    min-width: 100%;
    width: 100%;
  }
  
  .search-results-dropdown {
    max-height: 400px;
  }
  
  .search-post-title {
    font-size: 0.85rem;
  }
  
  .search-thumbnail,
  .search-thumbnail-placeholder {
    width: 50px;
    height: 50px;
  }
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-warning {
    background: var(--accent);
    color: white;
}

.btn-warning:hover {
    background: var(--accent-hover);
}

/* Trending Ticker */
.header-container {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(1, 37, 53, 1) 25%, rgb(34, 112, 148) 100%);
    padding: 0.75rem 0;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.ticker-label {
    background: white;
    color: var(--primary);
    padding: 0.375rem 1.25rem;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius) 0 0 var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin-left: 1rem;
    box-shadow: var(--shadow);
}

.ticker-wrap {
    flex: 1;
    overflow: hidden;
    padding-right: 1rem;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
}

.ticker:hover {
    animation-play-state: paused;
}

.ticker__item {
    display: inline-block;
    padding: 0 3rem;
    font-weight: 600;
}

.ticker__item a {
    color: white;
    opacity: 0.95;
    transition: var(--transition);
}

.ticker__item a:hover {
    opacity: 1;
    text-decoration: underline;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(50%, 0, 0); }
}

/* Featured Slider */
.featured-slider-section {
    background: var(--bg-secondary);
    padding: 3rem 0;
}

.featured-slider-wrapper {
    display: flex;
    gap: 1rem;
    direction: ltr;
}

#featured-slider {
    flex: 1;
    order: 1;
}

#featured-slider .splide__slide {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.splide-link-wrapper {
    display: block;
    position: relative;
    height: 100%;
}

.splide-link-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, 
        rgba(1, 37, 53, 0.9) 0%, 
        rgba(1, 37, 53, 0.6) 40%, 
        rgba(0, 0, 0, 0) 100%);
    transition: var(--transition);
    pointer-events: none;
}

.splide-link-wrapper:hover::after {
    height: 80%;
}

#featured-slider .splide__slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splide-link-wrapper:hover img {
    transform: scale(1.05);
}

.featured-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    color: white;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#featured-slider .splide__slide.is-active .featured-slide-content {
    transform: translateY(0);
    opacity: 1;
}

.featured-slide-content .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    border-radius: calc(var(--radius) - 0.125rem);
    display: inline-block;
    margin-bottom: 0.75rem;
}

.featured-slide-content h2 {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.featured-slide-content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.5);
    line-height: 1.6;
}

/* Thumbnail Carousel */
#thumbnail-carousel {
    width: 200px;
    height: 500px;
    order: 2;
}

#thumbnail-carousel .splide__slide {
    opacity: 0.4;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: var(--radius);
    transition: var(--transition);
    overflow: hidden;
}

#thumbnail-carousel .splide__slide:hover {
    opacity: 0.7;
}

#thumbnail-carousel .splide__slide.is-active {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

#thumbnail-carousel .splide__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Splide Arrows */
.splide__arrow {
    background: white;
    opacity: 0.9;
    box-shadow: var(--shadow-lg);
}

.splide__arrow:hover {
    opacity: 1;
}

.splide__arrow svg {
    fill: var(--primary);
}

/* Blog Posts */
.blog-post-excerpt {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.blog-post-excerpt:hover {
    transform: translateX(-4px);
}

.blog-post-excerpt img {
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.blog-post-excerpt:hover img {
    box-shadow: var(--shadow-xl);
    transform: scale(1.02);
}

.blog-post-excerpt h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-post-excerpt h2 a {
    color: var(--text);
    transition: var(--transition);
}

.blog-post-excerpt h2 a:hover {
    color: var(--primary);
}

.blog-post-meta {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar */
aside .sticky-top > div {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    z-index: -10;
}

aside h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text);
}

aside .list-unstyled li {
    margin-bottom: 0.75rem;
}

aside .list-unstyled a {
    color: var(--text);
    transition: var(--transition);
    display: block;
    padding: 0.5rem;
    border-radius: calc(var(--radius) - 0.25rem);
}

aside .list-unstyled a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
    padding-right: 1rem;
}

.ad-placeholder {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Topics Grid */
.topics-section {
    background: var(--bg-secondary);
}

.topic-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.topic-card i {
    color: var(--primary);
    transition: var(--transition);
}

.topic-card:hover i {
    color: var(--accent);
    transform: scale(1.1);
}

.topic-card h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

/* About Author Section */
.about-author-section {
    background: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-author-section img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 4px solid var(--border);
    box-shadow: var(--shadow-lg);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(90deg, rgba(1, 37, 53, 1) 25%, rgb(34, 112, 148) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
       color: #fff;
}

.cta-section .input-group input {
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.cta-section .btn {
    padding: 0.75rem 2rem;
    font-weight: 700;
}

/* Footer */
footer {
    background: linear-gradient(180deg, #012535 0%, #011820 100%);
}

footer h5 {
    color: var(--accent);
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
}

footer p, footer a {
    color: rgba(255, 255, 255, 0.8);
}

footer a:hover {
    color: white;
}

footer i {
    color: var(--accent);
}

/* Post Detail */
.blog-post-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.post-content h2,
.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.related-posts .card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    overflow: hidden;
}

.related-posts .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.related-posts .card-img-top {
    height: 200px;
    object-fit: cover;
}

.related-posts .card-title a {
    color: var(--text);
}

.related-posts .card-title a:hover {
    color: var(--primary);
}

/* Comments Section */
.comments-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.comments-section textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: inherit;
    resize: vertical;
}

.comments-section textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 37, 53, 0.1);
}

/* Responsive */
@media (max-width: 991.98px) {
    .featured-slider-wrapper {
        flex-direction: column;
    }
    
    #featured-slider,
    #thumbnail-carousel {
        width: 100%;
        order: 0;
    }
    
    #thumbnail-carousel {
        height: auto;
    }
    
    #featured-slider .splide__slide img {
        height: 350px;
    }
    
    .featured-slide-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-post-title {
        font-size: 2rem;
    }

    .g-5, .gx-5 {
    --bs-gutter-x: 0;
}
}

@media (max-width: 767.98px) {
    .featured-slide-content {
        padding: 1.5rem;
    }
    
    .featured-slide-content h2 {
        font-size: 1.25rem;
    }
    
    .cta-section h3 {
        font-size: 1.5rem;
    }
}

.post-content,
.featured-slider-section,
.featured-slider-section h2, .featured-slider-section p {
  direction: rtl;
  unicode-bidi: isolate;
}

.post-content .ltr,
.post-content a,
.post-content code,
.featured-slider-section,
.featured-slider-section h2, .featured-slider-section p {
  direction: ltr;
  unicode-bidi: isolate;
}

.post-content p,
.featured-slider-section,
.featured-slider-section h2, .featured-slider-section p {
  direction: rtl !important;
  unicode-bidi: isolate !important;
  text-align: right; /* keep your visual alignment if desired */
}
