/**
 * ملف CSS الرئيسي لموقع مسجد الرحمن
 * مركز كمبرلاند الثقافي الإسلامي
 * يوم الأحد 4 أغسطس 2025
 */

/* متغيرات الألوان الإسلامية */
:root {
  --primary-color: #2E8B57;        /* أخضر إسلامي */
  --secondary-color: #20B2AA;      /* أزرق مخضر */
  --accent-color: #FFD700;         /* ذهبي */
  --text-dark: #2C3E50;           /* نص غامق */
  --text-light: #6C757D;          /* نص فاتح */
  --bg-light: #F8F9FA;            /* خلفية فاتحة */
  --white: #FFFFFF;               /* أبيض */
  --success: #28A745;             /* أخضر نجاح */
  --warning: #FFC107;             /* أصفر تحذير */
  --danger: #DC3545;              /* أحمر خطر */
  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.15);
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --gradient-gold: linear-gradient(135deg, var(--accent-color) 0%, #FFA500 100%);
}

/* إعدادات عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--white);
  overflow-x: hidden;
}

/* AOS graceful-degradation: keep elements visible if JS doesn't initialize AOS */
html:not(.aos-enabled) [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* Header و Navigation */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  padding: 10px 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.header .logo img {
  max-height: 40px;
  margin-left: 10px;
}

.header .sitename {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Navigation Menu */
.navmenu ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.navmenu a {
  color: var(--text-dark);
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  position: relative;
}

.navmenu a:hover,
.navmenu a.active {
  color: var(--primary-color);
  background: rgba(46, 139, 87, 0.1);
}

/* Language Switcher */
.language-switcher .btn {
  padding: 6px 15px;
  font-size: 0.9rem;
  margin: 0 2px;
}

/* Get Started Button */
.btn-getstarted {
  background: var(--gradient-primary);
  color: white;
  padding: 10px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.btn-getstarted:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 139, 87, 0.4);
  color: white;
}

/* Mobile Navigation */
.mobile-nav-toggle {
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  display: none;
}

@media (max-width: 1199px) {
  .mobile-nav-toggle {
    display: block;
  }
  
  .navmenu {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9997;
    padding: 60px 20px;
    transform: translateX(100%);
    transition: 0.3s;
  }
  
  .navmenu.active {
    transform: translateX(0);
  }
  
  .navmenu ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navmenu a {
    display: block;
    padding: 15px 20px;
    font-size: 1.1rem;
  }
}

/* أزرار مخصصة */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 139, 87, 0.4);
  background: var(--gradient-primary);
  border: none;
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 25px;
  padding: 12px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn-gold {
  background: var(--gradient-gold);
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  color: var(--text-dark);
}

/* الهيدر والتنقل */
.header {
  background: var(--white);
  box-shadow: var(--shadow-soft);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.navbar {
  padding: 1rem 0;
}

.navbar-brand {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  margin: 0 10px;
  padding: 8px 15px !important;
  border-radius: 20px;
  transition: all 0.3s ease;
  color: var(--text-dark) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: var(--gradient-primary);
  color: var(--white) !important;
  transform: translateY(-1px);
}

/* القسم الرئيسي (Hero) */
.hero {
  background: linear-gradient(rgba(46, 139, 87, 0.8), rgba(32, 178, 170, 0.7)), 
              url('../img/hero-bg.jpg') center/cover no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease-out;
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero .btn {
  margin: 0 10px;
  animation: fadeInUp 1s ease-out 0.6s both;
}

/* تأثيرات الحركة */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* الأقسام */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  position: relative;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

.section-title p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* البطاقات */
.card {
  border: none;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-strong);
}

.card-header {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  padding: 2rem;
  text-align: center;
}

.card-header i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.card-body {
  padding: 2rem;
}

/* مواقيت الصلاة */
.prayer-times {
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-strong);
}

.prayer-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.prayer-time-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.prayer-time-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.prayer-time-card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.prayer-time-card .time {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
}

/* معرض الصور */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-strong);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: all 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  color: var(--white);
  opacity: 0;
  transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* قسم الفيديوهات */
.video-section {
  background: var(--bg-light);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.video-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.1);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.video-card:hover .play-button {
  background: var(--white);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
  padding: 1.5rem;
}

