/* Global CSS for Versailles Luxury Homes - Modern Linear Style */

/* Performance optimization - Use CSS containment */
* {
  box-sizing: border-box;
}

/* Critical CSS - Above the fold optimization */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* GPU acceleration for improved performance */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* Content visibility for performance */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 200px;
}

/* Base Styles */
body {
  scroll-behavior: smooth;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Marcellus', serif;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* Typography Utility Classes */
.font-marcellus {
  font-family: 'Marcellus', serif;
}

.font-montserrat {
  font-family: 'Montserrat', sans-serif;
}

.font-heading {
  font-family: 'Marcellus', serif;
}

.font-display {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
}

.font-body {
  font-family: 'Montserrat', sans-serif;
}

/* Modern Linear Style Classes */
.linear-border {
  position: relative;
}

.linear-border::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(to bottom, #c9a45c 0%, rgba(201, 164, 92, 0.3) 100%);
}

.linear-top {
  position: relative;
}

.linear-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, #c9a45c 0%, rgba(201, 164, 92, 0.05) 100%);
}

.linear-bottom {
  position: relative;
}

.linear-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, #c9a45c 0%, rgba(201, 164, 92, 0.05) 100%);
}

.linear-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.linear-heading::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: #c9a45c;
}

/* Content Protection Styles */
.content-protected {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.content-protected img {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  pointer-events: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Re-enable selection for form elements */
.content-protected input,
.content-protected textarea,
.content-protected select,
.content-protected button,
.content-protected a,
.content-protected [contenteditable] {
  pointer-events: auto !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Hide text selection on mobile */
.content-protected *::selection {
  background: transparent !important;
}

.content-protected *::-moz-selection {
  background: transparent !important;
}

/* Disable context menu indicator on touch devices */
.content-protected {
  -webkit-touch-callout: none !important;
}

/* Custom Utility Classes */
.text-shadow {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.text-shadow-sm {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.border-gold {
  border-color: #c9a45c;
}

.hover-scale {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

/* Responsive Images */
.responsive-img {
  max-width: 100%;
  height: auto;
  width: auto\9; /* IE8 hack */
}

.img-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.img-contain {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

/* Glass Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-effect-dark {
  background: rgba(30, 36, 54, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(30, 36, 54, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-in;
}

.animate-fade-in-slow {
  animation: fadeIn 1.5s ease-in;
}

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

.animate-spin {
  animation: spin 4s linear infinite;
}

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

.y-rotation {
  animation: rotateY 4s linear infinite;
  transform-style: preserve-3d;
}

@keyframes pulse {
  0% { opacity: 0.95; }
  50% { opacity: 1; }
  100% { opacity: 0.95; }
}

.animate-pulse {
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.animate-fade-out {
  animation: fadeOut 2s ease-in forwards;
  animation-delay: 3s;
}

@keyframes lineGrow {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.animate-line-grow {
  animation: lineGrow 1s ease-out forwards;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1; 
}
 
::-webkit-scrollbar-thumb {
  background: #c9a45c; 
  border-radius: 0 !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #a88942; 
}

/* Custom Buttons */
.btn-gold {
  background-color: #c9a45c;
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  border: none;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.btn-gold:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: 0.5s;
}

.btn-gold:hover {
  background-color: #a88942;
  box-shadow: 0 5px 15px rgba(201, 164, 92, 0.2);
}

.btn-gold:hover:before {
  left: 100%;
}

.btn-outline-gold {
  border: 1px solid #c9a45c;
  color: #c9a45c;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.btn-outline-gold:hover {
  background-color: #c9a45c;
  color: white;
  box-shadow: 0 5px 15px rgba(201, 164, 92, 0.1);
}

/* Custom Containers */
.container-custom {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section Styles */
.section-padding {
  padding: 7rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 5rem 0;
  }
}

/* Hero Overlay */
.hero-overlay {
  background: linear-gradient(to right, rgba(30, 36, 54, 0.9), rgba(30, 36, 54, 0.7), rgba(30, 36, 54, 0.5));
}

/* Underline Effect */
.custom-underline {
  position: relative;
  display: inline-block;
}

.custom-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: #c9a45c;
  transition: width 0.3s ease;
}

.custom-underline:hover::after {
  width: 100%;
}

/* Luxury Elements */
.gold-border {
  border: 1px solid #c9a45c;
}

.luxury-shadow {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.gold-glow {
  box-shadow: 0 0 20px rgba(201, 164, 92, 0.3);
}

/* Image Editing Utilities */
.editable-image {
  position: relative;
}

.editable-image:hover .edit-overlay {
  opacity: 1;
}

.edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 36, 54, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.edit-button {
  background-color: #fff;
  color: #1e2436;
  border: none;
  padding: 8px 16px;
  border-radius: 0 !important;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Text Editing Utilities */
.editable-content {
  position: relative;
  padding: 4px;
  border: 1px dashed transparent;
  transition: border-color 0.3s ease;
}

.editable-content:hover {
  border-color: rgba(201, 164, 92, 0.3);
}

.editable-content:hover .edit-icon {
  opacity: 1;
}

.edit-icon {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #c9a45c;
  color: white;
  padding: 2px;
  border-radius: 0 !important;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Modern Card Styles */
.modern-card {
  position: relative;
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
}

.modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #c9a45c;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

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

/* Slideshow Animation */
@keyframes slideshow {
  0% { opacity: 0; }
  10% { opacity: 1; }
  25% { opacity: 1; }
  35% { opacity: 0; }
  100% { opacity: 0; }
}

.slideshow-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: slideshow 25s infinite;
  background-size: cover;
  background-position: center;
}

.slideshow-item:nth-child(1) { animation-delay: 0s; }
.slideshow-item:nth-child(2) { animation-delay: 5s; }
.slideshow-item:nth-child(3) { animation-delay: 10s; }
.slideshow-item:nth-child(4) { animation-delay: 15s; }
.slideshow-item:nth-child(5) { animation-delay: 20s; }

/* Modern Linear Progress Bar */
.progress-container {
  position: relative;
  height: 2px;
  background: rgba(201, 164, 92, 0.1);
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to right, #c9a45c, #d4b683);
  transition: width 0.5s ease;
}

/* Grid Lines */
.grid-lines {
  position: relative;
}

.grid-lines::before, 
.grid-lines::after {
  content: "";
  position: absolute;
  background-image: linear-gradient(rgba(201, 164, 92, 0.15) 1px, transparent 1px);
  background-size: 100% 20px;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0.5;
}

.grid-lines::after {
  background-image: linear-gradient(90deg, rgba(201, 164, 92, 0.15) 1px, transparent 1px);
  background-size: 20px 100%;
}

/* Remove all rounded corners site-wide */
.rounded, .rounded-md, .rounded-lg, .rounded-xl, .rounded-full, .rounded-sm {
  border-radius: 0 !important;
}

/* Mobile Optimizations */
@media screen and (max-width: 767px) {
  .mobile-img-optimize {
    max-height: 70vh;
    object-fit: cover;
  }
  
  .mobile-container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  .mobile-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  
  .mobile-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .hover-scale:hover {
    transform: none;
  }
  
  .btn-gold:hover,
  .btn-outline-gold:hover {
    transform: scale(1.02);
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .high-dpi-optimized {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .auto-dark {
    filter: invert(1) hue-rotate(180deg);
  }
}

/* Accessibility Enhancements */
:focus {
  outline: 2px solid #c9a45c;
  outline-offset: 2px;  

}

a:focus, button:focus, [role="button"]:focus {
  outline: none;  
}

.keyboard-only-focus:not(:focus-visible) {
  outline: none;  
}

/* Skip to content accessibility feature */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #c9a45c;
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* Animated Gold Circle for AI Highlight */
@keyframes circleRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-highlight {
  position: relative;
  z-index: 1;
}

.ai-highlight::before {
  content: '';
  position: absolute;
  width: 105%;
  height: 105%;
  top: -4%;
  left: -6%;
  border: 2px solid #c9a45c;
  border-radius: 100%;
  animation: circleRotate 10s linear infinite;
  z-index: -1;
}

/* AI Technology Specific Animations */
@keyframes floatUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
  0% { transform: translateX(50px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 0px rgba(201, 164, 92, 0.1); }
  50% { box-shadow: 0 0 10px rgba(201, 164, 92, 0.5); }
  100% { box-shadow: 0 0 0px rgba(201, 164, 92, 0.1); }
}

@keyframes fadeInScale {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

[data-animate-id] {
  opacity: 0;
}

[data-animate-id].animate-active {
  animation: fadeInScale 0.6s forwards;
}

[data-animate-id="vos-title"].animate-active {
  animation: floatUp 0.8s forwards;
}

[data-animate-id="ai-cards-grid"].animate-active {
  animation: slideInRight 0.8s forwards;
}

[data-animate-id^="design-tool-"].animate-active {
  animation: fadeInScale 0.6s forwards;
}

/* AI Technology cards with glow effect */
.ai-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-card:hover {
  transform: translateY(-5px);
  animation: glowPulse 2s infinite;
}

/* AI Technology floating particles animation */
.ai-particles {
  position: relative;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(201, 164, 92, 0.5);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: floatParticle 3s infinite linear;
}

@keyframes floatParticle {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* High contrast mode adjustments */
@media (forced-colors: active) {
  .text-gold, .border-gold, .bg-gold {
    forced-color-adjust: none;
  }
  
  a:focus, button:focus {
    outline: 3px solid HighlightText !important;
  }
}

/* Enhanced focus states for social media icons */
.social-icon-focus:focus {
  outline: 2px solid #c9a45c;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 164, 92, 0.3);
}

/* Performance optimizations */
.will-change-auto {
  will-change: auto;
}

.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Lazy loading optimization */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Modern button hover effects */
.btn-modern {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced Performance Classes */
.optimize-gpu {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

.optimize-text {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.optimize-layout {
  contain: layout style paint;
}

/* Intersection Observer Classes */
.fade-in-observer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-observer.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Mobile Optimization */
@media screen and (max-width: 480px) {
  .mobile-hide {
    display: none !important;
  }
  
  .mobile-text-sm {
    font-size: 0.875rem;
  }
  
  .mobile-p-2 {
    padding: 0.5rem;
  }
  
  .mobile-mt-4 {
    margin-top: 1rem;
  }
}

/* Enhanced tablet optimizations */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .tablet-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tablet-text-lg {
    font-size: 1.125rem;
  }
}

/* Print optimizations */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-block {
    display: block !important;
  }
  
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* Enhanced Focus Management */
.focus-ring {
  outline: 2px solid #c9a45c;
  outline-offset: 2px;
  border-radius: 0;
}

.focus-ring:focus {
  outline: 2px solid #c9a45c;
  outline-offset: 2px;
}

/* Loading states */
.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;
  }
}