/* shared.css - أنماط الهيدر المشتركة - نسخة محسنة مع سهم العودة للأعلى */

:root {
  --bg: #050506;
  --panel: #0b0b0d;
  --text: #f0f4f8;
  --muted: #a8b5c6;
  --accent: #00aaff;
  --accent-2: #0088cc;
  --accent-3: #006699;
  --secondary: #ff6b6b;
  --secondary-light: #ff8e8e;
  --radius: 12px;
  --container: 1200px;
}

/* ========== HEADER STYLES ========== */
.header {
  background-color: rgba(5, 5, 6, 0.95);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 170, 255, 0.15);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.8s ease-out;
  width: 100%;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  max-width: 100%;
  margin: 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInLeft 0.8s ease-out;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  object-fit: cover;
  animation: pulse 2s infinite;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--secondary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
  margin: 0;
  padding: 0;
  animation: fadeInRight 0.8s ease-out;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 16px;
}

.nav a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  transition: width 0.3s ease;
}

.nav a:hover::before,
.nav a.active::before {
  width: 100%;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
}

/* ========== زر القائمة للموبايل المحسن ========== */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid rgba(0, 170, 255, 0.3);
  background: rgba(0, 170, 255, 0.1);
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
  background: rgba(0, 170, 255, 0.2);
  border-color: rgba(0, 170, 255, 0.5);
  transform: scale(1.05);
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--secondary-light));
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.menu-toggle.active {
  background: rgba(0, 170, 255, 0.2);
  border-color: rgba(0, 170, 255, 0.7);
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background: var(--accent);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background: var(--accent);
}

/* تأثير عند النقر */
.menu-toggle:active {
  transform: scale(0.95);
}

/* شريط التقدم */
.progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  width: 0%;
  transition: width 0.3s ease;
}

/* ========== سهم العودة للأعلى - نسخة محسنة ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 170, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  animation: float 3s ease-in-out infinite;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 170, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
}

.back-to-top i {
  transition: transform 0.3s ease;
}

.back-to-top:hover i {
  transform: translateY(-3px);
}

/* تأثير تموج عند الظهور */
@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 170, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 170, 255, 0);
  }
}

.back-to-top.visible {
  animation: float 3s ease-in-out infinite, ripple 2s ease-out infinite;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInDown {
  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);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1100px) {
  .header-container {
    padding: 12px 25px;
  }
}

@media (max-width: 900px) {
  .header-container {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .menu-toggle {
    display: flex !important;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background: rgba(5, 5, 6, 0.98);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0, 170, 255, 0.1);
    transition: max-height 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }
  
  .nav.open {
    max-height: 400px !important;
    padding: 15px 0;
  }

  .nav ul {
    flex-direction: column !important;
    gap: 10px;
    text-align: center;
    padding: 0 20px !important;
    margin: 0 !important;
    display: flex !important;
  }

  .nav li {
    width: 100%;
    list-style: none;
  }

  .nav a {
    display: block;
    padding: 15px;
    font-size: 18px;
    border-radius: 10px;
    margin: 5px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
  }

  .nav a:hover {
    background: rgba(0, 170, 255, 0.1);
    border-color: rgba(0, 170, 255, 0.3);
    transform: translateX(-5px);
  }
  
  .back-to-top {
    left: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
}

/* للشاشات الأكبر من 900px */
@media (min-width: 901px) {
  .nav {
    max-height: none !important;
    overflow: visible !important;
    position: relative;
    top: 0;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    box-shadow: none;
  }
  
  .nav ul {
    flex-direction: row !important;
    padding: 0 !important;
  }
  
  .menu-toggle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 10px 16px;
  }

  .logo {
    width: 42px;
    height: 42px;
  }

  .logo-text {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .menu-toggle {
    width: 45px;
    height: 45px;
    padding: 10px;
  }
  
  .menu-toggle span {
    width: 22px;
    height: 2.5px;
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  
  .back-to-top {
    left: 15px;
    bottom: 15px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .header-container {
    padding: 10px 15px;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
  
  .menu-toggle {
    width: 40px;
    height: 40px;
    padding: 8px;
  }
  
  .menu-toggle span {
    width: 20px;
    height: 2px;
  }
  
  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 18px;
    left: 12px;
    bottom: 12px;
  }
}

/* ========== تحسينات إمكانية الوصول ========== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px;
  z-index: 10000;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* تحسينات للأجهزة اللمسية */
@media (hover: none) and (pointer: coarse) {
  .menu-toggle {
    -webkit-tap-highlight-color: transparent;
  }
  
  .nav a {
    -webkit-tap-highlight-color: rgba(0, 170, 255, 0.3);
  }
  
  .back-to-top {
    -webkit-tap-highlight-color: transparent;
  }
  
  .back-to-top:active {
    transform: scale(0.95);
  }
}