/* ========================================
   CYBERX — GLOBAL STYLESHEET
   ======================================== */

/* ---- CSS Variables ---- */
:root {
  --primary: #00f0ff;
  --secondary: #7b2ff7;
  --accent: #00ff88;
  --accent-red: #ff3860;
  --darker: #030014;
  --dark: #0a0a1a;
  --card-bg: #0d0d2b;
  --border: rgba(0, 240, 255, 0.08);
  --text: #e0e0e0;
  --text-muted: #8888a0;
  --text-heading: #ffffff;
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --header-h: 80px;
  --radius: 12px;
  --transition: 0.3s ease;
  --header-bg: rgba(3, 0, 20, 0.8);
}

/* Light Theme Variables */
html.light-theme {
  --darker: #f0f2f5;
  --dark: #ffffff;
  --card-bg: #ffffff;
  --border: rgba(0, 100, 255, 0.1);
  --text: #1a1a2e;
  --text-muted: #5e5e7a;
  --text-heading: #030014;
  --header-bg: rgba(255, 255, 255, 0.8);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  background: var(--darker);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  cursor: default;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img,
svg {
  max-width: 100%;
  display: block;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

section {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-heading);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

h4 {
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.light-theme .text-gradient {
  background: linear-gradient(135deg, #0088dd, #5500aa);
  background-clip: text;
  -webkit-background-clip: text;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0, 240, 255, 0.25);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.btn-glow {
  animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  }

  50% {
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.35), 0 0 80px rgba(123, 47, 247, 0.15);
  }
}

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header.scrolled {
  background: var(--dark);
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  height: 70px;
}

.header>.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 42px;
  height: 42px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

.logo-text .cyber {
  color: var(--text-heading);
}

.logo-text .x {
  color: var(--primary);
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: auto;
  margin-right: 40px;
}

.nav-links {
  display: flex;
  gap: 5px;
}

.nav-links>li {
  position: relative;
}

.nav-links>li>a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  transition: var(--transition);
  border-radius: 8px;
}

.nav-links>li>a:hover,
.nav-links>li>a.active {
  color: var(--primary);
  background: rgba(0, 240, 255, 0.04);
}

.dropdown-arrow {
  font-size: 0.55rem;
  transition: var(--transition);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
}

.nav-links>li:hover .dropdown-menu,
.nav-links>li.dropdown-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-links>li:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: rgba(0, 240, 255, 0.05);
  color: var(--primary);
}

.dropdown-menu a i {
  width: 18px;
  text-align: center;
  color: var(--primary);
}

.theme-toggle,
.globe-btn,
.dir-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0.85rem;
}

.theme-toggle:hover,
.globe-btn:hover,
.dir-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 240, 255, 0.04);
}

.theme-toggle .fa-sun {
  display: none;
}

body.light-theme .theme-toggle .fa-moon,
html.light-theme .theme-toggle .fa-moon {
  display: none;
}

body.light-theme .theme-toggle .fa-sun,
html.light-theme .theme-toggle .fa-sun {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.05);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  border-color: transparent;
}

.mobile-only {
  display: none;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
  border-radius: 2px;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Card ---- */
.cyber-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: var(--transition);
}

.cyber-card:hover {
  border-color: rgba(0, 240, 255, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* ---- Glitch Effect ---- */
.glitch {
  position: relative;
}

@keyframes glitch1 {

  0%,
  100% {
    clip-path: inset(0 0 95% 0);
    transform: translate(-2px);
  }

  25% {
    clip-path: inset(30% 0 40% 0);
    transform: translate(2px);
  }

  50% {
    clip-path: inset(60% 0 10% 0);
    transform: translate(-1px);
  }

  75% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(1px);
  }
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---- Particles ---- */
.particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* ---- Scan Line ---- */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scanLine 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes scanLine {

  0%,
  100% {
    top: 0;
    opacity: 0;
  }

  50% {
    top: 100%;
    opacity: 0.5;
  }
}

/* ---- Grid BG ---- */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ---- Counter ---- */
.counter-value {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Typing Cursor ---- */
.typing-cursor::after {
  content: '|';
  animation: cursorBlink 0.7s step-end infinite;
  color: var(--primary);
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ---- Hex Pattern ---- */
.hex-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 0l30 17.3v34.6L30 52 0 34.6V17.3z' fill='none' stroke='%2300f0ff' stroke-width='0.5'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

/* ---- Preloader ---- */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--darker);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-inner {
  text-align: center;
}

.preloader-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.preloader-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
}

/* ---- Footer ---- */
.footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 80px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 15px;
  font-size: 0.95rem;
}

.footer-brand .logo {
  margin-bottom: 5px;
}

.footer-socials {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-socials a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 0.9rem;
}

.footer-socials a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 240, 255, 0.04);
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  color: var(--primary);
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 5px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-contact i {
  color: var(--primary);
  margin-top: 3px;
  width: 16px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

/* ---- Cursor Glow ---- */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out;
}

/* ---- RTL ---- */
[dir="rtl"] .nav-links {
  direction: rtl;
}

[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 5px;
}

[dir="rtl"] .hero-content,
[dir="rtl"] .about-content {
  text-align: right;
}

/* ---- Responsive Header Spacing (1024px range) ---- */
@media (min-width: 992px) and (max-width: 1200px) {
  .header>.container {
    padding: 0 40px;
    /* Force safe margin from screen edges */
    width: 100%;
    max-width: 100%;
  }

  .nav {
    margin-left: 20px;
    gap: 12px;
    /* Optimize space usage */
    margin-right: 20px;
  }

  .nav-links {
    gap: 2px;
    /* Tighter gap at this resolution */
  }

  .nav-links>li>a {
    padding: 10px 12px;
    /* Shorter padding */
    white-space: nowrap;
    /* Prevent wrapping */
  }

  .header-actions {
    display: flex;
    align-items: center;
    margin-right: 35px;
    gap: 10px;
  }

  .login-btn {
    padding: 6px 14px;
    font-size: 0.65rem;
    height: 38px;
    /* Match height of other icon buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
  }
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .nav {
    display: none;
  }

  .nav.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-h));
    background: rgba(3, 0, 20, 0.98);
    padding: 30px;
    gap: 0;
    overflow-y: auto;
  }

  .nav.active .nav-links {
    flex-direction: column;
    width: 100%;
  }

  .nav.active .nav-links>li>a {
    padding: 15px;
    font-size: 0.9rem;
  }

  .nav.active .dropdown-menu {
    display: none;
    /* Hide by default on mobile sidebar */
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(0, 240, 255, 0.05);
    border: none;
    margin-top: 5px;
    padding: 5px 0;
  }

  .nav.active .dropdown-open .dropdown-menu {
    display: flex;
    flex-direction: column;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    margin-right: 15px;
  }

  .login-btn {
    padding: 6px 14px;
    font-size: 0.65rem;
  }

  .globe-btn,
  .dir-toggle {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .mobile-toggle {
    display: flex;
    z-index: 1001;
    /* Ensure it stays above nav */
  }

  .header-actions .login-btn {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .nav-login-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 15px;
    padding: 14px 20px !important;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000 !important;
    border-radius: 8px;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
  }

  .header-actions {
    margin-right: 8px;
    gap: 10px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  section {
    padding: 70px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    width: 92%;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--darker);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--secondary));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}