/* ========================================
   MASTER SPLINTER - ENHANCEMENTS STYLES
   All 30 Features CSS
   ======================================== */

/* ========================================
   1. LOADING ANIMATION
   ======================================== */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(130, 207, 226, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loader-text {
  color: var(--color-text);
  font-size: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   2. BACK TO TOP BUTTON - تم إلغاؤه
   ======================================== */
/* تم حذف هذه الميزة بناءً على طلب العميل */

/* ========================================
   3. SCROLL ANIMATIONS
   ======================================== */
.service-card,
.why-card,
.process-step,
.testimonial-card {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.service-card.animate-in,
.why-card.animate-in,
.process-step.animate-in,
.testimonial-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   10. LIVE CHAT WIDGET
   ======================================== */
.live-chat-widget {
  position: fixed;
  bottom: 8rem;
  left: 2rem;
  z-index: 10050;
}

/* Make English chat button same size as Arabic */
html[lang="en"] .chat-toggle {
  width: 50px;
  height: 50px;
  font-size: 1.3rem;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 350px;
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 10051;
}

.chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-header {
  background: var(--color-primary);
  color: white;
  padding: 1rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
}

.chat-body {
  padding: 1rem;
}

.chat-message {
  background: rgba(130, 207, 226, 0.1);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.chat-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-option {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  color: var(--color-text);
}

.chat-option:hover {
  background: var(--color-primary);
  color: white;
  transform: translateX(5px);
}

.chat-option i {
  font-size: 1.2rem;
}

/* ========================================
   19. SHARE BUTTON
   ======================================== */
.share-buttons {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 500;
}

.share-button,
.facebook-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  text-decoration: none;
  transform: translateX(0);
}

.share-button:hover,
.facebook-button:hover {
  transform: translateX(-4px);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
}

.facebook-button {
  background: #1877f2;
}

/* ========================================
   20. THEME CUSTOMIZER
   ======================================== */
.theme-customizer {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 500;
}

.customizer-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.customizer-toggle {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 0.75rem;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.shop-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: white;
  border: none;
  padding: 0.95rem 0.75rem;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
}

.shop-shortcut:hover,
.shop-shortcut:focus-visible {
  transform: translateX(4px);
  box-shadow: 6px 0 16px rgba(0, 0, 0, 0.2);
}

.shop-shortcut i {
  pointer-events: none;
}

.customizer-toggle:hover {
  padding-left: 1rem;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
}

.customizer-panel {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--color-bg);
  padding: 1.5rem;
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  min-width: 250px;
}

.customizer-panel.active {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .share-buttons {
    transform: translateY(-50%) scale(0.85);
    right: -6px;
  }

  .share-button,
  .facebook-button {
    width: 3rem;
    height: 3rem;
  }

  .theme-customizer {
    transform: translateY(-50%) scale(0.85);
  }

  .shop-shortcut,
  .customizer-toggle {
    padding: 0.75rem 0.55rem;
    font-size: 1.05rem;
  }

  .customizer-panel {
    min-width: 220px;
  }
}

@media (max-width: 480px) {
  .share-buttons {
    transform: translateY(-50%) scale(0.75);
    right: -10px;
  }

  .theme-customizer {
    transform: translateY(-50%) scale(0.75);
  }

  .customizer-panel {
    min-width: 200px;
  }
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.customizer-panel h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}

.color-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.color-option {
  width: 50px;
  height: 50px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: var(--color-text);
}

/* ========================================
   21. FONT SIZE CONTROL - تم إلغاؤه
   ======================================== */
/* تم حذف هذه الميزة بناءً على طلب العميل */

/* ========================================
   24. WELCOME POPUP - تم إلغاؤه
   ======================================== */
/* تم حذف هذه الميزة بناءً على طلب العميل */

/* ========================================
   25. NEWSLETTER SECTION
   ======================================== */
.newsletter-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
}

.newsletter-content h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.newsletter-content p {
  margin-bottom: 2rem;
  opacity: 0.9;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 250px;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}

.newsletter-form button {
  background: white;
  color: var(--color-primary);
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   26. FAQ SECTION
   ======================================== */
.faq-section {
  background: var(--color-bg-secondary);
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--color-bg);
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  transition: all 0.3s ease;
}

.faq-question:hover {
  background: var(--color-bg-secondary);
}

.faq-question i {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 200px;
}

.faq-answer p {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ========================================
   28. TRUST BADGES
   ======================================== */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(130, 207, 226, 0.1);
  border-radius: 12px;
}

.badge {
  text-align: center;
  padding: 1rem;
}

.badge i {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.badge span {
  font-weight: 600;
  color: var(--color-text);
}

/* ========================================
   9. SERVICE SEARCH
   ======================================== */
.service-search {
  position: relative;
  max-width: 500px;
  margin: 2rem auto 0;
}

.service-search input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: all 0.3s ease;
}

.service-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(130, 207, 226, 0.1);
}

.service-search i {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
}

