/* ==========================================================================
   eDefense Systems - Main Stylesheet
   Modern, responsive design with accessibility focus
   ========================================================================== */

/* ==========================================================================
   CSS Variables (Custom Properties)
   ========================================================================== */
:root {
  /* Colors */
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --dark-color: #212529;
  --light-color: #f8f9fa;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.6;

  /* Spacing */
  --spacing-unit: 1rem;

  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.3s ease-in-out;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--dark-color);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  padding-top: 56px; /* Offset for fixed navbar */
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-base);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.navbar-brand:hover {
  color: var(--primary-color) !important;
}

.nav-link {
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-base), left var(--transition-base);
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.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 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,165.3C1248,171,1344,149,1392,138.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-section p {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-section .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-icon {
  font-size: 15rem;
  color: rgba(255, 255, 255, 0.2);
  animation: float 3s ease-in-out infinite;
}

/* ==========================================================================
   Product Cards
   ========================================================================== */
.product-card {
  border: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.product-icon {
  transition: transform var(--transition-base);
}

.product-card:hover .product-icon {
  transform: scale(1.1);
}

.product-card .card-footer {
  border-top: none;
  padding-top: 0;
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.feature-box {
  border-radius: 0.5rem;
  transition: background-color var(--transition-base), transform var(--transition-base);
}

.feature-box:hover {
  background-color: var(--light-color);
  transform: translateY(-5px);
}

.feature-box i {
  transition: transform var(--transition-base);
}

.feature-box:hover i {
  transform: scale(1.15) rotate(5deg);
}

/* ==========================================================================
   Contact Form
   ========================================================================== */
.form-control,
.form-select {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  transition: all var(--transition-base);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-light:hover {
  background-color: white;
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 3px solid var(--primary-color);
}

footer a {
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--primary-color) !important;
}

footer .fab,
footer .fas {
  transition: transform var(--transition-base);
}

footer a:hover .fab,
footer a:hover .fas {
  transform: scale(1.2);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.section-padding {
  padding: 5rem 0;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--dark-color);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile (Portrait) - 320px to 480px */
@media (max-width: 480px) {
  .hero-icon {
    font-size: 8rem;
  }

  .display-3 {
    font-size: 2.5rem;
  }

  .display-4 {
    font-size: 2rem;
  }

  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
}

/* Tablet - 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
  .hero-icon {
    font-size: 10rem;
  }
}

/* Laptop - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-icon {
    font-size: 12rem;
  }
}

/* Desktop - 1025px and above */
@media (min-width: 1025px) {
  .hero-icon {
    font-size: 15rem;
  }

  .container {
    max-width: 1140px;
  }
}

/* Print styles */
@media print {
  .navbar,
  footer,
  .btn {
    display: none;
  }

  body {
    padding-top: 0;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}

/* Scroll animation completion class — applied by IntersectionObserver in main.js */
.animate-fade-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ==========================================================================
   Dark Mode Support (if preferred by user)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  /* Optional: Add dark mode styles if desired */
  /* Currently disabled - uncomment to enable */
  /*
  :root {
    --dark-color: #f8f9fa;
    --light-color: #212529;
  }

  body {
    background-color: #1a1a1a;
    color: #f8f9fa;
  }
  */
}
