/* Custom CSS for TechFlow Systems */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --dark-color: #1f2937;
  --light-color: #f8fafc;
  --text-color: #374151;
  --text-muted: #6b7280;
}

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

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: hidden;
  font-size: 16px;
}

html {
  scroll-behavior: smooth;
}

/* Navigation */
.custom-navbar {
  background: rgba(31, 41, 55, 0.95) !important;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  padding: 0.75rem 0;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.75rem 1rem !important;
  font-size: 1rem;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

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

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

/* Mobile navbar improvements */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-collapse {
  margin-top: 1rem;
}
/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  align-items: center;
}

#home.hero-section {
  min-height: 100vh;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff" fill-opacity="0.05" points="0,1000 1000,0 1000,1000"/></svg>');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  padding: 80px 0 60px;
  width: 100%;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(45deg, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
}

.hero-buttons {
  margin-bottom: 3rem;
  text-align: center;
}

.hero-buttons .btn {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 14px 20px;
}

.hero-buttons .me-3 {
  margin-right: 0 !important;
}

.btn-primary {
  background: var(--primary-color);
  border: none;
  padding: 14px 20px;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: 14px 20px;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-outline-light:hover {
  background: white;
  color: var(--primary-color);
  border-color: white;
  transform: translateY(-2px);
}

.hero-stats {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
}

.stat-item {
  text-align: center;
  margin-bottom: 1.5rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0;
}

.hero-image img {
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  margin-top: 2rem;
}

.hero-image img:hover {
  transform: scale(1.05);
}

/* Section Styling */
.section-padding {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 1rem;
  text-align: center;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  text-align: center;
}

/* About Section */
.about-content {
  padding-right: 0;
  margin-bottom: 2rem;
  text-align: center;
}

.about-features {
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  font-weight: 500;
  justify-content: center;
  text-align: left;
}

.about-image img {
  border-radius: 15px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

/* Services Section */
.service-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  height: 100%;
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(37, 99, 235, 0.1), transparent);
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

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

.service-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  transition: all 0.3s ease;
}

.service-icon i {
  font-size: 1.75rem;
  color: white;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
}

.service-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.service-card p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.service-features {
  list-style: none;
  padding: 0;
  text-align: left;
}

.service-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
}

.service-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

.service-features li:last-child {
  border-bottom: none;
}

