/* Custom styles for EE Entreprenør website */

html {
  scroll-behavior: smooth;
}

/* Dropdown menu hover effects */
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

.group:hover .group-hover\:visible {
  visibility: visible;
}

/* Custom backdrop blur for browsers that don't support it */
@supports not (backdrop-filter: blur(8px)) {
  .backdrop-blur {
    background-color: rgba(255, 255, 255, 0.95);
  }
}

/* Smooth transitions for all interactive elements */
a,
button {
  transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: 2px solid #007685;
  outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
  background: #007685;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #005a66;
}

/* Loading animation for form submission */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Success message styles */
.success-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  animation: slideIn 0.3s ease-out;
}

/* Error message styles */
.error-message {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  animation: slideIn 0.3s ease-out;
}

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

/* Mobile menu animation */
#mobile-menu {
  transition: all 0.3s ease-in-out;
}

#mobile-menu.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

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

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

/* Form enhancements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
  border-color: #007685;
  box-shadow: 0 0 0 3px rgba(0, 118, 133, 0.1);
}

.form-input:invalid {
  border-color: #ef4444;
}

.form-input:invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

  body {
    background: white !important;
    color: black !important;
  }

  .bg-\[\#007685\] {
    background-color: #007685 !important;
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }

  header {
    position: static !important;
  }

  .shadow-lg,
  .shadow-md {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .text-gray-600 {
    color: #000000;
  }

  .text-gray-700 {
    color: #000000;
  }

  .border-gray-300 {
    border-color: #000000;
  }

  .bg-gray-50 {
    background-color: #ffffff;
    border: 1px solid #000000;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}

/* Logo image styling */
img[alt*="Logo"] {
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

/* Responsive image handling */
img {
  max-width: 100%;
  height: auto;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #007685;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Focus visible for better keyboard navigation */
.focus-visible:focus {
  outline: 2px solid #007685;
  outline-offset: 2px;
}

/* Improved button styles */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Enhanced dropdown styles */
.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.dropdown-content.show {
  max-height: 200px;
}

/* Loading skeleton (for future use) */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Utility classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-balance {
  text-wrap: balance;
}

/* Custom scrollbar for form elements */
textarea::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
  background: #007685;
  border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
  background: #005a66;
}