/* ========================================
   8. WORKS GALLERY (أعمالنا)
   ======================================== */
.gallery-slider {
  position: relative;
  margin-top: 2rem;
  padding: 0 3rem;
}

.gallery-track-container {
  overflow: hidden;
  border-radius: 12px;
}

.gallery-track {
  display: flex;
  transition: transform 0.5s ease;
  gap: 1rem;
  direction: ltr;
}

.gallery-slide {
  min-width: calc(25% - 0.75rem); /* 4 slides on desktop */
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 16/9; /* عرض أكبر من الطول */
  background: var(--color-bg-secondary);
}

.gallery-slide img,
.gallery-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-slide:hover img,
.gallery-slide:hover video {
  transform: scale(1.1);
}

.gallery-video {
  display: block;
}

.video-play-icon {
  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;
  pointer-events: none;
  z-index: 2;
}

.video-play-icon i {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-left: 4px;
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(130, 207, 226, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.gallery-slide:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay i {
  font-size: 3rem;
  color: white;
}

/* Navigation Buttons */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-nav:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
  left: 0;
}

.gallery-nav-next {
  right: 0;
}

/* Dots */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.gallery-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-dot.active {
  background: var(--color-primary);
  width: 30px;
  border-radius: 6px;
}

.gallery-dot:hover {
  background: var(--color-primary);
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 1199px) {
  .gallery-slide {
    min-width: calc(33.333% - 0.67rem); /* 3 slides on tablet */
  }
}

@media (max-width: 767px) {
  .gallery-slide {
    min-width: calc(50% - 0.5rem); /* 2 slides on mobile */
  }
  
  .gallery-slider {
    padding: 0 2rem;
  }
  
  .gallery-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 479px) {
  .gallery-slide {
    min-width: 100%; /* 1 slide on small mobile */
  }
  
  .gallery-slider {
    padding: 0 1.5rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

#lightbox-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-content img,
#lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-video {
  width: 100%;
  max-width: 1200px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  top: 2rem;
  right: 2rem;
}

.lightbox-prev {
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    padding: 0.75rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
  }
  
  .lightbox-prev {
    left: 1rem;
  }
  
  .lightbox-next {
    right: 1rem;
  }
}

/* ========================================
   14. MAP SECTION
   ======================================== */
.map-container {
  margin-top: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   NOTIFICATION
   ======================================== */
.notification {
  position: fixed;
  top: 100px;
  right: -300px;
  background: var(--color-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  z-index: 10001;
}

.notification.show {
  right: 2rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  /* Overlay behind chat window */
  .chat-window::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .chat-window.active::before {
    opacity: 1;
  }
  
  .chat-window {
    position: fixed;
    width: calc(100vw - 2rem);
    max-width: 400px;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.95);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10000;
  }
  
  .chat-window.active {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .chat-body {
    max-height: calc(80vh - 120px);
    overflow-y: auto;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .trust-badges {
    grid-template-columns: 1fr;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form input {
    min-width: 100%;
  }
  
  .live-chat-widget {
    bottom: 5.5rem;
    left: 1rem;
  }
  
  .scroll-to-top {
    bottom: 1rem;
    left: 1rem;
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }
  
  .share-button,
  .theme-customizer {
    display: none;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
.dark-mode .chat-window,
.dark-mode .customizer-panel,
.dark-mode .popup-content {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .newsletter-form input {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dark-mode .newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   DROPDOWN & SELECT IMPROVEMENTS
   ======================================== */

/* تحسينات القائمة المنسدلة */
select {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
}


select:focus {
  z-index: 10000;
  position: relative;
}

select option {
  padding: 0.5rem;
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-accent);
}

select option:hover {
  background: var(--color-primary);
  color: white;
}

select option:checked {
  background: var(--color-primary);
  color: white;
}

[data-theme="dark"] select option {
  background: var(--color-surface);
  color: var(--color-accent);
}

[data-theme="dark"] select option:hover {
  background: rgba(130, 207, 226, 0.3);
}

[data-theme="dark"] select option:checked {
  background: rgba(130, 207, 226, 0.5);
}

/* تحسينات النموذج للتأكد من أن الـ selects فوق كل شيء */
.request-form select {
  z-index: 1;
}

.request-form select:focus,
.request-form select:active {
  z-index: 10000;
}

/* تقليل حجم الخط في الخيارات */
select {
  letter-spacing: 0.3px;
  line-height: 1.5;
}

/* تحسين استجابة الهاتف المحمول */
@media (max-width: 768px) {
  select {
    font-size: 16px;
    padding: 0.7rem 0.8rem !important;
  }

  select option {
    font-size: 16px;
    padding: 0.6rem;
  }
}

.request-form select {
  background-image: none !important;
  background-position: initial !important;
  padding-left: 0.9rem !important;
}

[data-theme="dark"] .request-form select {
  background-image: none !important;
}

@media (max-width: 768px) {
  .request-form select {
    padding-left: 0.8rem !important;
  }
}

