/* --- متغيرات الثيم --- */
:root {
  --bg-color: #050010;
  --text-color: #ffffff;
  --accent-color: #00f0ff;
  --navbar-bg: rgba(10, 0, 30, 0.92);
  --navbar-scrolled-bg: rgba(5, 0, 20, 0.98);
  --glass-bg: rgba(0, 240, 255, 0.03);
  --glass-border: rgba(0, 240, 255, 0.15);
  --shadow-color: rgba(0, 240, 255, 0.4);
  --text-secondary: #8bf8ff;
  --gradient: linear-gradient(135deg, #00f0ff, #c158dc);
}

.theme-purple {
  --bg-color: #0d0225;
  --text-color: #ffffff;
  --accent-color: #7f5af0;
  --navbar-bg: rgba(28, 0, 65, 0.88);
  --navbar-scrolled-bg: rgba(18, 0, 40, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow-color: rgba(127, 90, 240, 0.55);
  --text-secondary: #b8a3ff;
  --gradient: linear-gradient(135deg, #a78bfa, #7f5af0, #6c2bd9);
}

/* --- إعداد عام --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  direction: rtl;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* --- شاشة التحميل --- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen p {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.loading-logo {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: pulse 2s infinite;
}

.loading-logo .logo-text {
  background: var(--gradient);
  color: var(--text-color);
  padding: 0.5rem 1.2rem;
  border-radius: 1.4rem;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 0 1rem var(--shadow-color);
}

.loader {
  width: 3rem;
  height: 3rem;
  border: 0.25rem solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* --- خلفية النجوم --- */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  z-index: -1;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  animation: fall linear infinite;
  opacity: 0.85;
  filter: drop-shadow(0 0 0.1rem rgba(255, 255, 255, 0.7));
}
.star.pink {
  background: #ff79c6;
}
.star.blue {
  background: #8be9fd;
}
.star.purple {
  background: #bd93f9;
}

@keyframes fall {
  0% {
    transform: translateY(-10vh);
  }
  100% {
    transform: translateY(110vh);
    opacity: 0;
  }
}

/* --- تأثير الزجاج --- */
.glass {
  background: var(--glass-bg);
  border-radius: 1rem;
  backdrop-filter: blur(0.75rem);
  border: 0.0625rem solid var(--glass-border);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

/* --- شريط التنقل --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--navbar-bg);
  z-index: 1000;
  padding: 0.5rem 1rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.4);
  transition: all 0.5s ease;
  box-sizing: border-box;
  overflow-x: hidden;
  backdrop-filter: blur(0.625rem);
}

.navbar.scrolled {
  background: var(--navbar-scrolled-bg);
  padding: 0.3rem 1rem;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.5);
}

.navbar-content {
  max-width: 68.75rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.9375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.navbar-center {
  flex-grow: 1;
  text-align: center;
}

.navbar-icon {
  font-size: 1.5rem;
  color: var(--accent-color);
  animation: pulse 2s ease-in-out infinite;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-text {
  background: var(--gradient);
  color: var(--text-color);
  padding: 0.375rem 1.125rem;
  border-radius: 1.75rem;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 0 1.25rem var(--shadow-color);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.logo:hover .logo-text {
  transform: scale(1.08);
  box-shadow: 0 0 1.875rem var(--shadow-color);
}

/* --- زر الإعدادات --- */
.settings {
  position: relative;
  flex-shrink: 0;
}

.settings-btn {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.settings-btn:hover,
.settings-btn:focus {
  transform: scale(1.1);
  box-shadow: 0 0 1.25rem var(--shadow-color);
}

/* --- شريط الإعدادات الجانبي --- */
.settings-sidebar {
  position: fixed;
  top: 0;
  left: -18.75rem;
  width: 18.75rem;
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(0.75rem);
  border-right: 0.0625rem solid var(--glass-border);
  box-shadow: 0.3125rem 0 0.9375rem rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.settings-sidebar.active {
  left: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
  padding: 0.9375rem;
  margin-bottom: 1.25rem;
}

.user-avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  border: 0.125rem solid var(--accent-color);
}

.user-name {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
}

.settings-link {
  padding: 0.625rem 0.9375rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.settings-link:hover {
  background: var(--accent-color);
  color: var(--text-color);
  border-radius: 0.5rem;
}

.settings-divider {
  border: 0;
  height: 0.0625rem;
  background: var(--gradient);
  margin: 0.625rem 0;
}

/* --- زر تغيير الثيم --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.9375rem;
}

.theme-toggle label {
  font-size: 1rem;
  color: var(--text-color);
}

.theme-switch {
  width: 3.75rem;
  height: 1.875rem;
  background: var(--gradient);
  border-radius: 0.9375rem;
  position: relative;
  cursor: pointer;
  border: 0.0625rem solid var(--glass-border);
}

.theme-slider {
  width: 1.625rem;
  height: 1.625rem;
  background: var(--accent-color);
  border-radius: 50%;
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.theme-switch.active .theme-slider {
  transform: translateX(-1.875rem);
  background: #3498db; /* لون الثيم الأزرق */
}

/* --- الواجهة الرئيسية --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1rem;
  text-align: center;
}

.hero {
  max-width: 33.75rem;
  padding: 1.5rem 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 0 2.5rem var(--shadow-color);
  animation: fadeIn 1s ease-out;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 0.625rem var(--shadow-color);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* أزرار الاختيار */
.button-group {
  display: flex;
  gap: 1.125rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  min-width: 7.5rem;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 1.875rem;
  border: none;
  background: var(--gradient);
  color: var(--text-color);
  cursor: pointer;
  box-shadow: 0 0 1.25rem var(--shadow-color);
  transition: all 0.25s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.action-btn:hover,
.action-btn:focus {
  transform: scale(1.05);
  box-shadow: 0 0 1.875rem var(--shadow-color);
  outline: none;
}

.action-btn:active {
  transform: scale(0.95);
}

.secondary {
  background: rgba(68, 68, 68, 0.67);
  box-shadow: none;
}

.secondary:hover,
.secondary:focus {
  background: #555;
  box-shadow: none;
}

/* --- تسجيل الدخول --- */
.login-section {
  max-width: 25rem;
  margin: 4rem auto 3rem;
  padding: 1.5rem 1.25rem;
  border-radius: 1.25rem;
  box-shadow: 0 0 2.1875rem var(--shadow-color);
  text-align: center;
  color: var(--text-color);
  font-size: 0.9rem;
  animation: slideUp 0.8s ease;
}

.login-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-section input {
  width: 100%;
  padding: 0.625rem 0.9375rem;
  margin-bottom: 1rem;
  border-radius: 0.625rem;
  border: none;
  background: var(--glass-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.login-section input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.login-section input:focus {
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  box-shadow: 0 0 0.5rem var(--shadow-color);
}

.social-login {
  margin: 1.2rem 0;
  display: flex;
  justify-content: center;
  gap: 0.9375rem;
}

.social-btn {
  width: 2.8125rem;
  height: 2.8125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.social-btn:hover {
  transform: scale(1.1);
}

.fb-btn {
  background: #3b5998;
}

.google-btn {
  background: #dd4b39;
}

.twitter-btn {
  background: #1da1f2;
}

.forgot-password {
  display: block;
  margin-top: 0.625rem;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* مخفي */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- الفوتر --- */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  user-select: none;
  background: var(--navbar-bg);
  backdrop-filter: blur(0.3125rem);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* --- استجابة لجميع الأجهزة --- */
@media (max-width: 600px) {
  .navbar {
    padding: 0.3rem 0.6rem;
  }
  .navbar-content {
    gap: 0.625rem;
  }
  .logo-text {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
  }
  .logo i {
    font-size: 0.75rem;
  }
  .navbar-icon {
    font-size: 1rem;
  }
  .settings-btn {
    font-size: 0.9rem;
    padding: 0.3125rem;
  }
  .settings-sidebar {
    width: 15rem;
  }
  .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
  }
  .user-name {
    font-size: 0.9rem;
  }
  .theme-switch {
    width: 3rem;
    height: 1.5rem;
  }
  .theme-slider {
    width: 1.25rem;
    height: 1.25rem;
    top: 0.125rem;
  }
  .theme-switch.active .theme-slider {
    transform: translateX(-1.5rem);
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 0.9rem;
  }
  .button-group {
    flex-direction: column;
    gap: 0.625rem;
  }
  .action-btn {
    min-width: 6.25rem;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  .login-section {
    max-width: 18.75rem;
    margin: 2rem auto;
    padding: 1rem;
  }
  .login-section h2 {
    font-size: 1.5rem;
  }
  .login-section input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  .social-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .navbar {
    padding: 0.4rem 0.8rem;
  }
  .navbar-content {
    gap: 0.75rem;
  }
  .logo-text {
    font-size: 0.875rem;
    padding: 0.1875rem 0.625rem;
  }
  .logo i {
    font-size: 0.875rem;
  }
  .navbar-icon {
    font-size: 1.2rem;
  }
  .settings-btn {
    font-size: 1rem;
    padding: 0.375rem;
  }
  .settings-sidebar {
    width: 16.25rem;
  }
  .user-avatar {
    width: 3rem;
    height: 3rem;
  }
  .user-name {
    font-size: 1rem;
  }
  .theme-switch {
    width: 3.25rem;
    height: 1.625rem;
  }
  .theme-slider {
    width: 1.375rem;
    height: 1.375rem;
    top: 0.125rem;
  }
  .theme-switch.active .theme-slider {
    transform: translateX(-1.625rem);
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .action-btn {
    min-width: 7rem;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
  }
  .login-section {
    max-width: 22.5rem;
  }
}

@media (min-width: 1025px) {
  .navbar {
    padding: 0.5rem 1rem;
  }
  .navbar-content {
    gap: 0.9375rem;
  }
  .logo-text {
    font-size: 1rem;
    padding: 0.25rem 0.75rem;
  }
  .logo i {
    font-size: 1rem;
  }
  .navbar-icon {
    font-size: 1.5rem;
  }
  .settings-btn {
    font-size: 1.2rem;
    padding: 0.5rem;
  }
  .settings-sidebar {
    width: 18.75rem;
  }
  .user-avatar {
    width: 3.75rem;
    height: 3.75rem;
  }
  .user-name {
    font-size: 1.2rem;
  }
  .theme-switch {
    width: 3.75rem;
    height: 1.875rem;
  }
  .theme-slider {
    width: 1.625rem;
    height: 1.625rem;
    top: 0.125rem;
  }
  .theme-switch.active .theme-slider {
    transform: translateX(-1.875rem);
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1.125rem;
  }
  .action-btn {
    min-width: 7.5rem;
    padding: 0.75rem 1.5rem;
  }
  .login-section {
    max-width: 25rem;
  }
}

/* --- الرسوم المتحركة --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* --- محتوى إضافي --- */
.features-section {
  max-width: 68.75rem;
  margin: 4rem auto;
  padding: 0 1rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: 1.5625rem;
}

.feature-card {
  background: var(--glass-bg);
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(0.3125rem);
  border: 0.0625rem solid var(--glass-border);
}

.feature-card:hover {
  transform: translateY(-0.625rem);
  box-shadow: 0 0.625rem 1.875rem var(--shadow-color);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.625rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.625rem;
  color: var(--accent-color);
}

.feature-description {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* منع تكبير النص في جميع الأجهزة */
.navbar,
.navbar * {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}