/* Software Providers - Main Stylesheet */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #111;
  --secondary-color: #f9f9f9;
  --accent-color: #007bff;
  --text-light: #ccc;
  --text-dark: #111;
  --card-shadow: 0 5px 15px rgba(0,0,0,0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--secondary-color);
  /* Optimize mobile scrolling */
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* Header and Navigation */
header {
  background: var(--primary-color);
  color: #fff;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
}

.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-color);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background-image: url('../images/abstract-background-higher-res.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #fff;
  text-align: center;
  padding: 8rem 2rem;
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-button {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
  margin-top: 1rem; /* Add moderate space between text and button */
}

.cta-button:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,123,255,0.3);
}

/* Sections */
.section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  align-items: stretch; /* Ensures all grid items have equal height */
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Specific layouts for better card distribution */
.grid-services {
  grid-template-columns: repeat(4, 1fr); /* 4 cards in a row */
  gap: 1.5rem; /* Slightly smaller gap for better fit */
}

.grid-technologies {
  grid-template-columns: repeat(4, 1fr); /* 4 cards per row */
  gap: 1.5rem;
}

.grid-industries {
  grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
  gap: 1.5rem;
}

/* Improved grid layouts for balanced card arrangements */
.grid-balanced-2 {
  grid-template-columns: repeat(2, 1fr); /* Always 2 columns */
  gap: 2rem;
}

.grid-balanced-3 {
  grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
  gap: 1.5rem;
}

.grid-balanced-4 {
  grid-template-columns: repeat(4, 1fr); /* Always 4 columns */
  gap: 1.5rem;
}

/* Special layout for contact page */
.grid-contact {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Form takes 2/3, contact info takes 1/3 */
  gap: 3rem;
  align-items: start; /* Align to top instead of stretch */
}

/* Contact form styling */
.contact-form {
  width: 100%;
  max-width: 100%;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  box-sizing: border-box;
  max-width: 100%;
}

/* Cards */
.card {
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensures cards fill the available grid height */
  justify-content: flex-start; /* Align content to top */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  flex-shrink: 0; /* Prevents title from shrinking */
  min-height: 2.6rem; /* Ensures consistent header height */
  display: flex;
  align-items: center; /* Centers text vertically within the header area */
}

.card p {
  color: #666;
  line-height: 1.6;
  flex-grow: 1; /* Allows description to fill remaining space */
}

