/**
 * VS Majutech Website - Custom Styles
 * Works with Tailwind CSS CDN
 */

/* Custom CSS Variables - Matching VS Majutech Logo Colors */
:root {
  --header-height: 80px;
  --color-primary: #d6113c; /* Red - matches logo V shape */
  --color-primary-dark: #b80e32; /* Darker red for hover states */
  --color-accent: #1c8c14; /* Green - matches logo S shape */
  --color-accent-dark: #177510; /* Darker green for hover states */
}

/* Dark mode variables - Lighter shades for better visibility */
.dark {
  --color-primary: #f92f55; /* Lighter red for dark mode */
  --color-accent: #5ac164; /* Lighter green for dark mode */
}

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

/* Body */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Skip to main content (accessibility) */
.skip-to-main {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9999;
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  transform: translateY(-100%);
  transition: transform 0.3s;
}

.skip-to-main:focus {
  transform: translateY(0);
}

/* Hero gradient overlay - Red to Green matching logo */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214, 17, 60, 0.9) 0%, rgba(214, 17, 60, 0.8) 50%, rgba(28, 140, 20, 0.7) 100%);
}

.dark .hero-overlay {
  background: linear-gradient(135deg, rgba(214, 17, 60, 0.95) 0%, rgba(214, 17, 60, 0.9) 50%, rgba(28, 140, 20, 0.8) 100%);
}

/* Glass effect for header */
.glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dark .glass {
  background: rgba(17, 24, 39, 0.9);
}

/* Service cards and icon wrapper moved to comprehensive section below */

/* Buttons - Enhanced with primary and secondary variants */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.dark .btn-secondary {
  background: rgba(55, 65, 81, 1);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: white;
}

.dark .btn-secondary:hover {
  background: var(--color-accent);
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
}

/* Loading spinner */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Form styles - Moved to comprehensive section below */

/* Floating labels */
.floating-label-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.floating-label-group input,
.floating-label-group textarea {
  width: 100%;
  padding: 1rem 0.75rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.floating-label-group label {
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  font-size: 1rem;
  color: #6b7280;
  pointer-events: none;
  transition: all 0.3s;
}

.floating-label-group input:focus + label,
.floating-label-group input:not(:placeholder-shown) + label,
.floating-label-group textarea:focus + label,
.floating-label-group textarea:not(:placeholder-shown) + label {
  top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-primary);
}

/* Container - Modern centered layout */
.container-custom {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Section spacing - Consistent vertical rhythm */
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

@media (min-width: 1024px) {
  .section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* Section titles - Consistent styling */
.section-title {
  font-size: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
  font-weight: 700;
  color: rgb(17, 24, 39);
  margin-bottom: 1rem;
  text-align: center;
}

.dark .section-title {
  color: rgb(243, 244, 246);
}

.section-subtitle {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  color: rgb(107, 114, 128);
  text-align: center;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.dark .section-subtitle {
  color: rgb(209, 213, 219);
}

/* Hero section - Full viewport with proper alignment */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .hero {
    min-height: 90vh;
  }
}

/* Service cards - Consistent card styling */
.service-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dark .service-card {
  background: rgb(31, 41, 55);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

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

.dark .service-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Icon wrapper - Consistent icon containers */
.icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(214, 17, 60, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.dark .icon-wrapper {
  background: rgba(249, 47, 85, 0.2);
  color: var(--color-accent);
}

.service-card:hover .icon-wrapper {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.dark .service-card:hover .icon-wrapper {
  background: var(--color-accent);
}

/* Grid alignment fixes */
.grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid {
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .grid {
    gap: 2.5rem;
  }
}

/* Ensure items-center works properly in flex containers */
.items-center {
  align-items: center;
}

/* Text alignment utilities */
.text-center {
  text-align: center;
}

/* Navigation links - Consistent styling */
.nav-link {
  color: rgb(107, 114, 128);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
}

.dark .nav-link {
  color: rgb(209, 213, 219);
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(214, 17, 60, 0.1);
}

.dark .nav-link:hover {
  color: var(--color-accent);
  background: rgba(28, 140, 20, 0.1);
}

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

.dark .nav-link-active {
  color: var(--color-accent);
}

/* Buttons - Enhanced alignment */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.btn-outline {
  background: transparent;
  border: 2px solid currentColor;
}

/* Form inputs - Better alignment */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: white;
}

.dark .form-input {
  background: rgba(55, 65, 81, 1);
  border-color: rgba(75, 85, 99, 1);
  color: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(214, 17, 60, 0.1);
}

.dark .form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(28, 140, 20, 0.1);
}

/* Footer alignment */
footer .container-custom {
  padding-top: 4rem;
  padding-bottom: 2rem;
}

/* Image alignment and responsive behavior */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure proper alignment in grid layouts */
.grid > * {
  min-width: 0; /* Prevents grid items from overflowing */
}

/* Center content in sections */
.section > .container-custom {
  display: flex;
  flex-direction: column;
}

/* Fix for two-column layouts - using attribute selector for Tailwind classes */
.grid[class*="lg:grid-cols-2"] {
  align-items: center;
}

/* Ensure proper text alignment in cards */
.service-card h3,
.service-card p {
  text-align: left;
}

/* Stats grid alignment */
.grid.grid-cols-2,
.grid.grid-cols-4 {
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid.grid-cols-2,
  .grid.grid-cols-4 {
    gap: 2rem;
  }
}

/* Hero content alignment */
.hero .container-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Ensure buttons are properly aligned */
.flex[class*="flex-col"][class*="sm:flex-row"] {
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Fix for asymmetric layouts in services grid */
.grid[class*="grid-cols-1"][class*="md:grid-cols-2"][class*="lg:grid-cols-3"] > * {
  display: flex;
  flex-direction: column;
}

/* Ensure consistent spacing in footer grid */
footer .grid {
  align-items: start;
}

/* Fix for contact page layout */
.grid[class*="lg:grid-cols-3"] {
  align-items: start;
}

/* Page header alignment */
section.relative.py-20 {
  display: flex;
  align-items: center;
}

section.relative.py-20 .container-custom {
  width: 100%;
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
  /* Ensure buttons have proper touch targets */
  .btn, button, a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
  }
  
  /* Improve form inputs on mobile */
  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.875rem 1rem;
    min-height: 44px;
  }
  
  /* Better text sizes for mobile */
  h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }
  
  h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
  }
  
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }
  
  /* Better spacing for mobile */
  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Improve card padding on mobile */
  .service-card, .project-card {
    padding: 1.5rem;
  }
  
  /* Better grid gaps on mobile */
  .grid {
    gap: 1rem;
  }
  
  /* Improve hero section on mobile */
  .hero {
    min-height: 80vh;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Better container padding on mobile */
  .container-custom {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Improve navigation on mobile */
  header nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Better logo sizing on mobile */
  header img {
    max-height: 2.5rem;
  }
  
  /* Improve filter buttons */
  .flex-wrap button {
    flex-shrink: 0;
  }
  
  /* Better image scaling */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Improve table responsiveness */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better text wrapping */
  p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Ensure proper max-width for content blocks */
.max-w-3xl,
.max-w-4xl {
  margin-left: auto;
  margin-right: auto;
}

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

/* Hero highlight box for emphasis */
.hero-highlight-box {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  padding: 0.25rem 0.75rem;
  margin: 0 0.25rem;
  color: #1c8c14;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.dark .hero-highlight-box {
  background: rgba(214, 17, 60, 0.2);
  border-color: rgba(214, 17, 60, 0.5);
  color: #5ac164;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hide Alpine.js elements before initialization */
[x-cloak] {
  display: none !important;
}

