/**
 * UNIFIED CSS - Matieu White Website
 * Optimized single CSS file replacing 5 separate files
 * Performance: 5 HTTP requests → 1 HTTP request
 */

/* ========================================
   1. CSS VARIABLES
   Brand Colors, Spacing, Shadows
   ======================================== */

:root {
  /* Brand Colors */
  --color-gold: #d4af37;
  --color-gold-dark: #b8941f;
  --color-gold-light: #e0c050;

  --color-black: #0a0a0a;
  --color-black-90: rgba(0, 0, 0, 0.9);
  --color-black-80: rgba(0, 0, 0, 0.8);
  --color-black-60: rgba(0, 0, 0, 0.6);
  --color-black-50: rgba(0, 0, 0, 0.5);
  --color-black-30: rgba(0, 0, 0, 0.3);

  --color-gray: #1a1a1a;
  --color-gray-light: #2a2a2a;

  --color-white: #ffffff;
  --color-white-90: rgba(255, 255, 255, 0.9);
  --color-white-70: rgba(255, 255, 255, 0.7);
  --color-white-50: rgba(255, 255, 255, 0.5);
  --color-white-10: rgba(255, 255, 255, 0.1);
  --color-white-05: rgba(255, 255, 255, 0.05);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 2rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-cubic: cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.3);
}

/* Dark mode overrides (if needed later) */
@media (prefers-color-scheme: dark) {
  :root {
    /* Can add dark mode specific values here */
  }
}

/* ========================================
   2. ANIMATIONS
   Reusable keyframes and utilities
   ======================================== */

/* Fade & Slide Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }

  to {
    max-height: 500px;
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    max-height: 500px;
    opacity: 1;
  }

  to {
    max-height: 0;
    opacity: 0;
  }
}

/* Shimmer Effect (for loading states) */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

/* Pulse Animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Bounce Animation */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }

  50% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Scale Animations */
@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }

  to {
    transform: scale(0.9);
    opacity: 0;
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Marquee Scrolling (for text) */
@keyframes marquee {
  0% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Glow Effect */
@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
  }
}

/* Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

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

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-slide-down {
  animation: slideDown 0.4s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

.animate-shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 1000px 100%;
}

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

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-scale-out {
  animation: scaleOut 0.3s ease-out forwards;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-marquee {
  animation: marquee 20s linear infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Animation Delays */
.animation-delay-100 {
  animation-delay: 0.1s;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-300 {
  animation-delay: 0.3s;
}

.animation-delay-500 {
  animation-delay: 0.5s;
}

/* ========================================
   3. NAVIGATION STYLES
   Header, Menu, Mega Menu
   ======================================== */

/* Hover Underline Animation - Gold bar above menu items */
.hover-underline-animation {
  position: relative;
  display: inline-block;
}

.hover-underline-animation::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  top: -8px;
  /* Above the text */
  left: 0;
  background-color: var(--color-gold, #d4af37);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .hover-underline-animation::before,
.nav-item:hover .hover-underline-animation::before,
.nav-active .hover-underline-animation::before {
  transform: scaleX(1);
}

/* Mega Menu */
.mega-menu {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  top: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  background-color: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: none !important;
  border-bottom: none !important;
}

.group:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Navigation Items */
.nav-item {
  height: 100%;
  display: flex;
  align-items: center;
}

/* Active Navigation State */
.nav-active {
  color: #d4af37 !important;
}

/* Navigation Separators */
.nav-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: calc(-0.5 * 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 1px;
  background-color: rgba(255, 255, 255, 0.2);
}

@media(min-width: 1280px) and (max-width: 1535px) {
  .nav-item:not(:last-child)::after {
    right: calc(-0.5 * 1.25rem);
  }
}

@media(min-width: 1536px) {
  .nav-item:not(:last-child)::after {
    right: calc(-0.5 * 1rem);
  }
}

/* Responsive Navigation */
@media(min-width: 1920px) and (max-width: 2559px) {
  .nav-item {
    font-size: 10px !important;
    letter-spacing: 0.15em !important;
  }

  nav.xl\:flex {
    gap: 1.5rem !important;
  }
}

@media(min-width: 2560px) {
  .nav-item {
    font-size: 12px;
    letter-spacing: 0.2em;
  }
}


/* Details/Summary (Accordion) */
details[open] .fa-chevron-down {
  transform: rotate(180deg);
}

details .fa-chevron-down {
  transition: transform 0.3s ease;
}

details>summary {
  list-style: none;
}

details>summary::-webkit-details-marker {
  display: none;
}

details>div {
  animation: slideDown 0.3s ease-out;
}

/* ========================================
   4. ACCESSIBILITY
   WCAG 2.1 Level AA Compliance
   ======================================== */

/* Focus Visible (Keyboard Navigation) */
*:focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 2px;
  border-radius: 2px;
}

a:focus-visible {
  outline-color: #d4af37;
  background-color: rgba(212, 175, 55, 0.1);
}

button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Improved Contrast */
.text-muted {
  color: #6c757d !important;
}

a.text-light:hover,
a.text-light:focus {
  color: #ffffff !important;
  text-decoration: underline;
}

/* Larger Touch Targets */
.social-icon,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  padding: 12px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Interactive States */
button:hover:not(:disabled),
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Accessible Forms */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #d4af37;
  outline-offset: 0;
  border-color: #d4af37;
}

.form-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-error::before {
  content: "⚠";
  font-size: 1.2em;
}

.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* Text Selection */
::selection {
  background-color: #d4af37;
  color: #000000;
}

::-moz-selection {
  background-color: #d4af37;
  color: #000000;
}

/* Reduced Motion */
@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 Touch Targets */
@media (max-width: 768px) {

  button,
  a,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  .mobile-nav a {
    padding: 16px;
    display: block;
  }
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ========================================
   5. LOADING STATES
   Skeleton loaders and spinners
   ======================================== */

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

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

  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Lazy Loading Images */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ========================================
   6. TOOLTIPS
   Accessible tooltips with ARIA
   ======================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
}

[data-tooltip]:hover::before,
[data-tooltip]:focus::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #000;
  margin-bottom: 2px;
}

/* ========================================
   7. UTILITIES
   Custom scrollbar, hero, etc.
   ======================================== */

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #b8941f;
}

/* Hero Background */
.hero-bg {
  background-position: center 20%;
}

/* ========================================
   8. PRINT STYLES
   Optimized for printing
   ======================================== */

@media print {

  nav,
  .no-print,
  button,
  .social-icons {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}