/* Global Styles */
:root {
  --primary: #3B82F6;
  --secondary: #8B5CF6;
  --accent: #10B981;
  --dark: #2D3748;
  --light: #F7FAFC;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: var(--light);
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveGrid 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes moveGrid {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(80px, 80px); }
}

/*
* Navbar Styles 
*/
.navbar {
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, var(--dark) 0%, #222a3a 100%);
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar-brand img {
  height: 40px;
}

.nav-link {
  font-weight: 500;
  color: var(--light) !important;
  margin: 0 0.5rem;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59,130,246,0.4);
}
.navbar-toggler {
  color: var(--light);
}

/* 
* Hero Section 
*/
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, #1a202c 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-top: 80px;
  color: white;
}

.hero::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveGrid 20s linear infinite;
  pointer-events: none;
}

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

.hero-content h1,
.hero-content p {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(2px) brightness(1);
  -webkit-backdrop-filter: blur(2px) brightness(1); /* for Safari */
}

.code-window {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px); /* for Safari */
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 15px;
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 100%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    animation: bounce 1.5s infinite;
    z-index: 2;
    color: #fff;
  }

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* lines animation */
#pcb-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.trace {
  fill: none;
  stroke-width: 2;
  opacity: 0;
  animation: drawTrace 8s ease-in-out forwards;
}
/* lines animation keyframes */
@keyframes drawTrace {
  0% {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: -100;
  }
}

/* 
* Sección Sobre Rextia
*/
.about-section {
  padding: 6rem 0;
  position: relative;
  z-index: 3;
}

.about-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.about-content .highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.about-features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.about-features li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 1.05rem;
  color: var(--dark);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.about-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

.circle-bg {
  position: absolute;
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

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

.center-icon {
  position: relative;
  z-index: 3;
  width: 200px;
  height: 200px;
  background: var(--light);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.3);
  font-size: 5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--light);
  animation: floatElement 8s ease-in-out infinite;
}

.floating-element {
  position: absolute;
  border-radius: 20px;
  animation: floatElement 5s ease-in-out infinite;
}

.floating-element-1 {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.8;
  top: 10%;
  right: 10%;
  animation-delay: 0s;
}

.floating-element-2 {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  opacity: 0.6;
  bottom: 15%;
  left: 5%;
  animation-delay: 1s;
}

.floating-element-3 {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  opacity: 0.7;
  top: 50%;
  left: 15%;
  animation-delay: 2s;
}

@keyframes floatElement {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
}

/*
* Section Titles
*/
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 
* Service Cards 
*/

.card-container {
  width: 75%;
  max-width: 1200px;
  height: 85vh;
  position: relative;
}

.service-card-modern {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: transform 0.3s ease;
}

/* floating circles */
.circle-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
}

/* strong gray circle (front) */
.circle-bg-1 {
    width: 100%;
    height: 100%;
    background: rgba(80, 80, 80, 0.4);
    top: 15%;
    left: 5%;
    animation: float-slow 8s infinite ease-in-out;
    z-index: 1;
}

/* light gray circle (middle) */
.circle-bg-2 {
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 200, 0.2);
    bottom: 15%;
    right: 5%;
    animation: float-medium 6s infinite ease-in-out;
    z-index: 2;
}

/* strong gray circle 2 (front) */
.circle-bg-3 {
    width: 100%;
    height: 100%;
    background: rgba(80, 80, 80, 0.4);
    bottom: 15%;
    left: 5%;
    animation: float-slow-2 8s infinite ease-in-out;
    z-index: 1;
}

/* light gray circle 2 (middle) */
.circle-bg-4 {
    width: 100%;
    height: 100%;
    background: rgba(200, 200, 200, 0.2);
    top: 15%;
    right: 5%;
    animation: float-medium-2 6s infinite ease-in-out;
    z-index: 2;
}

/* image circle (center) */
.main-circle {
    position: relative;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    animation: float-fast 5s infinite ease-in-out;
}

.main-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Keyframes for floating animations */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -20px); }
}

@keyframes float-medium {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 15px); }
}

@keyframes float-fast {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, 10px); }
}

@keyframes float-slow-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 15px); }
}

@keyframes float-medium-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15px, -20px); }
}

/* Z-index utility classes */
.z-2 { 
  z-index: 2; 
  position: relative; 
}

/*
* CTA Section 
*/
.cta-title {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.card-contact {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  text-align: center;
  color: var(--dark);
  background: var(--light);
  transition: color 0.5s ease, transform 0.3s, box-shadow 0.3s;
  z-index: 1;
}

.card-contact:hover .card-title,
.card-contact:hover .card-text {
    color: white !important;
}

.card-whatsapp::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #25D366; 
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease-out;
}

