/**
 * Custom Styles for Resident Data Scientist Theme
 * Premium enhancements and advanced styling
 */

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

/* Contact form validation styles */
input:invalid:focus,
textarea:invalid:focus {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
  background-color: rgba(239, 68, 68, 0.02);
}

input:valid:focus,
textarea:valid:focus {
  border-color: var(--success-color);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  background-color: rgba(16, 185, 129, 0.02);
}

/* Loading state for forms */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Enhanced form styling */
.form-group input:valid {
  border-color: var(--success-color);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--danger-color);
}

/* Advanced button styling */
button[type="submit"] {
  position: relative;
  overflow: hidden;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button[type="submit"]:active::before {
  width: 300px;
  height: 300px;
}

/* Details/Summary styling for FAQ */
details {
  cursor: pointer;
}

/* Details/Summary styling for FAQ */
details {
  cursor: pointer;
}

details summary {
  user-select: none;
  outline: none;
  font-weight: 600;
  padding: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details summary:hover {
  background-color: var(--bg-lighter);
  color: var(--primary-lighter);
}

details summary::-webkit-details-marker {
  color: var(--primary-lighter);
  transform-origin: center;
  transition: transform 0.3s ease;
}

details[open] summary {
  margin-bottom: 1rem;
  color: var(--primary-lighter);
}

details[open] summary::-webkit-details-marker {
  transform: rotate(180deg);
}

/* Enhanced card styling with gradient overlay */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(14, 165, 233, 0.02) 100%);
  pointer-events: none;
  border-radius: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 1;
}

/* Enhanced link effects */
a {
  position: relative;
  display: inline-block;
}

a:not(.cta-button):not(.logo-link)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-lighter), var(--secondary-color));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.cta-button):not(.logo-link):hover::after {
  width: 100%;
}

nav a::after {
  display: none;
}

/* Focus visible for accessibility */
a:focus-visible {
  outline: 2px solid var(--primary-lighter);
  outline-offset: 2px;
  border-radius: 2px;
}

button:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Card shadows on hover */
.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Service cards enhanced */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* Animation for hero section */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1,
.hero p,
.hero .cta-button {
  animation: slideInUp 0.6s ease-out forwards;
}

.hero h1 {
  animation-delay: 0.1s;
}

.hero p {
  animation-delay: 0.2s;
}

.hero .cta-button:first-of-type {
  animation-delay: 0.3s;
}

.hero .cta-button:last-of-type {
  animation-delay: 0.4s;
}

/* Responsive improvements */
@media (max-width: 768px) {
  a::after {
    display: none;
  }

  .hero h1 {
    animation-delay: 0;
  }

  .hero p {
    animation-delay: 0;
  }

  .hero .cta-button {
    animation-delay: 0;
    display: block;
    margin: 0.5rem auto;
  }
}

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

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1f2937;
    color: #f3f4f6;
  }

  .card,
  .service-card {
    background-color: #374151;
    border-color: #4b5563;
  }

  header {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  input,
  textarea {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
  }

  input::placeholder,
  textarea::placeholder {
    color: #9ca3af;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  .mobile-menu-toggle {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  a {
    text-decoration: underline;
  }
}

/* Active navigation link styling */
nav a.active {
  color: var(--primary-lighter);
  font-weight: 600;
}

nav a.active::before {
  width: 100%;
  background: linear-gradient(90deg, var(--primary-lighter), var(--secondary-color)) !important;
}
