/* التنسيقات الأساسية للموقع */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom, #0a1929, #1a2b3c);
  color: white;
  font-family: 'Tajawal', sans-serif;
  font-weight:700;
}

/* شريط التنقل العلوي */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  padding: 15px 5%;
  background-color: rgba(10, 25, 41, 0.6);
  position: fixed;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #4fc3f7;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.7);
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.nav-links li a {
  display:inline-block;
  padding:8px 12px;
  border:2px solid #4fc3f7;
  border-radius:20px;
  text-decoration: none;
  color: white;
  transition: 0.3s ease;
  font-weight:500;
  font-size: 14px;
}
.nav-links li a:hover {
  background-color:#4fc3f7;
  color: #fff;
}
.auth-buttons {
  display: flex;
  gap: 8px;
}
.auth-buttons button, .watch-btn {
  background: linear-gradient(to right, #4fc3f7, #29b6f6);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 20px;
  font-size: 14px;
  position: relative;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}
.auth-buttons button::before, .watch-btn::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 25px;
  border: 2px solid #4fc3f7;
  opacity: 0;
  transition: 0.3s;
}
.auth-buttons button:hover::before, .watch-btn:hover::before {
  opacity: 1;
}
.auth-buttons button:hover, .watch-btn:hover {
  background: linear-gradient(to right, #29b6f6, #03a9f4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 195, 247, 0.6);
}
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px;
  border-radius: 5px;
  width: 180px;
  transition: all 0.3s ease;
}
.search-box:hover {
  background: rgba(255, 255, 255, 0.2);
}
.search-box input {
  background: none;
  border: none;
  color: white;
  padding: 5px;
  width: 100%;
}
.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 20px;
  transition: color 0.3s;
}
.search-box button:hover {
  color: #4fc3f7;
}

/* عرض الفيلم الرئيسي للشاشات الكبيرة */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}
.hero-slide.active {
  opacity: 1;
  z-index: 1;
}
.movie-info {
  text-align: right;
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  max-width: 40%;
  background: rgba(10, 25, 41, 0.8);
  padding: 30px;
  border-radius: 15px;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-left: 4px solid #4fc3f7;
}
.movie-info h1 {
  font-size: 42px;
  margin-bottom: 15px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
  color: #b3e5fc;
  letter-spacing: 1px;
}
.movie-info .description {
  font-size: 18px;
  line-height: 1.6;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 20px;
  font-weight: normal;
  color: #e0e0e0;
}
.movie-details {
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #e1f5fe;
}
.movie-details span {
  padding: 0 10px;
  border-right: 2px solid #4fc3f7;
  transition: transform 0.3s ease, color 0.3s ease;
}
.movie-details span:last-child {
  border-right: none;
}
.movie-details span:hover {
  transform: scale(1.1);
  color: #4fc3f7;
}
.watch-btn {
  margin-top: 25px;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}
.carousel {
  position: absolute;
  bottom: 10%;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}
.dot {
  width: 12px;
  height: 12px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
  transition: transform 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}
