/* Tensor Production - Main Styles */
/* Extracted from original index.html */

.featured-card {
    position: relative;
    overflow: hidden;
    contain: layout style paint;
    transform: translateZ(0); /* Force hardware acceleration */
}

.featured-card::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;
}

.featured-card:hover::before {
    left: 100%;
}

/* Timeline animations */
.timeline-step {
    opacity: 0.6;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
    /* contain removed to prevent clipping of timeline nodes */
}

/* Timeline container adjustments to prevent node clipping */
.timeline-step {
    position: relative;
    margin: 1rem 0; /* Extra margin for shadow effects */
    padding: 0.5rem 0; /* Extra padding for scale/shadow effects */
}

.timeline-step.active {
    opacity: 1;
    transform: translateY(0);
}

.timeline-step.active .timeline-node {
    box-shadow: 0 0 20px rgba(37, 85, 160, 0.4);
}

.timeline-step.active .bg-white {
    transform: translateY(-3px);
}

/* Ensure timeline nodes have enough space for effects */
.timeline-node {
    transition: all 0.4s ease-out;
    position: relative;
    z-index: 1;
}

/* Timeline section container to prevent overflow issues */
.timeline-container {
    overflow: visible;
    padding: 2rem 0;
}

/* Desktop timeline adjustments */
@media (min-width: 1024px) {
    .timeline-step {
        margin: 1.5rem 0; /* More space on desktop for larger scale effects */
        padding: 1rem 0;
    }
    
    .timeline-container {
        padding: 3rem 0;
    }
}

/* Responsive timeline node scaling */
@media (min-width: 1024px) {
    .timeline-step.active .timeline-node {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(37, 85, 160, 0.4);
    }
    .timeline-step.active .bg-white {
        transform: translateY(-5px);
    }
}

/* Timeline animations rely on keyframes defined in animations.css */

/* Mobile specific adjustments */
@media (max-width: 640px) {
    .timeline-step .bg-white {
        margin-left: 0;
        padding: 1.25rem;
    }
    .timeline-step h3 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    .timeline-step p {
        font-size: 0.875rem;
        line-height: 1.5rem;
    }
}

/* Additional animations defined in animations.css */

/* Custom Tailwind Configuration */
:root {
    --brand-dark: #02113A;
    --brand-purple: #253170;
    --brand-blue: #2655A0;
    --brand-light-blue: #0177BD;
    --brand-yellow: #FCD302;
}

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

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

/* Navigation Enhancements */
.nav-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

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

/* Accessibility Improvements */
.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 Styles */
.focus-visible:focus {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    /* Print optimization */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .timeline-step, .featured-card {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .timeline-step.active .timeline-node {
        border: 3px solid;
        background: HighlightText;
        color: Highlight;
    }
}

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

/* Performance Optimizations */
/* .timeline-step contain removed to prevent clipping of timeline nodes */

.featured-card {
    contain: layout style paint;
    transform: translateZ(0); /* Force hardware acceleration */
}

.testimonials-carousel {
    contain: layout style paint;
}

/* Modern CSS Features */
@supports (backdrop-filter: blur(10px)) {
    .nav-blur {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* CSS Grid and Flexbox Fallbacks */
@supports not (display: grid) {
    .grid {
        display: flex;
        flex-wrap: wrap;
    }
}

/* Form Validation Styles */
input:invalid,
select:invalid,
textarea:invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

input:valid,
select:valid,
textarea:valid {
    border-color: #10b981;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error-state {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.success-state {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover\:scale-105:hover {
        transform: none;
    }
    
    button, 
    .btn,
    [role="button"] {
        min-height: 44px; /* iOS accessibility guidelines */
        min-width: 44px;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #a1a1aa;
    }
    
    /* Implement dark mode styles when needed */
}

/* Critical CSS Inlining Prevention */
.non-critical {
    /* This class ensures certain styles aren't inlined */
    will-change: auto;
}

/* Старые стили галереи удалены - используем lightGallery */

/* lightGallery Custom Styles */
.lg-sub-html {
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.lg-sub-html h4 {
    font-family: inherit;
    color: white !important;
    margin-bottom: 8px;
}

.lg-sub-html p {
    color: #e5e7eb !important;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* lightGallery thumbnails styling */
.lg-thumb-outer {
    background-color: rgba(0, 0, 0, 0.8);
}

.lg-thumb-item {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.lg-thumb-item.active {
    border-color: #2655A0;
}

.lg-thumb-item:hover {
    border-color: #0177BD;
}

/* Inline Gallery Container */
.inline-gallery-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
}

.inline-gallery-container .lg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Inline gallery specific styles */
.lg-inline .lg-item {
    background-color: transparent;
}

.lg-inline .lg-outer .lg-thumb-outer {
    background-color: rgba(0, 0, 0, 0.9);
}

.lg-inline .lg-toolbar {
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.lg-inline .lg-actions .lg-next,
.lg-inline .lg-actions .lg-prev {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: none;
    transition: all 0.3s ease;
}

.lg-inline .lg-actions .lg-next:hover,
.lg-inline .lg-actions .lg-prev:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Hide zoom icons completely */
.lg-inline .lg-zoom-in,
.lg-inline .lg-zoom-out,
.lg-inline .lg-actual-size {
    display: none !important;
} 