/* Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Color Scheme */
:root {
  --primary: #4A6FA5;      /* Muted Blue from logo */
  --primary-light: #5D8BF4;
  --primary-dark: #2E4374;
  --secondary: #8B5A2B;    /* Brown from logo */
  --secondary-light: #A67C52;
  --dark: #090909;        /* Even darker background */
  --darker: #050505;      /* Near-black for contrast */
  --light: #F5F5F5;       /* Lighter text for more contrast */
  --gray: #A0A0A0;        /* Secondary text */
  --light-gray: #232323;   /* Light elements on dark */
  --card-bg: #141414;     /* Darker card background */
  --border-color: #222;   /* Border color */
}

/* RTL Support */
[dir="rtl"] {
  font-family: 'Tajawal', 'Poppins', sans-serif;
  text-align: right;
}

/* Base Styles */
body {
  --text-primary: var(--light);
  --text-secondary: var(--gray);
  --bg-primary: var(--dark);
  --bg-secondary: var(--darker);
  --card-bg: var(--card-bg);
  --border-color: var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Dark theme is now default */
body.light {
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --bg-primary: #f8f9fa;
  --bg-secondary: #e9ecef;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
}

/* Theme Colors */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.hover\:bg-primary:hover { background-color: var(--primary); }
.border-primary { border-color: var(--primary); }

.text-secondary { color: var(--secondary); }
.bg-secondary { background-color: var(--secondary); }
.hover\:bg-secondary:hover { background-color: #e65c2e; }
.border-secondary { border-color: var(--secondary); }

/* Buttons */
.btn-primary, .btn-secondary, #language-switcher {
  padding: 0.75rem 2rem !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  border: none !important;
  outline: none !important;
  display: inline-block;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.btn-primary {
  background-color: #2563eb !important;
  color: #fff !important;
}
.btn-primary:hover {
  background-color: #1742a0 !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(37,99,235,0.18);
}

.btn-secondary {
  background-color: #ff9800 !important;
  color: #fff !important;
}
.btn-secondary:hover {
  background-color: #c66900 !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(255,152,0,0.18);
}

#language-switcher {
  background-color: #23272f !important;
  color: #fff !important;
  border: none !important;
}
#language-switcher:hover {
  background-color: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(37,99,235,0.18);
}

/* Navigation */
.nav-link {
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--primary);
  background-color: rgba(74, 111, 165, 0.1);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active:after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Sections */
section {
  padding: 5rem 1rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0a0a0a 0%, #181818 100%) !important;
  color: #fff !important;
  padding: 8rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  color: #e0e0e0;
  max-width: 600px;
}

/* Service Cards */
.service-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border-color: var(--primary);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card i {
  font-size: 3rem;
  color: #6daaff;
  margin-bottom: 1.5rem;
  background: none;
  width: auto;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.3s, color 0.3s, filter 0.3s;
  margin-left: auto;
  margin-right: auto;
  filter: brightness(1.3) contrast(1.3);
}

.service-card:hover i {
  transform: scale(1.15) rotate(-2deg);
  color: #ffb347;
  filter: brightness(1.5) contrast(1.5);
}

/* Ticks for support/expert */
.fa-check {
  color: #00FFB2 !important;
  font-size: 1.5rem !important;
  filter: brightness(1.2) contrast(1.3);
  text-shadow: 0 0 8px #00FFB2, 0 0 2px #fff;
}

/* Global text and icon brightness/contrast */
body, h1, h2, h3, h4, h5, h6, p, span, a, li, label, .nav-link, .btn-primary, .btn-secondary, .service-card i {
  filter: brightness(1.05) contrast(1.1);
}

.service-card h3 {
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--light);
}

.service-card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.service-card:hover h3::after {
  width: 80px;
}

[dir="rtl"] .service-card h3::after {
  left: auto;
  right: 0;
}

.service-card p {
  color: var(--gray);
  line-height: 1.7;
  margin-top: auto;
}

/* Animation for service cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

/* Gradient Text */
.text-gradient {
  background: linear-gradient(90deg, #5D8BF4 0%, #8B5A2B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline;
  position: relative;
  z-index: 1;
}

/* Fix for text gradient in dark mode */
.dark .text-gradient {
  background: linear-gradient(90deg, #6d9cff 0%, #c28a4a 100%);
}

/* Ensure text is visible on all backgrounds */
h1 .text-gradient,
h2 .text-gradient,
h3 .text-gradient {
  padding: 0 2px;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline;
}

/* Clients Section */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.client-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 100px;
}

.client-logo img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    filter: grayscale(100%) brightness(0.8);
    transition: all 0.3s ease;
    opacity: 0.8;
}

.client-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.client-logo:hover img {
    filter: grayscale(0) brightness(1);
    opacity: 1;
}

/* Form Elements */
input, textarea, select {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  width: 100%;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.3);
}

/* Footer */
footer {
  background-color: var(--darker);
  color: var(--gray);
  padding: 4rem 1rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Utility Classes */
.bg-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  section {
    padding: 3rem 1rem;
  }
  
  .hero {
    padding: 5rem 1rem;
  }
}