/* Improved bullet point formatting */
.card ul {
  color: #666;
  line-height: 1.6;
  flex-grow: 1;
  margin: 0 0 0 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.card ul li {
  position: relative;
  padding-left: 0.3rem;
  text-align: left;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Ensure consistent bullet alignment */
.card ul li::marker {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

/* Better formatting for tech stacks and multi-item lists */
.tech-card ul li {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

/* Better spacing for nested content */
.card ul li strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Ensure cards with multiple elements distribute space properly */
.card > *:last-child:not(.card-link) {
  margin-bottom: 0;
}

/* Handle cards with multiple paragraphs */
.card > p:last-of-type:not(:first-of-type) {
  flex-grow: 1;
  margin-bottom: 0;
}

.card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-decoration: none;
  z-index: 1;
}

/* Service Cards */
.service-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color);
  transform: scaleY(0);
  transition: var(--transition);
}

.service-card:hover::before {
  transform: scaleY(1);
}

/* Technology Cards */
.tech-card {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
}

.tech-card h3 {
  text-align: center;
  min-height: 2.6rem; /* Consistent header height */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.tech-card ul {
  text-align: left; /* Left-align the bullet lists for better readability */
  flex-grow: 1;
}

.tech-card:hover {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Industry Cards */
.industry-card {
  position: relative;
  background: linear-gradient(135deg, var(--accent-color) 0%, #0056b3 100%);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.industry-card h3 {
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  text-align: center;
  min-height: auto; /* Override the general card h3 min-height */
  display: block; /* Override the flex display from general card h3 */
}

.industry-card p {
  flex-grow: 1;
  color: #fff; /* Make text white for better contrast on blue background */
  opacity: 0.9; /* Slightly transparent for better readability */
  text-align: center; /* Center-align text to match the card design */
}

/* Industry card bullet points */
.industry-card ul {
  color: #fff; /* White text for bullet lists */
  text-align: left; /* Left-align bullet lists for readability */
}

.industry-card ul li {
  color: #fff; /* White text for list items */
  opacity: 0.9; /* Slightly transparent for better readability */
}

.industry-card ul li::marker {
  color: rgba(255, 255, 255, 0.8); /* White bullets with slight transparency */
}

/* Breadcrumb Navigation */
.breadcrumb {
  padding: 1rem 2rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb-content {
  max-width: 1200px;
  margin: 0 auto;
}

.breadcrumb a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: #666;
}

/* Footer */
footer {
  background: var(--primary-color);
  color: var(--text-light);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section a {
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
  display: block;
  margin-bottom: 0.5rem;
}

.footer-section a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom a {
  color: #fff;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) and (min-width: 1025px) {
  /* Large tablets / small desktops */
  .grid-services {
    gap: 1.2rem; /* Slightly smaller gap for tighter screens */
  }
  
  .grid-technologies {
    gap: 1.2rem;
  }
  
  .grid-industries {
    gap: 1.2rem;
  }
  
  .grid-balanced-2 {
    gap: 1.5rem;
  }
  
  .grid-balanced-3 {
    gap: 1.2rem;
  }
  
  .grid-balanced-4 {
    gap: 1.2rem;
  }
  
  .grid-contact {
    gap: 2rem;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  /* Tablet adjustments */
  .grid-services {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 2rem;
  }
  
  .grid-technologies {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets (4 cards = 2+2) */
    gap: 2rem;
  }
  
  .grid-industries {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets (6 cards = 2+2+2) */
    gap: 2rem;
  }
  
  .grid-balanced-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .grid-balanced-3 {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 2rem;
  }
  
  .grid-balanced-4 {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 2rem;
  }
  
  .grid-contact {
    grid-template-columns: 1fr; /* Single column on tablets */
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  }
  
  .main-nav.active {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero {
    padding: 4rem 1rem;
    background-attachment: scroll;
  }
  
  .section {
    padding: 2rem 1rem;
  }
  
  .grid {
    gap: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  /* Force single column on mobile for all grids */
  .grid-services {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-technologies {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-industries {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-balanced-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-balanced-3 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-balanced-4 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .grid-contact {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 1rem;
  }
  
  .section {
    padding: 1.5rem 0.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Animation Classes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Mobile Performance Optimizations - Prevent Blinking */
@media (max-width: 768px) {
  /* Disable heavy animations on mobile to prevent blinking */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Specifically disable fade-in animation on mobile */
  .fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  /* Ensure all cards and sections are immediately visible on mobile */
  .card, .section {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  /* Force hardware acceleration and prevent repaints */
  body {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
  }
  
  /* Disable transform effects on mobile */
  .cta-button:hover {
    transform: none !important;
  }
  
  .service-card::before {
    transform: none !important;
    opacity: 1;
  }
  
  .service-card:hover::before {
    transform: none !important;
  }
  
  /* Ensure smooth scrolling without parallax effects */
  .hero {
    background-attachment: scroll !important;
  }
  
  /* Disable hover effects on mobile */
  .card:hover, .tech-card:hover {
    transform: none !important;
    box-shadow: var(--card-shadow) !important;
  }
  
  /* CRITICAL: Fix blue card blinking */
  .industry-card {
    /* Replace gradient with solid color to prevent blinking */
    background: var(--accent-color) !important;
    /* Force hardware acceleration */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    /* Prevent repaints */
    will-change: auto !important;
    /* Force GPU compositing */
    -webkit-transform-style: preserve-3d !important;
    transform-style: preserve-3d !important;
  }
  
  /* Improve rendering performance for all cards */
  .card, .tech-card, .service-card, .industry-card {
    will-change: auto !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    /* Force layer creation */
    -webkit-transform-style: preserve-3d !important;
    transform-style: preserve-3d !important;
    /* Optimize text rendering */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
  }
  
  /* Prevent section blinking */
  .section {
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
  }
  
  /* Optimize grid rendering */
  .grid {
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
  }
  
  /* Prevent layout thrashing on mobile */
  .card, .tech-card, .service-card, .industry-card {
    /* Fix dimensions to prevent layout recalculation */
    contain: layout style paint !important;
    /* Prevent content from affecting layout */
    overflow: hidden !important;
  }
  
  /* Optimize images and media */
  img, video {
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
  }
  
  /* Force single column on mobile to reduce complexity */
  .grid-services,
  .grid-technologies,
  .grid-industries,
  .grid-balanced-2,
  .grid-balanced-3,
  .grid-balanced-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* Print Styles */
@media print {
  header, footer, .breadcrumb { display: none; }
  .hero { background: none; color: var(--text-dark); }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
