/*
=========================================================
* Premium DataArcus Stylesheet (Complete & Corrected Version)
*
* Main stylesheet for the DataArcus consultancy website.
* Incorporates all successful fixes for layout, RTL, and components.
=========================================================
*/

/* ===== 1. Root Variables & Global Styles ===== */
:root {
  --dk: #0a0f1c;
  --dk-2: #050a14;
  --dk-3: #1a1f2e;
  --lt: #f8fafc;
  --accent: #00d4ff;
  --accent-2: #40f3ff;
  --accent-3: #0084ff;
  --purple: #6c5ce7;
  --purple-2: #a29bfe;
  --green: #00cec9;
  --orange: #fd79a8;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

html, body {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-padding-top: 80px;
}

#hero{
  margin-top: -20px;
}

#services {
  margin-top: 20px;
}

#contact {
  margin-top: 20px;
}

body {
  background: var(--dk);
  color: #fff;
  overflow-x: hidden;
  position: relative;
}

/* ===== 2. Keyframe Animations ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.6), 0 0 60px rgba(0, 212, 255, 0.3); }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) translateX(50px); opacity: 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes loading-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes langPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}


/* ===== 3. Core Layout & Components ===== */

/* --- Navigation Bar --- */
.navbar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
  background: rgba(10, 15, 28, 0.75) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.nav-link {
  position: relative;
  font-weight: 500;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.8) !important;
}

.nav-link:hover {
  color: var(--accent) !important;
  transform: translateY(-2px);
  text-shadow: 0 0 10px currentColor;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: center;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* --- Buttons --- */
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #000;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: transform 0.5s;
  transform: translateX(-100%);
}

.btn-accent:hover::before {
  transform: translateX(100%);
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 212, 255, 0.4);
  color: #000;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  color: #fff;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 12px;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* --- Glassmorphism Cards (Base Style) --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.glass-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* --- Footer --- */
footer {
  background: var(--dk-2);
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  padding: 60px 0 30px 0;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* --- Footer Typography & Link Refinements --- */
footer .text-white-50 {
  color: rgba(255, 255, 255, 0.65) !important; /* Increase brightness from 50% to 65% */
}

footer a.text-white-50 {
  transition: all 0.3s ease;
}

footer a.text-white-50:hover {
  color: var(--accent) !important; /* Match main nav hover color */
  transform: translateX(3px);
}


/* ===== 4. Section-Specific Styles ===== */

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(64, 243, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 40% 60%, rgba(108, 92, 231, 0.1) 0%, transparent 40%),
    linear-gradient(135deg, var(--dk) 0%, var(--dk-2) 50%, var(--dk-3) 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero .lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
}

/* --- Tech Stack Section --- */
.tech-stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.tech-icon {
  font-size: 2rem;
  color: var(--accent);
  transition: all 0.3s ease;
}

/* --- Services Section --- */
.service-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #000;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  animation: glow 2s infinite;
}

/* --- Portfolio Section --- */
.portfolio-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.portfolio-card:hover {
  transform: translateY(-15px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  animation: glow 2s infinite;
}

.portfolio-image {
  height: 200px;
  background: linear-gradient(135deg, var(--dk-3), var(--dk-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 3rem;
  transition: all 0.3s ease;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.1);
}

/* THE FIX for Tech Pills layout */
.portfolio-card .card-body > div:has(.tech-pill) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; /* 8px spacing between pills */
}

.tech-pill {
  display: inline-block;
  background-color: rgba(0, 212, 255, 0.1);
  color: var(--accent-2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* --- About Section (Stats) --- */
.stat-number {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- FAQ Section (Accordion) --- */
.accordion-button {
  padding: 1.5rem;
  font-size: 1.1rem;
  border: none !important;
  box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
  background: rgba(0, 212, 255, 0.1) !important;
  color: var(--accent) !important;
}

.accordion-button::after {
  filter: brightness(0) invert(1);
}

.accordion-body {
  padding: 1.5rem;
  line-height: 1.7;
}

/* --- Call to Action (CTA) Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
}

/* --- Article & Project Page Styles --- */
.page-header {
    padding-top: 160px;
    padding-bottom: 80px;
}

.article-section {
  padding: 120px 0;
}

.article-header h1 {
  color: var(--accent);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

.article-body h2 {
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.article-body strong {
  color: #fff;
}

.article-body ol, .article-body ul {
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 1rem;
}


/* ===== 5. Forms & Inputs ===== */

/* --- Base Form Control Styles --- */
.form-control, .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  padding: 15px 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
}

.form-control:focus, .form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  color: #fff;
  outline: none;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-bottom: 8px;
}

.focused .form-label {
  color: var(--accent) !important;
  transform: translateY(-5px);
}

.form-control.is-valid {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 206, 201, 0.1);
}

.form-control.is-invalid {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(253, 121, 168, 0.1);
}

/* --- Custom Select Dropdown (Budget) --- */
.custom-select-wrapper {
  position: relative;
}

.custom-budget-select {
  appearance: none;
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  color: #fff !important;
  padding: 15px 20px !important;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
}

.custom-budget-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
  outline: none;
}

.custom-budget-select option {
  background: var(--dk-3);
  color: #fff;
}


/* ===== 6. Utility & Helper Classes ===== */

/* --- General Section Spacing --- */
section {
  padding: 120px 0;
  position: relative;
}

/* --- Icon Badge --- */
.icon-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #000;
  flex-shrink: 0;
}

/* --- Hover Effects --- */
.hover-accent:hover {
  color: var(--accent) !important;
  transition: color 0.3s ease;
}

/* --- Background & Loading Effects --- */
.interactive-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat 15s infinite linear;
}

