/* Rise Scaffold Management - Premium Custom CSS */
/* Designed to elevate the Tailwind framework with bespoke styling */

html { 
  scroll-behavior: smooth; 
}

/* Custom Properties */
:root {
  --primary: #F97316;
  --primary-dark: #ea580c;
  --secondary: #0B1728;
  --secondary-light: #1e293b;
  --accent: #3b82f6;
  --success: #10B981;
  --warning: #F59E0B;
  --light-gray: #F8FAFC;
  --medium-gray: #64748B;
  --dark-gray: #334155;
}

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

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Selection Styling */
::selection {
  background-color: rgba(249, 115, 22, 0.3);
  color: var(--secondary);
}

/* Smooth Transitions */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Premium Button Effects */
.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

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

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

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

.glass-dark {
  background: rgba(11, 23, 40, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Parallax Background */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Custom Map Background Pattern */
.map-pattern {
  background-image: radial-gradient(var(--medium-gray) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.1;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card Hover Effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Underline Animation */
.underline-animation {
  position: relative;
  display: inline-block;
}

.underline-animation::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

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

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-radius: 50%;
  border-top: 3px solid var(--primary);
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

/* Form Input Focus Effects */
.form-input-focus:focus {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
  border-color: var(--primary);
}

/* Image Overlay Effects */
.image-overlay {
  position: relative;
  overflow: hidden;
}

.image-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(11, 23, 40, 0.2), rgba(11, 23, 40, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-overlay:hover::after {
  opacity: 1;
}

/* Section Divider */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  margin: 4rem auto;
  max-width: 200px;
}

/* Testimonial Quote Styling */
.testimonial-quote::before {
  content: '"';
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.3;
  position: absolute;
  top: -1rem;
  left: -1rem;
  font-family: Georgia, serif;
}

/* Counter Animation */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Mobile Menu Animation */
.mobile-menu-enter {
  transform: translateX(-100%);
}

.mobile-menu-enter-active {
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.mobile-menu-exit {
  transform: translateX(0);
}

.mobile-menu-exit-active {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    color: #000 !important;
    background: #fff !important;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary: #d9461e;
    --secondary: #000814;
  }
}

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

/* Custom Utility Classes */
.text-balance {
  text-wrap: balance;
}

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

/* Focus Visible Polyfill */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

/* Custom Focus Ring */
.focus-ring {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-ring:focus {
  outline-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* Aspect Ratio Containers */
.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1 / 1;
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

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

/* Dark Mode Support (if implemented later) */
@media (prefers-color-scheme: dark) {
  .dark\:invert {
    filter: invert(1);
  }
}

/* Custom Grid Patterns */
.grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(249, 115, 22, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(249, 115, 22, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Hero Section Enhancements */
.hero-gradient {
  background: linear-gradient(135deg, rgba(11, 23, 40, 0.95) 0%, rgba(249, 115, 22, 0.8) 100%);
}

/* Safety Badge Animation */
@keyframes pulse-safety {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

.safety-badge {
  animation: pulse-safety 2s infinite;
}

/* Scaffolding Pattern */
.scaffolding-pattern {
  background-image: 
    linear-gradient(45deg, rgba(249, 115, 22, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(249, 115, 22, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(249, 115, 22, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(249, 115, 22, 0.1) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}