/* =========================================
   COSMIC BALL SORT - GLOBAL CSS
========================================= */

:root {
  --bg-dark: #0a011d;
  --bg-deep: #050010;
  --neon-blue: #00f0ff;
  --neon-purple: #ba68c8;
  --neon-yellow: #ffd600;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at center, var(--bg-dark) 0%, var(--bg-deep) 100%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* RTL Support for Arabic */
html[dir="rtl"] {
  text-align: right;
}

/* Cosmic Background Stars */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.3;
  z-index: -1;
  animation: starsAnim 100s linear infinite;
}

@keyframes starsAnim {
  from { transform: translateY(0); }
  to { transform: translateY(-1000px); }
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(10, 1, 29, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: white;
}

.logo-container img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 0 15px var(--neon-blue);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffffff, var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Language Selector */
.lang-selector {
  position: relative;
}

.lang-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 0;
  width: 150px;
  display: none;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-menu.show {
  display: flex;
}

.lang-menu button {
  background: none;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
}

html[dir="rtl"] .lang-menu button {
  text-align: right;
}

.lang-menu button:hover {
  background: var(--glass-bg);
  color: var(--neon-blue);
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  min-height: 80vh;
}

.hero-icon {
  width: 180px;
  height: 180px;
  border-radius: 40px;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
  margin-bottom: 30px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #fff, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* Download Buttons */
.download-badges {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  transition: 0.3s;
  box-shadow: var(--glass-shadow);
}

.btn-store svg {
  margin-right: 10px;
  width: 24px;
  height: 24px;
}

html[dir="rtl"] .btn-store svg {
  margin-right: 0;
  margin-left: 10px;
}

.btn-store.playstore:hover {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.btn-store.appstore:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

/* Features Grid */
.features {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-purple);
  box-shadow: 0 0 25px rgba(186, 104, 200, 0.2);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--neon-blue);
}

.card p {
  color: var(--text-muted);
}

/* Standard Pages (Privacy, Terms) */
.page-content {
  max-width: 800px;
  margin: 60px auto;
  padding: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.page-content h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--neon-blue);
}

.page-content h2 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--neon-purple);
}

.page-content p, .page-content li {
  color: var(--text-muted);
  margin-bottom: 15px;
}

.page-content ul {
  padding-left: 20px;
  margin-bottom: 20px;
}
html[dir="rtl"] .page-content ul {
  padding-left: 0;
  padding-right: 20px;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--glass-border);
  margin-top: 40px;
  background: rgba(10, 1, 29, 0.9);
}

.footer-links {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: var(--neon-blue);
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.footer-links a:hover {
  color: var(--neon-purple);
}

.copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  header { padding: 15px 20px; }
  .logo-text { font-size: 1.2rem; }
  .page-content { margin: 20px; padding: 20px; }
}