.floating-element {
  position: absolute;
  pointer-events: none;
  opacity: 0.1;
  z-index: 1;
  animation: float 15s infinite ease-in-out;
}

.floating-1 { top: 20%; right: 10%; animation-duration: 15s; }
.floating-2 { bottom: 20%; left: 5%; animation-duration: 20s; animation-direction: reverse;}
.floating-3 { top: 60%; right: 5%; animation-duration: 18s; }

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dk);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(0, 212, 255, 0.2);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  animation: loading-shimmer 2s infinite;
}

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

::-webkit-scrollbar-track {
  background: var(--dk-2);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 4px;
}

/* FINAL GLOBAL FIX for Icon Spacing */
/* This targets containers with icons to create a gap between the icon and text */
div:has(> .icon-badge),
div:has(> i[class*="bi-"]:not(.tech-icon)),
li:has(> i[class*="bi-"]:not(.tech-icon)) {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

/* FINAL ADDITION: Add spacing for icons inside buttons */
.btn:has(> i[class*="bi-"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}


/* ===== 7. Third-Party Library Overrides ===== */

/* --- Animate on Scroll (AOS) --- */
[data-aos] {
  transition-duration: 0.8s !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}


/* ===== 8. Responsive Design (Mobile-First Adjustments) ===== */

/* FINAL FIX: Remove Bootstrap's default margin on the logo in RTL mobile view */

html[dir="rtl"] .navbar-brand {
  margin-right: 0 !important;
}


@media (max-width: 768px) {
  /* --- Performance Optimizations on Mobile --- */
  .floating-element,
  .particle,
  .interactive-bg {
    display: none !important;
  }

  [data-aos] {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }

  .glass-card:hover,
  .portfolio-card:hover,
  .service-card:hover,
  .btn-accent:hover,
  .btn-glass:hover,
  .nav-link:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* --- Layout & Spacing Adjustments --- */
  section {
    padding: 60px 0 !important;
  }

  .hero {
    padding-top: 100px !important;
    min-height: 80vh !important;
  }

  /* --- Typography Adjustments --- */
  .hero h1 {
    font-size: 2.5rem;
    line-height: 1.3;
  }

  .hero .lead {
    font-size: 1.1rem;
  }

  .stat-number {
    font-size: 2.0rem !important;
  }
  
  .article-body {
      font-size: 1rem;
  }

  /* --- Component Adjustments --- */
  .glass-card.p-4 {
    padding: 1.5rem !important;
  }

  .accordion-body {
    padding: 1rem !important;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .accordion-button {
    padding: 1rem !important;
    font-size: 1rem !important;
  }

  /* This selector targets any flex container that HAS a .tech-pill inside it */
  .d-flex:has(.tech-pill) {
    flex-direction: row !important;
  }

  /* This targets any flex container that HAS a filter button inside it */
  .d-flex:has(.btn-glass[data-filter]) {
    flex-direction: row !important;
  }
}


/* ===== 9. Accessibility & Print ===== */
.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media print {
  .floating-element,
  .loading-overlay,
  .interactive-bg {
    display: none !important;
  }
}

/* ===== 10. Blog Page & Other Specific Styles ===== */
.certification-container {
  display: flex;
  align-items: center;
}

.certification-container iframe {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.certification-container:hover iframe {
  transform: scale(1.02);
}

@media (max-width: 576px) {
  .certification-container {
    align-self: center;
  }
}

.btn-glass.active {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.btn-glass.active:hover {
  background: rgba(0, 212, 255, 0.3);
  color: var(--accent);
}

#blogSearch {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  backdrop-filter: blur(20px);
}

#blogSearch:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  color: #fff;
}

#blogSearch::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-group-text {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-right: none;
  color: rgba(255, 255, 255, 0.6);
}

.blog-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 400px;
}

.blog-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.blog-card .badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.blog-card time {
  font-size: 0.9rem;
  opacity: 0.7;
}

.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}

.blog-card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.glass-card .badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
}

