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

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Custom Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Custom animations with delays */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-left {
    animation: slideLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-right {
    animation: slideRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Performance optimization for animations */
@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;
    }
    
    .animate-bounce-gentle,
    .animate-float,
    .animate-pulse-glow,
    .animate-shimmer {
        animation: none !important;
    }
}

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

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

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

::-webkit-scrollbar-track {
    background: #2C3E50;
}

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

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

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Form validation styles */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-success {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.125rem !important;
        line-height: 1.5;
    }
    
    /* Better touch targets */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --brand-gold: #FFD700;
        --foreground: #FFFFFF;
        --background: #000000;
        --border: #FFFFFF;
    }
}

/* Print styles */
@media print {
    .no-print,
    .fixed,
    nav,
    footer,
    button,
    .animate-on-scroll {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    p, div {
        orphans: 3;
        widows: 3;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
}

/* Enhanced error states */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.success-message {
    color: #22c55e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Optimized image loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Better focus management for skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #B59E55;
    color: #000;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.3s;
}

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

/* Ensure proper contrast ratios */
.text-sophisticated-gray {
    color: #9CA3AF; /* Meets WCAG AA standard */
}

.text-muted-foreground {
    color: #9CA3AF; /* Meets WCAG AA standard */
}

/* Enhanced button states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Better form field spacing */
.form-field {
    margin-bottom: 1.5rem;
}

.form-field:last-child {
    margin-bottom: 0;
}

/* Enhanced card hover effects */
.card-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

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

/* Performance optimizations */
.gpu-accelerated {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Video optimizations */
video {
    width: 100%;
    height: auto;
    background-color: #000;
}

video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Responsive typography */
.responsive-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.6;
}

.responsive-heading {
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.2;
}

/* Better list styling */
ul, ol {
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Enhanced table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #455A64;
}

th {
    background-color: #374151;
    font-weight: 600;
}

/* Better blockquote styling */
blockquote {
    border-left: 4px solid #B59E55;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #9CA3AF;
}

/* Enhanced code styling */
code {
    background-color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
}

pre {
    background-color: #374151;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
}

/* Better selection styling */
::selection {
    background-color: #B59E55;
    color: #000;
}

::-moz-selection {
    background-color: #B59E55;
    color: #000;
}

/* Improved placeholder styling */
::placeholder {
    color: #6B7280;
    opacity: 1;
}

::-moz-placeholder {
    color: #6B7280;
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #6B7280;
    opacity: 1;
}

/* Better hr styling */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #455A64, transparent);
    margin: 2rem 0;
}

/* Enhanced tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: #000;
    color: #fff;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Better fieldset styling */
fieldset {
    border: 1px solid #455A64;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

legend {
    font-weight: 600;
    padding: 0 0.5rem;
    color: #B59E55;
}