.dot.active {
  background: #4fc3f7;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
}
.dot:hover {
  transform: scale(1.5);
  background: #81d4fa;
}
.carousel button {
  background: rgba(10, 25, 41, 0.5);
  border: none;
  cursor: pointer;
  color: white;
  font-size: 36px;
  transition: transform 0.2s ease, color 0.2s ease;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.carousel button:hover {
  color: #4fc3f7;
  background: rgba(10, 25, 41, 0.7);
  transform: scale(1.1);
}
.carousel button:active {
  transform: scale(0.9);
}

/* عرض الفيلم الرئيسي للهواتف */
.mobile-hero {
  display: none;
  padding: 120px 20px 40px;
  text-align: center;
  background: linear-gradient(to bottom, #0a1929, #1a2b3c);
  position: relative;
  overflow: hidden;
}
.mobile-slides-container {
  position: relative;
  height: 100%;
}
.mobile-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  padding: 20px 0;
}
.mobile-slide.active {
  opacity: 1;
  z-index: 1;
}
.mobile-hero h1 {
  font-size: 28px;
  color: #4fc3f7;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}
.mobile-hero .poster {
  width: 200px;
  height: 300px;
  margin: 0 auto 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #4fc3f7;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}
.mobile-hero .poster:hover {
  transform: scale(1.03);
}
.mobile-hero .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mobile-hero .description {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 0 10px;
  color: #e0e0e0;
  position: relative;
  z-index: 2;
}
.mobile-hero .mobile-movie-details {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.mobile-hero .mobile-movie-details span {
  padding: 8px 15px;
  background: rgba(79, 195, 247, 0.2);
  border-radius: 20px;
  font-size: 14px;
  color: #e1f5fe;
  border: 1px solid rgba(79, 195, 247, 0.3);
}

/* ===== قسم البحث المتقدم ===== */
.advanced-search {
  width: 90%;
  margin: 30px auto 50px;
  background: rgba(10, 25, 41, 0.8);
  padding: 30px;
  border-radius: 15px;
  color: #fff;
  border: 1px solid rgba(79, 195, 247, 0.3);
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.advanced-search h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #4fc3f7;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  font-size: 28px;
  position: relative;
  padding-bottom: 15px;
}
.advanced-search h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: #4fc3f7;
  border-radius: 3px;
}
.filters-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
  align-items: end;
}
.filter-group,
.filter-group-inline {
  display: flex;
  flex-direction: column;
}
.filter-group-inline {
  flex-direction: row;
  align-items: center;
  gap: 5px;
}
.filter-group label,
.filter-group-inline label {
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 15px;
  color: #b3e5fc;
}
.filter-group select,
.filter-group input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2a3b4c;
  background: #1a2b3c;
  color: #fff;
  transition: all 0.3s;
  font-size: 15px;
}
.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.3);
}
.filter-group-inline input[type="checkbox"] {
  transform: scale(1.3);
  accent-color: #4fc3f7;
  cursor: pointer;
}
.search-button {
  grid-column: 1 / -1;
  background: linear-gradient(to right, #4fc3f7, #29b6f6);
  color: #fff;
  border: none;
  padding: 15px;
  font-size: 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  letter-spacing: 1px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}
.search-button:hover {
  background: linear-gradient(to right, #29b6f6, #03a9f4);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(79, 195, 247, 0.6);
}

/* ===== قسم الشرائح ===== */
.movies-slides {
  width: 90%;
  margin: 0 auto 50px;
}
.movies-slides h2 {
  margin-bottom: 15px;
  color: #4fc3f7;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  font-size: 26px;
  padding-right: 10px;
  border-left: 4px solid #4fc3f7;
  padding-left: 15px;
}
/* تنسيق البوسترات */
.poster {
  width: 160px;
  overflow: hidden;
  height: 240px;
  background: #1a2b3c;
  border: 2px solid #4fc3f7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  scroll-snap-align: start;
  flex: 0 0 auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.poster:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(79, 195, 247, 0.6);
}
.poster::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(10, 25, 41, 0.8) 0%, rgba(10, 25, 41, 0) 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.poster:hover::before {
  opacity: 1;
}
.movie-slider-container {
  position: relative;
  margin-bottom: 60px;
}
.slider-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.slider-navigation button {
  background: rgba(10, 25, 41, 0.6);
  border: none;
  cursor: pointer;
  color: white;
  font-size: 36px;
  padding: 10px;
  transition: all 0.3s;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider-navigation button:hover {
  color: #4fc3f7;
  background: rgba(10, 25, 41, 0.8);
  transform: scale(1.1);
}
.slider-navigation button:active {
  transform: scale(0.9);
}
.poster-group {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 15px 0;
  scrollbar-width: thin;
  scrollbar-color: #4fc3f7 #1a2b3c;
}
.poster-group::-webkit-scrollbar {
  height: 8px;
}
.poster-group::-webkit-scrollbar-thumb {
  background: #4fc3f7;
  border-radius: 4px;
}
.poster-group::-webkit-scrollbar-track {
  background: #1a2b3c;
  border-radius: 4px;
}
.poster img{
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  transition: transform 0.5s;
}
.poster:hover img {
  transform: scale(1.1);
}

/* القائمة الجانبية للهواتف */
.hamburger {
  display: none;
  cursor: pointer;
  font-size: 36px;
  color: #4fc3f7;
  z-index: 1001;
  transition: transform 0.3s;
}
.hamburger:hover {
  transform: scale(1.1);
}
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 250px;
  height: 100%;
  background-color: rgba(10, 25, 41, 0.95);
  z-index: 1000;
  transition: right 0.3s ease;
  padding-top: 70px;
  overflow-y: auto;
  border-left: 2px solid #4fc3f7;
}
.sidebar.active {
  right: 0;
}
.sidebar ul {
  list-style-type: none;
  padding: 20px;
}
.sidebar ul li {
  margin: 20px 0;
}
.sidebar ul li a {
  text-decoration: none;
  color: white;
  font-size: 18px;
  display: block;
  padding: 10px 20px;
  border-radius: 25px;
  transition: 0.3s ease;
  border: 1px solid rgba(79, 195, 247, 0.3);
}
.sidebar ul li a:hover {
  background: linear-gradient(to right, #4fc3f7, #29b6f6);
  color: #fff;
  border-color: transparent;
  transform: translateX(-5px);
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 25, 41, 0.7);
  display: none;
  z-index: 999;
}
.overlay.active {
  display: block;
}

/* تذييل الصفحة */
footer {
  background: #0a1929;
  padding: 40px 0;
  text-align: center;
  color: #aaa;
  font-size: 16px;
  border-top: 2px solid #4fc3f7;
  position: relative;
}
footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, #4fc3f7, transparent);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 16px;
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid rgba(79, 195, 247, 0.3);
}
.footer-links a:hover {
  color: #4fc3f7;
  border-color: #4fc3f7;
  background: rgba(79, 195, 247, 0.1);
}

/* تحسينات للهواتف */
@media (max-width: 1024px) {
  .hero {
    height: 80vh;
  }
  .movie-info {
    max-width: 50%;
  }
  .movie-info h1 {
    font-size: 36px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px 5%;
  }
  .nav-links {
    display: none;
  }
  .auth-buttons {
    display: none;
  }
  .search-box {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .hero {
    display: none;
  }
  .mobile-hero {
    display: block;
    height: 100vh;
  }
  .advanced-search {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
  }
  .filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center; /* توسيط المحتوى في الشاشات الصغيرة */
  }
  .filter-group,
  .filter-group-inline {
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط العناصر داخل المجموعة */
    text-align: center; /* توسيط النص */
    width: 100%; /* استخدام العرض الكامل */
  }
  .filter-group label,
  .filter-group-inline label {
    font-size: 16px;
    margin-bottom: 8px;
    width: 100%; /* جعل التسميات تأخذ العرض الكامل لتوسيط النص */
  }
  .filter-group select,
  .filter-group input {
    padding: 12px;
    font-size: 16px;
    width: 100%;
    text-align: center; /* توسيط النص في حقول الإدخال */
  }
  .filter-group-inline {
    flex-direction: row;
    justify-content: center; /* توسيط العناصر في مجموعة الـ inline */
    align-items: center;
    gap: 10px;
  }
  .search-button {
    padding: 16px;
    font-size: 18px;
    margin-top: 15px;
    width: 100%; /* جعل الزر يأخذ العرض الكامل */
    max-width: 300px; /* تحديد أقصى عرض للزر */
  }
  .poster {
    width: 140px;
    height: 210px;
  }
  .movies-slides {
    width: 95%;
  }
  .mobile-hero h1 {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 20px;
  }
  .mobile-hero {
    padding: 100px 15px 30px;
  }
  .mobile-hero h1 {
    font-size: 24px;
  }
  .mobile-hero .poster {
    width: 160px;
    height: 240px;
  }
  .mobile-hero .description {
    font-size: 15px;
  }
  .mobile-hero .mobile-movie-details {
    gap: 10px;
  }
  .mobile-hero .mobile-movie-details span {
    font-size: 13px;
    padding: 6px 12px;
  }
  .movies-slides h2 {
    font-size: 22px;
  }
  .poster {
    width: 130px;
    height: 195px;
  }
  .search-button {
    font-size: 16px;
  }
  .footer-links {
    gap: 15px;
  }
  .footer-links a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* تنسيقات بروفايل المستخدم */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(79, 195, 247, 0.1);
  border: 2px solid #4fc3f7;
  transition: all 0.3s ease;
}

.user-profile:hover {
  background: rgba(79, 195, 247, 0.2);
  transform: translateY(-2px);
}

.profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #4fc3f7;
  object-fit: cover;
}