/* Language Switcher */
#language-switcher {
  border: 1px solid var(--primary);
  color: var(--primary);
  transition: all 0.3s ease;
}

#language-switcher:hover {
  background-color: var(--primary);
  color: white;
}

[dir="rtl"] .en-lang,
[dir="ltr"] .ar-lang {
  display: none;
}

[dir="rtl"] .ar-lang,
[dir="ltr"] .en-lang {
  display: inline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation */
.nav-scrolled {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    padding-top: 8rem;
    padding-bottom: 6rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Button Hover Effects */
.btn-hover {
    transition: all 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding-top: 6rem;
        padding-bottom: 4rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Animation Keyframes */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Section Spacing */
section {
    padding: 6rem 1rem;
}

/* Form Styles */
.form-input {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom Checkbox */
.custom-checkbox input:checked + .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox input:checked + .checkmark:after {
    display: block;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #2563eb;
    transform: translateY(-3px);
}

body, section, .hero, .service-card, .card {
  background-color: #000 !important;
  color: var(--text-primary) !important;
}

.text-gradient {
  background: linear-gradient(90deg, #5D8BF4, #8B5A2B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Standard property for text color */
  filter: brightness(1.2) contrast(1.2);
}

h1, h2, h3, h4, h5, h6, p, span, a, li, label, .nav-link, .btn-primary, .btn-secondary {
  color: var(--text-primary) !important;
}

.text-gray-300, .text-gray-400, .text-gray-500 {
  color: #cccccc !important;
}

.max-w-7xl, .mx-auto {
  background: transparent !important;
}

.cta-btn {
  background-color: #2563eb !important;
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  font-size: 1.25rem;
  transition: background 0.3s, color 0.3s;
  display: inline-block;
}

.cta-btn:hover {
  background-color: #1742a0 !important;
  color: #fff !important;
}

#splash-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #050505;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s, clip-path 0.8s;
}
#nit-logo {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.7s, transform 0.7s;
}

.hero-reveal {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
  opacity: 0;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-60px);
}
.slide-in-right {
  opacity: 0;
  transform: translateX(60px);
}
.fade-in-section {
  opacity: 0;
  transform: translateY(40px);
}

/* Parallax background container */
.parallax-bg {
  position: relative;
  overflow: hidden;
}
.parallax-bg-inner {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 120%;
  z-index: 0;
  will-change: transform;
  pointer-events: none;
}

/* 3D Card Tilt */
.card-tilt {
  transition: transform 0.25s cubic-bezier(.25,.46,.45,.94), box-shadow 0.25s;
  will-change: transform;
  perspective: 800px;
}
.card-tilt:hover {
  box-shadow: 0 8px 32px rgba(37,99,235,0.18), 0 1.5px 8px rgba(0,0,0,0.10);
}

/* Button Ripple */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  background: rgba(255,255,255,0.4);
  pointer-events: none;
  z-index: 2;
}
@keyframes ripple-effect {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Icon Animation */
.icon-animate {
  transition: transform 0.3s, filter 0.3s;
}
.icon-animate:hover {
  transform: rotate(-12deg) scale(1.18);
  filter: brightness(1.3) drop-shadow(0 2px 8px #2563eb44);
}

/* Typewriter */
.typewriter {
  display: inline-block;
  border-right: 2px solid #fff;
  white-space: nowrap;
  overflow: hidden;
  animation: typing 2.2s steps(30, end), blink-caret 0.7s step-end infinite;
  font-family: inherit;
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink-caret {
  0%, 100% { border-color: transparent; }
  50% { border-color: #fff; }
}

/* Fix hero section layout */
.hero .md\:flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.hero .md\:w-1\/2 {
  width: 50%;
  min-width: 320px;
}
@media (max-width: 768px) {
  .hero .md\:flex {
    flex-direction: column;
  }
  .hero .md\:w-1\/2 {
    width: 100%;
    min-width: 0;
  }
}

/* Undo forced max-width/flex-basis and background for hero text */
.hero .md\:w-1\/2:first-child {
  z-index: 2;
  position: relative;
  padding-right: 2.5rem;
  min-width: 320px;
  overflow-wrap: break-word;
  max-width: unset;
  flex-basis: unset;
}
.hero .md\:w-1\/2:last-child {
  z-index: 3;
  position: relative;
  max-width: unset;
}
.hero h1 span {
  background: none;
  padding: 0;
  box-decoration-break: unset;
}
@media (max-width: 1024px) {
  .hero .md\:w-1\/2:first-child {
    padding-right: 0.5rem;
    max-width: unset;
  }
  .hero .md\:w-1\/2:last-child {
    max-width: unset;
  }
}
@media (max-width: 768px) {
  .hero .md\:w-1\/2:first-child {
    padding-right: 0;
    margin-bottom: 2rem;
    max-width: unset;
  }
  .hero .md\:w-1\/2:last-child {
    margin-top: 0;
    max-width: unset;
  }
}

/* Remove animation fallback override so animations can work */
.fade-in-section,
.slide-in-left,
.slide-in-right,
.hero-reveal,
.fade-in-up {
  opacity: unset !important;
  transform: unset !important;
  clip-path: unset !important;
}
