/*
Theme Name: Fam Coders
Theme URI: https://famcoders.com
Author: Fam Coders Team
Author URI: https://famcoders.com
Description: Premium digital agency WordPress theme — Building Your Digital Future Together.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: Proprietary
License URI: https://famcoders.com/license
Text Domain: nexus-ai
Tags: dark, luxury, tech, agency, saas, rtl-language-support, full-width-template, custom-menu, post-thumbnails
*/

/* ============================================================
   DESIGN SYSTEM — CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Colors */
  --color-bg-primary:     #050811;
  --color-bg-secondary:   #080d1a;
  --color-bg-card:        rgba(255, 255, 255, 0.04);
  --color-bg-card-hover:  rgba(255, 255, 255, 0.08);

  --color-neon-primary:   #6c63ff;
  --color-neon-secondary: #00d4ff;
  --color-neon-accent:    #ff2d78;
  --color-neon-green:     #00ffaa;

  --color-text-primary:   #f0f4ff;
  --color-text-secondary: #8892b0;
  --color-text-muted:     #4a5568;

  --color-border:         rgba(108, 99, 255, 0.2);
  --color-border-hover:   rgba(108, 99, 255, 0.6);

  /* Gradients */
  --gradient-primary:   linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);
  --gradient-secondary: linear-gradient(135deg, #ff2d78 0%, #6c63ff 100%);
  --gradient-dark:      linear-gradient(180deg, #050811 0%, #080d1a 100%);
  --gradient-glow:      radial-gradient(ellipse at center, rgba(108, 99, 255, 0.15) 0%, transparent 70%);
  --gradient-hero:      radial-gradient(ellipse at 60% 50%, rgba(108, 99, 255, 0.2) 0%, rgba(0, 212, 255, 0.08) 40%, transparent 70%);

  /* Glass Effect */
  --glass-bg:           rgba(255, 255, 255, 0.04);
  --glass-border:       1px solid rgba(255, 255, 255, 0.1);
  --glass-blur:         backdrop-filter: blur(20px);
  --glass-shadow:       0 8px 32px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-primary:  'Cairo', 'Inter', sans-serif;
  --font-heading:  'Cairo', 'Space Grotesk', sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-6xl:   3.75rem;
  --text-7xl:   4.5rem;

  --font-light:    300;
  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-black:    900;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Border Radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.75rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-2xl:  2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-neon-primary:   0 0 20px rgba(108, 99, 255, 0.4), 0 0 40px rgba(108, 99, 255, 0.2);
  --shadow-neon-secondary: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 40px rgba(0, 212, 255, 0.2);
  --shadow-neon-accent:    0 0 20px rgba(255, 45, 120, 0.4);
  --shadow-card:           0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-card-hover:     0 12px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(108, 99, 255, 0.15);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.3s ease;
  --transition-slow:   0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-nav:     1000;
  --z-top:     9999;

  /* Layout */
  --container-max: 1280px;
  --container-pad: clamp(1rem, 5vw, 3rem);
  --navbar-height: 80px;

  /* Section spacing */
  --section-py: clamp(4rem, 10vw, 8rem);
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  direction: rtl;
}

body.ltr {
  direction: ltr;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  color: var(--color-text-secondary);
  line-height: 1.8;
}

a {
  color: var(--color-neon-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-neon-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--color-neon-primary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-neon-secondary);
}

/* ---- SELECTION ---- */
::selection {
  background: rgba(108, 99, 255, 0.3);
  color: var(--color-text-primary);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}

.section-py {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

/* ---- GLASS CARD ---- */
.glass-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-hover);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition: all var(--transition-spring);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-primary:hover {
  box-shadow: var(--shadow-neon-primary);
  transform: translateY(-2px) scale(1.02);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-hover);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-secondary:hover {
  border-color: var(--color-neon-primary);
  color: var(--color-neon-primary);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-neon-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-neon-primary);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ---- SECTION HEADER ---- */
.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-header .badge {
  margin-bottom: var(--space-4);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--text-lg);
}

/* ---- DIVIDER ---- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: var(--space-4) auto;
}

/* ---- NEON GLOW ELEMENT ---- */
.neon-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: float-glow 8s ease-in-out infinite;
}

@keyframes float-glow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-20px) scale(1.05); }
}

/* ---- GRID LAYOUTS ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-neon-primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: var(--z-top);
  transition: top var(--transition-fast);
  font-weight: var(--font-semibold);
}
.skip-link:focus { top: var(--space-4); color: white; }

/* ---- LOADING STATE ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-primary);
  z-index: var(--z-top);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(108, 99, 255, 0.2);
  border-top-color: var(--color-neon-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- RESPONSIVE GRID ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   WORDPRESS CORE CLASSES
   ============================================================ */
.wp-block-image img { border-radius: var(--radius-lg); }
.alignleft  { float: left; margin: 0 var(--space-6) var(--space-4) 0; }
.alignright { float: right; margin: 0 0 var(--space-4) var(--space-6); }
.aligncenter { display: block; margin: 0 auto var(--space-4); }
.alignwide  { max-width: 100%; }
.alignfull  { max-width: 100vw; margin-inline: calc(-1 * var(--container-pad)); }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; padding-top: var(--space-2); }

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sticky { position: sticky; }
.bypostauthor { border-right: 3px solid var(--color-neon-primary); }

/* WordPress menu highlighted item */
.current-menu-item > a,
.current-page-ancestor > a,
.current-menu-ancestor > a {
  color: var(--color-neon-primary) !important;
}

/* WordPress comments */
#comments { margin-top: var(--space-16); }
.comment-list { list-style: none; padding: 0; }
.comment { margin-bottom: var(--space-8); padding: var(--space-6); background: var(--glass-bg); border: var(--glass-border); border-radius: var(--radius-xl); }
.comment-author { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.comment-author img { border-radius: 50%; width: 48px; height: 48px; }

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.pagination a:hover,
.pagination .current {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-neon-primary);
}

/* Clearfix */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}
