/*
Theme Name: بريقنا
Theme URI: https://yourwebsite.com
Author: اسمك
Author URI: https://yourwebsite.com
Description: مجلة إلكترونية عربية احترافية - نسخة محسّنة مع شريط إعلانات وودجت متقدمة
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bariqna
Tags: rtl-language-support, news, magazine, gold, widgets, custom-header
*/

/* ==============================
   المتغيرات الأساسية
   ============================== */
:root {
  --primary-gold: #d4af37;
  --dark-gold: #b8860b;
  --light-gold: #f4e9cd;
  --red-alert: #e63946;
  --black: #111;
  --gray-dark: #333;
  --gray-light: #f8f8f8;
  --white: #fff;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--gray-light);
  color: var(--gray-dark);
  line-height: 1.6;
  direction: rtl;
}

/* ==============================
   شريط الإعلانات المتحرك
   ============================== */
.ads-bar {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: var(--white);
  padding: 0.9rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 999;
}

.ads-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.05) 10px,
    rgba(255,255,255,0.05) 20px
  );
  pointer-events: none;
}

.ads-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.ads-icon {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

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

.ads-content {
  flex: 1;
  text-align: center;
  position: relative;
  min-height: 1.5rem;
}

.ad-item {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-item.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
}

.ads-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ads-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* ==============================
   الشريط الأسود العلوي
   ============================== */
.top-bar {
  background: var(--black);
  color: var(--white);
  padding: 0.6rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 0.8rem;
  z-index: 900;
}

.social-icons {
  display: flex;
  gap: 1.2rem;
}

.social-icons a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.social-icons a:hover {
  color: var(--primary-gold);
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

.top-contact {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-contact a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s;
}

.top-contact a:hover {
  color: var(--primary-gold);
}

/* ==============================
   الهيدر الرئيسي
   ============================== */
header {
  background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
  color: var(--white);
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  position: relative;
  overflow: visible;
  z-index: 1000;
  margin-bottom: 30px;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.1;
  pointer-events: none;
}

.logo {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo a {
  color: var(--white);
  text-decoration: none;
}

.logo::after {
  content: "✦";
  color: #ffd700;
  margin-right: 0.5rem;
  font-size: 3rem;
  vertical-align: middle;
}

/* ==============================
   القوائم الرئيسية
   ============================== */
nav {
  position: relative;
  width: 100%;
}

.main-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.main-menu > li {
  position: relative;
}

.main-menu a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-menu a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.dropdown-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 0.3rem;
  transition: transform 0.3s;
  display: none;
}

/* القوائم المنسدلة */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  min-width: 220px;
  z-index: 1100;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 5px;
  list-style: none;
  padding: 0;
  border-top: 3px solid var(--primary-gold);
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-menu li:hover .sub-menu {
  display: block;
}

.sub-menu li {
  width: 100%;
}

.sub-menu a {
  color: var(--gray-dark);
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0;
  display: block;
}

.sub-menu a:hover {
  background-color: var(--light-gold);
  color: var(--primary-gold);
}

/* ==============================
   المحتوى الرئيسي
   ============================== */
.container {
  display: flex;
  padding: 2rem;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 3;
}

.section-title {
  font-size: 2rem;
  margin: 2.5rem 0 1.5rem;
  color: var(--primary-gold);
  border-bottom: 2px solid #eee;
  padding-bottom: 0.8rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 100px;
  height: 2px;
  background: linear-gradient(to left, var(--primary-gold), transparent);
}

/* ==============================
   شبكة المقالات
   ============================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.article-card.animate-in {
  animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s;
}

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

.article-body {
  padding: 1.5rem;
}

.article-body h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--black);
  line-height: 1.4;
}

.article-body h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.article-body h3 a:hover {
  color: var(--primary-gold);
}

.article-body p {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.category-tag {
  display: inline-block;
  background: linear-gradient(to left, var(--primary-gold), var(--dark-gold));
  color: var(--white);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(212, 175, 55, 0.3);
}

.read-more {
  color: var(--primary-gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s;
}

.read-more:hover {
  gap: 0.8rem;
  color: var(--dark-gold);
}

/* ==============================
   الشريط الجانبي المحسّن
   ============================== */
.sidebar {
  flex: 1;
  min-width: 300px;
}

.sidebar-box {
  background: var(--white);
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  margin-bottom: 2.5rem;
  border-top: 4px solid var(--primary-gold);
  opacity: 0;
  transform: translateY(20px);
}

.sidebar-box.animate-in {
  animation: slideUp 0.5s forwards;
}

.sidebar h3,
.widget-title {
  color: var(--primary-gold);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar h3::after,
.widget-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 2px;
  background-color: #eee;
}

/* مقالات ذات صلة */
.related-article {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: transform 0.2s;
}

.related-article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.related-article:hover {
  transform: translateX(-5px);
}

.related-thumb {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
  flex-shrink: 0;
}

.related-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.related-info a {
  text-decoration: none;
  color: var(--gray-dark);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: color 0.3s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-info a:hover {
  color: var(--primary-gold);
}

.related-date {
  font-size: 0.8rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* المقالات الشائعة */
.popular-post-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #eee;
  transition: transform 0.2s;
}

.popular-post-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.popular-post-item:hover {
  transform: translateX(-3px);
}

.post-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
  color: white;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(212, 175, 55, 0.3);
}

.post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-info a {
  color: var(--gray-dark);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.3s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-info a:hover {
  color: var(--primary-gold);
}

.post-date {
  font-size: 0.8rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* نموذج الاشتراك */
.newsletter-box {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-top-color: #28a745;
}

.newsletter-form {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.newsletter-form input[type="email"] {
  width: 100%;
  padding: 0.9rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--primary-gold);
}

.newsletter-form button {
  width: 100%;
  background: linear-gradient(to left, #28a745, #20c997);
  color: white;
  padding: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* أحدث التعليقات */
.recent-comment-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.recent-comment-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--light-gold);
}

.comment-content {
  flex: 1;
}

.comment-content strong {
  color: var(--primary-gold);
  font-size: 0.95rem;
}

.comment-content p {
  color: #666;
  font-size: 0.85rem;
  margin: 0.3rem 0;
  line-height: 1.4;
}

.comment-link {
  color: var(--primary-gold);
  text-decoration: none;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.comment-link:hover {
  gap: 0.5rem;
}

.no-content {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 1rem;
}

/* ==============================
   زر العودة للأعلى
   ============================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* ==============================
   الفوتر
   ============================== */
footer {
  background: linear-gradient(to left, var(--black), #222);
  color: #ddd;
  text-align: center;
  padding: 2.5rem 2rem;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--primary-gold), transparent);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-tagline {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-gold);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 1rem;
}

.footer-links a:hover {
  color: var(--primary-gold);
}

.footer-social {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

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

.footer-social a:hover {
  background: var(--primary-gold);
  transform: translateY(-3px);
}

.copyright {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #aaa;
}

.copyright p:last-child {
  color: var(--primary-gold);
  font-weight: 500;
  margin-top: 0.5rem;
}

/* ==============================
   الاستجابة للجوال
   ============================== */
@media (max-width: 992px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .ads-bar {
    padding: 0.7rem 1rem;
  }
  
  .ad-item {
    font-size: 0.9rem;
  }
  
  .top-bar {
    flex-direction: column;
    text-align: center;
    padding: 0.8rem 1rem;
    gap: 1rem;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .top-contact {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  header {
    padding: 1.2rem 1rem;
  }
  
  .logo {
    font-size: 2.2rem;
  }
  
  .main-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .main-menu > li {
    width: 100%;
    text-align: center;
  }
  
  .main-menu a {
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  
  .dropdown-toggle {
    display: block;
  }
  
  .sub-menu {
    position: static;
    box-shadow: none;
    background: rgba(0,0,0,0.1);
    display: none;
    margin-top: 0;
    border-top: none;
  }
  
  .main-menu li.active .sub-menu {
    display: block;
  }
  
  .sub-menu a {
    padding-right: 2rem;
    color: var(--white);
    background: rgba(0,0,0,0.2);
  }
  
  .container {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 1.7rem;
  }
  
  .scroll-to-top {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.8rem;
  }
  
  .logo::after {
    font-size: 2rem;
  }
}