/* Portfolio Section */
.portfolio-item {
  border-radius: 15px;
  overflow: hidden;
  background: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.portfolio-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-image {
  position: relative;
  overflow: hidden;
}

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

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

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

.portfolio-info {
  text-align: center;
  color: white;
}

.portfolio-info h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.portfolio-info p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.portfolio-content {
  padding: 1.5rem;
}

.portfolio-content h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

/* Team Section */
.team-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

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

.team-image {
  position: relative;
  overflow: hidden;
}

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

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

.team-content {
  padding: 1.5rem;
}

.team-content h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.team-social {
  margin-top: 1rem;
}

.team-social a {
  display: inline-block;
  width: 35px;
  height: 35px;
  background: var(--light-color);
  border-radius: 50%;
  line-height: 35px;
  text-align: center;
  color: var(--text-muted);
  margin: 0 5px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

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

/* Contact Section */
.contact-form {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.form-floating > .form-control {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 0.75rem;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.form-floating > .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.form-floating > label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-info {
  padding-left: 0;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.contact-icon i {
  font-size: 1.1rem;
  color: white;
}

.contact-details h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.contact-details p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Footer */
.footer {
  padding: 40px 0 20px;
  background: var(--dark-color) !important;
}

.footer-brand h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.footer-brand p {
  color: #9ca3af;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  line-height: 40px;
  text-align: center;
  color: white;
  margin-right: 10px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.social-links {
  text-align: center;
}

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

.footer h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
  text-align: center;
}

.footer-links {
  list-style: none;
  padding: 0;
  text-align: center;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1rem;
}

.footer p {
  color: #9ca3af;
  margin: 0;
  font-size: 0.85rem;
  text-align: center;
}

/* Mobile spacing adjustments and responsive tweaks */
@media (max-width: 575.98px) {
  /* Header/nav */
  .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.95rem;
  }

  /* Hero */
  .hero-section {
    padding-top: 0 !important;
    min-height: 45vh;
  }
  #home.hero-section {
    min-height: 90vh;
  }
  .hero-overlay {
    padding-top: 32px; /* separate from navbar without visible gap */
    padding-bottom: 40px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }
  .hero-buttons {
    margin-bottom: 1.5rem;
  }
  .stat-number {
    font-size: 1.5rem;
  }

  /* Sections */
  .section-padding {
    padding: 48px 0;
  }

  /* Cards and images */
  .service-card {
    padding: 1.25rem;
  }
  .portfolio-image img {
    height: 160px;
  }
  .team-image img {
    height: 220px;
  }

  /* Forms */
  .contact-form {
    padding: 1.25rem;
  }

  /* Footer mobile tweaks */
  .footer { padding: 32px 0 16px; }
  .footer .row > [class*="col-"] { margin-bottom: 16px; }
  .footer .row > [class*="col-"]:last-child { margin-bottom: 0; }
  .footer h5 { margin-top: 8px; margin-bottom: 8px; }
  .footer-links a { font-size: 0.95rem; }
  .social-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .social-links a { margin-right: 0; }

  /* Footer bottom row: stack and center */
  .footer .row:last-child .col-md-6 { text-align: center !important; margin-bottom: 8px; }
}

/* Tablet and Desktop Responsive Design */
@media (min-width: 576px) {
  .hero-buttons .btn {
    display: inline-block;
    width: auto;
    margin-bottom: 0;
    margin-right: 1rem;
    padding: 12px 30px;
  }
  
  .hero-buttons .me-3 {
    margin-right: 1rem !important;
  }
  
  .service-card {
    margin-bottom: 0;
  }
  
  .portfolio-item {
    margin-bottom: 0;
  }
  
  .team-card {
    margin-bottom: 0;
  }
  
  .contact-form {
    margin-bottom: 0;
  }
  
  .contact-info {
    margin-top: 0;
  }
}

@media (min-width: 768px) {
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .hero-overlay {
    padding: 100px 0 80px;
  }
  
  .hero-title {
    font-size: 2.5rem;
    text-align: left;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
    text-align: left;
  }
  
  .hero-buttons {
    text-align: left;
  }
  
  .hero-image img {
    margin-top: 0;
  }
  
  .section-padding {
    padding: 80px 0;
  }
  
  .section-title {
    font-size: 2rem;
    text-align: left;
  }
  
  .section-subtitle {
    font-size: 1.1rem;
    text-align: left;
  }
  
  .about-content {
    padding-right: 2rem;
    margin-bottom: 0;
    text-align: left;
  }
  
  .feature-item {
    justify-content: flex-start;
  }
  
  .about-image img {
    margin-top: 0;
  }
  
  .service-card {
    padding: 2.5rem;
  }
  
  .service-icon {
    width: 80px;
    height: 80px;
  }
  
  .service-icon i {
    font-size: 2rem;
  }
  
  .service-card h4 {
    font-size: 1.25rem;
  }
  
  .portfolio-image img {
    height: 250px;
  }
  
  .team-image img {
    height: 300px;
  }
  
  .team-social a {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 1rem;
  }
  
  .contact-info {
    padding-left: 2rem;
  }
  
  .contact-form {
    padding: 2.5rem;
  }
  
  .contact-icon {
    width: 60px;
    height: 60px;
  }
  
  .contact-icon i {
    font-size: 1.25rem;
  }
  
  .footer {
    padding: 60px 0 20px;
  }
  
  .footer-brand h4 {
    font-size: 1.5rem;
    text-align: left;
  }
  
  .footer-brand p {
    text-align: left;
  }
  
  .social-links {
    text-align: left;
  }
  
  .social-links a {
    width: 45px;
    height: 45px;
    line-height: 45px;
    font-size: 1rem;
  }
  
  .footer h5 {
    text-align: left;
  }
  
  .footer-links {
    text-align: left;
  }
  
  .footer p {
    text-align: left;
  }
}

@media (min-width: 992px) {
  .section-padding {
    padding: 100px 0;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
  }
}

@media (min-width: 1200px) {
  .hero-overlay {
    padding: 120px 0 80px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover,
  .portfolio-item:hover,
  .team-card:hover {
    transform: none;
  }
  
  .btn:hover::before {
    left: -100%;
  }
  
  .nav-link::after {
    display: none;
  }
  
  /* On touch devices, do not show hover overlays by default */
  .gallery-grid .portfolio-overlay {
    opacity: 0 !important;
    background: rgba(37, 99, 235, 0.8);
  }

  .service-card::before {
    display: none;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-section::before {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-overlay {
    padding: 60px 0 40px;
  }
  
  .hero-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-stats {
    padding-top: 1rem;
  }
  
  .stat-item {
    margin-bottom: 1rem;
  }
}

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

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Button Animations */
.btn {
  position: relative;
  overflow: hidden;
}

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

.btn:hover::before {
  left: 100%;
}

/* Ensure hero background overlay does not repeat on small and tablet screens */
@media (max-width: 991.98px) {
  .hero-section::before {
    display: none !important;
  }
}