.card-whatsapp:hover::before,
.card-email:hover::before,
.card-location:hover::before {
transform: scaleX(1);
    transform-origin: left;
}

.whatsapp-icon {
  background: linear-gradient(135deg, var(--accent), #128C7E);
}

.card-whatsapp:hover .whatsapp-icon {
  background: var(--light);
  color: var(--accent);
}

.card-email::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary); 
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease-out;
}

.email-icon {
  background: linear-gradient(135deg, var(--primary), #3B82F6);
}

.card-email:hover .email-icon {
  background: var(--light);
  color: var(--primary);
}

.card-email:hover .floating-element,
.card-email:hover .circle-contact-bg {
  background: linear-gradient(135deg, var(--light), var(--secondary));
}

.card-location::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: red; 
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease-out;
}

.location-icon {
  background: linear-gradient(135deg, red, darkred);
}

.card-location:hover .location-icon {
  background: var(--light);
  color: red;
}

.card-location:hover .circle-contact-bg {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.4));
}

.contact-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 125px;
}

.contact-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

.circle-contact-bg {
  position: absolute;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.floating-element-contact-1 {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.8;
  top: 10%;
  right: 10%;
  animation-delay: 0s;
}

.floating-element-contact-2 {
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  opacity: 0.6;
  bottom: 15%;
  left: 5%;
  animation-delay: 1s;
}

.floating-element-contact-3 {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  opacity: 0.7;
  top: 50%;
  left: 15%;
  animation-delay: 2s;
}

/*
* Footer Styles 
*/
footer {
  background: var(--dark);
  color: white;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

footer a:hover {
  color: white;
}

.social-link {
  width: 45px;
  height: 45px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin: 0 0.5rem;
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-3px);
  color: white;
}


/* 
* Responsive
*/
@media (max-width: 991px) {
  .navbar-collapse {
    text-align: center;
  }

  .nav-item {
    background: var(--dark);
    filter: brightness(1);
    margin-top:2px;
  }

  .nav-btn-contact {
    height: 100%;
    width: 100%;
  }
  /*
  * About Section Adjustments for medium devices
  */
  .opacity-mx-50 {
    filter: opacity(0.5);
  }

  .position-mx-absolute {
    position: absolute;
  }

  .order-mx-2 {
    order: 2 !important;
  }
  /*
  * Service Cards Adjustments for medium devices
  */
  .display-mx-5 {
    font-size: calc(1.425rem + 2.1vw);
    font-weight: 300;
    line-height: 1.2;
  }

  .fs-mx-5 {
    font-size: 1.25rem !important;
  }
}

@media (max-width: 767px) {
  /*
  * Navbar Adjustments for small devices
  */
  .nav-item,
  .nav-btn-contact {
    font-size: 1.25rem;
  }
  /*
  * Hero Section Adjustments for small devices
  */
  .mb-xs-3 {
    margin-bottom: 3rem !important;
  }
  /*
  * About Section Adjustments for small devices
  */
  .order-smx-2 {
    order: 2 !important;
  }
}

@media (max-width: 575px) {
  /*
  * Container Padding Adjustments for small devices
  */
  .container .row {
    padding-right: 2rem !important;
    padding-left: 2rem !important;
  }

  .cta-title {
    margin-bottom: 0 !important;
  }
  /*
  * Navbar Adjustments for small devices
  */
  .nav-item,
  .nav-btn-contact {
    font-size: 1.25rem;
  }
  /*
  * Service Cards Adjustments for mobile devices
  */
  .display-mx-5 {
    font-size: calc(1.2rem + 2.1vw);
  }

  .fs-mx-5 {
    font-size: 1rem !important;
  }

  .card-body .row,
  .px-xs-0 {
    padding-right: 5% !important;
    padding-left: 5% !important;
  }
}

@media (min-width: 768px) {
  /*
  * About Section Adjustments for large devices
  */
  .about-content h2 {
    font-size: 2rem;
  }
  
  .about-image {
    min-height: 400px;
    margin-top: 3rem;
  }

  .circle-bg {
    width: 300px;
    height: 300px;
  }

  .center-icon {
    width: 150px;
    height: 150px;
    font-size: 4rem;
  }
  /* 
  * Contact Cards Adjustments for large devices
  */
  .contact-icon {
    width: 60px;
    height: 60px;
  }
}