/* Custom Styles for Necon Template */

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

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #6b1630;
}

/* Selection Color */
::selection {
  background-color: #851c3a;
  color: white;
}

::-moz-selection {
  background-color: #851c3a;
  color: white;
}

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

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

/* Back to Top Button Visibility */
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(133, 28, 58, 0.1);
}

/* Header Shadow on Scroll */
#header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Smooth Transitions */
a,
button {
  transition: all 0.2s ease-in-out;
}

/* Image Lazy Loading Blur Effect */
img[loading="lazy"] {
  filter: blur(0);
  transition: filter 0.3s;
}

img[loading="lazy"]:not([src]) {
  filter: blur(10px);
}

/* Hover Effects for Cards */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #851c3a 0%, #5f7781 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom Animations */
@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse-slow {
  animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 2px solid #851c3a;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  #header,
  #back-to-top,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* Mobile Menu Transition */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

#mobile-menu.show {
  max-height: 500px;
}

/* Form Success/Error Messages */
#form-success,
#form-error {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility Classes */
.container {
  max-width: 1280px;
}

/* Custom Grid Gaps */
.gap-safe {
  gap: max(1rem, env(safe-area-inset-left));
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
  .safe-area-top {
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .text-gray-600 {
    color: #000;
  }

  .text-gray-400 {
    color: #333;
  }
}

/* Dark Mode Support (for future) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* Custom Loading Spinner */
.spinner {
  border: 3px solid rgba(133, 28, 58, 0.1);
  border-radius: 50%;
  border-top: 3px solid #851c3a;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Text Truncate */
.truncate-2-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3-lines {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Aspect Ratio (for older browsers) */
.aspect-video {
  aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 16 / 9) {
  .aspect-video::before {
    float: left;
    padding-top: 56.25%;
    content: "";
  }

  .aspect-video::after {
    display: block;
    content: "";
    clear: both;
  }
}