.sidebar-profile-pic {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 8px;
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(10, 25, 41, 0.95);
  border: 2px solid #4fc3f7;
  border-radius: 10px;
  padding: 10px;
  min-width: 150px;
  display: none;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.user-profile:hover .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 8px 12px;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
  font-size: 14px;
}

.user-dropdown a:hover {
  background: rgba(79, 195, 247, 0.2);
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
  .user-profile {
    padding: 6px 10px;
  }
  
  .profile-pic {
    width: 28px;
    height: 28px;
  }
}
.hero--with-preload {
  position: relative;
  background-color: #071226; /* لون خلفي سريع للعرض */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: filter 0.6s ease, opacity 0.6s ease;
  will-change: opacity, background-image;
}
/* overlay فوق الصورة لو عايز لون */
.hero--with-preload .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,25,41,0.25), rgba(10,25,41,0.55));
  z-index: 1;
  pointer-events: none;
}

/* المحتوى فوق الصورة */
.hero--with-preload .movie-info { position: relative; z-index: 2; }
 
/* حالة أثناء التحميل - نعمل blur + shimmer */
.hero--with-preload.loading {
  filter: blur(3px) saturate(0.95);
}

/* نضيف شيمر بديل (skeleton) بينما الصورة لم تُعرض بعد */
.hero--with-preload.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.02) 40%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.6s infinite linear;
  z-index: 1;
  mix-blend-mode: overlay;
  pointer-events: none;
}
/* بعد التحميل نحيد الـ blur ونظهر الصورة نقية */
.hero--with-preload.loaded {
  filter: none;
}