.video-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* قسم الاتصال */
.contact-section {
  background: var(--gradient-primary);
  color: var(--white);
}

.contact-info {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.contact-item i {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: var(--accent-color);
  min-width: 30px;
}

.contact-form {
  background: var(--white);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.contact-form .form-control {
  border: 2px solid #E9ECEF;
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.contact-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(46, 139, 87, 0.25);
}

/* التذييل */
.footer {
  background: #1a1a1a;
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer h5 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer ul li a {
  color: #ccc;
  transition: all 0.3s ease;
}

.footer ul li a:hover {
  color: var(--accent-color);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--accent-color);
  color: var(--text-dark);
  transform: translateY(-2px);
}

/* زر العودة للأعلى */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-color);
  color: var(--text-dark);
  transform: translateY(-3px);
}

/* أنماط للرسائل */
.alert-custom {
  border: none;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success-custom {
  background: rgba(40, 167, 69, 0.1);
  border-left-color: var(--success);
  color: #155724;
}

.alert-warning-custom {
  background: rgba(255, 193, 7, 0.1);
  border-left-color: var(--warning);
  color: #856404;
}

.alert-danger-custom {
  background: rgba(220, 53, 69, 0.1);
  border-left-color: var(--danger);
  color: #721c24;
}

/* تأثيرات التحميل */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(46, 139, 87, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* أنماط للأجهزة المحمولة */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  .gallery-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .prayer-time-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .card-header,
  .card-body {
    padding: 1.5rem;
  }
  
  .contact-form,
  .contact-info {
    padding: 1.5rem;
  }
}

/* تأثيرات خاصة للتفاعل */
.hover-effect {
  transition: all 0.3s ease;
}

.hover-effect:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

/* أنماط للطباعة */
@media print {
  .navbar,
  .footer,
  .back-to-top,
  .admin-floating-btn {
    display: none !important;
  }
  
  .hero {
    background: var(--white) !important;
    color: var(--text-dark) !important;
    min-height: auto;
    padding: 2rem 0;
  }
  
  .section {
    padding: 2rem 0;
  }
}


/* خدمات - شبكة مرنة وجميلة */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 991.98px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
  }
}
@media (max-width: 575.98px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem 0.5rem;
  }
}

.services-grid .service-item {
  background: linear-gradient(135deg, #fff 80%, #e2e8f0 100%);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(46,139,87,0.08), 0 1.5px 6px rgba(32,178,170,0.07);
  border: 1px solid #e0e0e0;
  padding: 2rem 1.2rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 340px;
  transition: box-shadow 0.3s, transform 0.3s;
  position: relative;
  text-align: center;
}
.services-grid .service-item:hover {
  box-shadow: 0 16px 40px rgba(46,139,87,0.13), 0 2px 8px rgba(32,178,170,0.10);
  transform: translateY(-8px) scale(1.025);
  border-color: var(--primary-color);
}
.services-grid .icon {
  font-size: 2.3rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(46,139,87,0.18);
  transition: background 0.3s, transform 0.3s;
}
.services-grid .service-item:hover .icon {
  background: var(--gradient-gold);
  transform: scale(1.12) rotate(7deg);
}
.services-grid h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-family: 'Raleway', sans-serif;
  letter-spacing: 0.2px;
  transition: color 0.3s;
}
.services-grid .service-item:hover h3 {
  color: var(--accent-color);
}
.services-grid h6 {
  font-size: 0.97rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.services-grid p {
  font-size: 0.93rem;
  color: var(--text-dark);
  line-height: 1.7;
  margin-bottom: 0;
  font-family: 'Poppins', 'Roboto', sans-serif;
}

/* تحسينات للعنوان الرئيسي */
.services .enhanced-title {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
.services .title-icon {
  background: var(--gradient-primary);
  animation: serviceIconPulse 3s ease-in-out infinite;
}
@keyframes serviceIconPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 15px 35px rgba(46, 139, 87, 0.3);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 20px 45px rgba(46, 139, 87, 0.4);
  }
}

/* RTL محسن للخدمات */
[dir="rtl"] .services-grid .service-item {
  text-align: right;
}
[dir="rtl"] .services-grid .service-item h3,
[dir="rtl"] .services-grid .service-item p {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .services .enhanced-title {
  direction: rtl;
  text-align: center;
}