@media (max-width: 768px) {
  .blog-card {
    min-height: auto;
  }
  
  .d-flex.flex-wrap.gap-2 {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .btn-glass {
    margin-bottom: 0.5rem;
  }
}

/*
===================================================================
* Section 12: Enhanced Responsive Language Switcher (Updated)
===================================================================
*/

/* --- Mobile Language Switcher (visible on screens < 992px) --- */
.language-switcher-container {
  margin-right: 5px;
  /* Smooth transition when appearing/disappearing */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* RTL adjustments for mobile switcher */
html[dir="rtl"] .language-switcher-container {
  margin-right: 0;
  margin-left: 5px;
}

html[dir="rtl"] .navbar-nav {
  margin-right: auto !important;
  margin-left: 10px !important;
}

/* Hide mobile switcher on desktop */
@media (min-width: 992px) {
  .language-switcher-container {
    display: none;
  }
}

/* --- Desktop Language Switcher (visible on screens >= 992px) --- */
.desktop-lang-switcher {
  /* Hide on mobile */
  display: none;
}

@media (min-width: 992px) {
  .desktop-lang-switcher {
    display: block;
  }
}

/* --- Base Mobile Button Styling (Updated for Glassmorphism Theme) --- */
.lang-btn {
  background: var(--glass-bg); /* Match the glass card background */
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); /* Match the glass card border */
  border-radius: 12px; /* Match the border-radius of other buttons */
  color: var(--accent); /* Use the site's accent color for text */
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600; /* Increased font-weight for better visibility */
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: none; /* Removed base shadow for a cleaner look */
  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced hover effects for mobile button */
.lang-btn:hover {
  transform: translateY(-2px); /* Keep the subtle lift effect */
  background: rgba(0, 212, 255, 0.2); /* Brighter accent background on hover */
  border-color: var(--accent); /* Accent color border on hover */
  color: #fff; /* White text on hover for better contrast */
}

.lang-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

/* Mobile button text styling */
.lang-text {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* --- Desktop Button Styling --- */
.lang-btn-desktop {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  position: relative;
  user-select: none;
}

.lang-btn-desktop:hover {
  color: var(--accent) !important;
  transform: translateY(-2px);
}

.lang-btn-desktop:focus,
.lang-btn-desktop:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

/* Add underline effect for desktop button similar to nav links */
.lang-btn-desktop::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.3s ease;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
}

.lang-btn-desktop:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* --- Focus & Accessibility Improvements --- */
.lang-btn:focus,
.lang-btn:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
  /* Remove any browser-specific focus styles */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(0, 212, 255, 0.3) !important;
}

/* Ensure no sticky highlights on mobile */
.lang-btn:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* --- Animation States --- */
.lang-btn.switching {
  animation: langPulse 0.6s ease-in-out;
  pointer-events: none;
}

.lang-btn-desktop.switching {
  animation: langPulse 0.6s ease-in-out;
  pointer-events: none;
}

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

/* --- Improved Mobile Responsiveness --- */
@media (max-width: 576px) {
  .language-switcher-container {
    margin-right: 4px;
  }
  
  html[dir="rtl"] .language-switcher-container {
    margin-right: 0;
    margin-left: 4px;
  }
  
  .lang-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    gap: 4px;
  }
  
  .lang-text {
    font-size: 0.65rem;
  }
}

/* --- Enhanced Performance on Mobile --- */
@media (max-width: 768px) {
  .lang-btn,
  .lang-btn-desktop {
    /* Disable complex hover effects on mobile for better performance */
    transform: none !important;
  }
  
  /* But keep the visual feedback for touch */
  .lang-btn:active {
    background: rgba(0, 212, 255, 0.2) !important;
    transform: scale(0.95) !important;
  }
}

/* --- High DPI Display Optimizations --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .lang-btn {
    border-width: 0.5px;
  }
}

/* --- Dark/Light Theme Preparation (for future use) --- */
@media (prefers-color-scheme: light) {
  .lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
  }
  
  .lang-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
  }
}

/* --- Print Styles --- */
@media print {
  .language-switcher-container,
  .desktop-lang-switcher {
    display: none !important;
  }
}

/* --- Cleanup Legacy Styles --- */
.lang-switcher-simple {
  display: none !important;
}

/* --- Loading State --- */
.lang-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.lang-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

/*
===================================================================
* Section XX: CSS-Based Hover Effects (Refactored from JS)
===================================================================
*/

/* --- Enhanced Accent Button Hover --- */
/* This rule REPLACES the existing .btn-accent:hover rule with the more dramatic effect from the JS */
.btn-accent:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 212, 255, 0.5);
  color: #000;
}

/* --- Non-Portfolio Glass Card Hover --- */
/* This is a new rule */
.glass-card:not(.portfolio-card):hover {
  transform: translateY(-5px) scale(1.02);
}

/* --- Tech Icon Hover --- */
/* This is a new rule */
.tech-icon:hover {
  transform: scale(1.2) rotate(10deg);
  filter: brightness(1.3) drop-shadow(0 0 20px currentColor);
}