/* animation */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.hero--with-preload .movie-info {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  z-index: 2;
}

/* ===== الدائرة العائمة والشات ===== */
.floating-chat-container {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 9999;
}
.floating-chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fc3f7, #29b6f6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.6);
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
} 
.floating-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(79, 195, 247, 0.8);
}

.floating-chat-btn i {
  color: white;
  font-size: 28px;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.chat-window {
  position: fixed;
  bottom: 100px;
  left: 25px;
  width: 350px;
  height: 500px;
  background: rgba(10, 25, 41, 0.95);
  border: 2px solid #4fc3f7;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 9998;
  backdrop-filter: blur(10px);
}

.chat-window.active {
  display: flex;
} 
.chat-header {
  background: linear-gradient(135deg, #4fc3f7, #29b6f6);
  padding: 15px;
  border-radius: 13px 13px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  color: white;
  font-size: 16px;
}
.chat-mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 4px;
}

.mode-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: white;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}
.mode-btn.active {
  background: white;
  color: #4fc3f7;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
}
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.bot {
  background: rgba(79, 195, 247, 0.15) !important;
  border: 1px solid rgba(79, 195, 247, 0.25) !important;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.message.user {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

/* تنسيقات جديدة لرسائل الدعم الفني */
.message.admin-support {
  background: rgba(76, 175, 80, 0.2) !important;
  border: 1px solid rgba(76, 175, 80, 0.3) !important;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  border-left: 3px solid #4caf50;
  padding: 12px 15px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.support-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #4caf50;
  font-weight: bold;
  margin-bottom: 5px;
}

.support-badge .material-icons {
  font-size: 14px;
}

.message-content {
  color: #e0e0e0;
  line-height: 1.4;
}

.message-time {
  font-size: 10px;
  color: #aaa;
  margin-top: 5px;
  text-align: left;
}

.message.admin {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.3);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  border-left: 3px solid #4caf50;
}
.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.quick-btn {
  background: rgba(79, 195, 247, 0.2);
  border: 1px solid rgba(79, 195, 247, 0.3);
  color: #b3e5fc;
  padding: 8px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}
.quick-btn:hover {
  background: rgba(79, 195, 247, 0.3);
  transform: translateY(-2px);
}

.chat-input-container {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}
.chat-input {
  flex: 1;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
}

.chat-input:focus {
  outline: none;
  border-color: #4fc3f7;
}
.send-btn {
  background: linear-gradient(135deg, #4fc3f7, #29b6f6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
}
.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.6);
}

/* مؤشر الكتابة */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  color: #b3e5fc;
  font-size: 12px;
}

.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4fc3f7;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
} 

/* أنيميشن الإشعارات */
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

@media (max-width: 768px) {
  .floating-chat-container {
    bottom: 15px;
    left: 15px;
  }
  
  .floating-chat-btn {
    width: 50px;
    height: 50px;
  }
  
  .floating-chat-btn i {
    font-size: 24px;
  }
  
  .chat-window {
    width: 90vw;
    height: 70vh;
    left: 5vw;
    bottom: 80px;
  }
  .chat-header h3 {
    font-size: 14px;
  }
  
  .mode-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .quick-buttons {
    gap: 5px;
  }
  
  .quick-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .chat-input {
    padding: 10px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .floating-chat-btn {
    width: 45px;
    height: 45px;
  }
  
  .floating-chat-btn i {
    font-size: 22px;
  }
  
  .chat-window {
    height: 65vh;
  }
  .message {
    max-width: 90%;
    font-size: 14px;
  }
}

/* تنسيقات جديدة لإخفاء واجهة الشات بشكل كامل */
.chat-window .chat-input-container,
.chat-window .quick-buttons {
  display: none !important;
}

.chat-window.active .chat-input-container,
.chat-window.active .quick-buttons {
  display: flex !important;
}

/* تحسينات للتصحيح */
.debug-info {
  background: rgba(0,0,0,0.8);
  color: #4fc3f7;
  padding: 10px;
  border-radius: 5px;
  font-size: 12px;
  margin: 5px 0;
  border-left: 3px solid #4fc3f7;
}
