/* Custom CSS for Solver AI Website */

/* Grid Pattern Background */
.bg-grid-slate-100 {
    background-image: 
        linear-gradient(to right, rgb(241 245 249 / 0.5) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(241 245 249 / 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

.dark .bg-grid-slate-800 {
    background-image: 
        linear-gradient(to right, rgb(30 41 59 / 0.5) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(30 41 59 / 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.8s ease-out;
}

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

/* Hero Section Enhancements */
#home {
    min-height: 100vh;
    background: linear-gradient(135deg, rgb(248 250 252) 0%, rgb(226 232 240) 100%);
}

.dark #home {
    background: linear-gradient(135deg, rgb(15 23 42) 0%, rgb(30 41 59) 100%);
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Card hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

/* Calculator specific styles */
.calculator-container {
    border: 1px solid rgb(226 232 240);
    transition: all 0.3s ease;
}

.dark .calculator-container {
    border-color: rgb(51 65 85);
}

.calculator-tab {
    transition: all 0.2s ease;
    cursor: pointer;
}

.calculator-tab:hover {
    transform: translateY(-1px);
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgb(226 232 240);
    outline: none;
}

.dark input[type="range"] {
    background: rgb(51 65 85);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0EA5E9;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0EA5E9;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Form enhancements */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Timeline styles */
.timeline-item {
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: 3rem;
    background: rgb(226 232 240);
    transform: translateX(-50%);
}

.dark .timeline-item:not(:last-child)::after {
    background: rgb(51 65 85);
}

/* FAQ accordion animations */
.faq-answer {
    transition: all 0.3s ease;
    overflow: hidden;
}

.faq-question svg {
    transition: transform 0.3s ease;
}

/* Button enhancements */
button, .btn {
    position: relative;
    overflow: hidden;
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print styles */
@media print {
    body {
        font-family: 'Times New Roman', serif;
        color: #000 !important;
        background-color: #fff !important;
    }
    
    .no-print,
    header,
    footer,
    nav,
    aside,
    form,
    [data-noprint] {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
    
    a:after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
    
    @page {
        size: A4;
        margin: 2cm;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.25;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        line-height: 1.4;
    }
}

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

/* Focus improvements for accessibility */
*:focus {
    outline: 2px solid #0EA5E9;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0EA5E9;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-slate-50,
    .dark .bg-slate-800 {
        border: 1px solid currentColor;
    }
    
    .text-slate-600,
    .dark .text-slate-300 {
        color: currentColor;
    }
}

/* ROI Calculator specific styles */
.roi-output {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}

.roi-highlight {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Demo section enhancements */
.demo-card {
    position: relative;
    overflow: hidden;
}

.demo-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;
}

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

/* Industries section grid enhancements */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .industry-grid {
        grid-template-columns: 1fr;
    }
}

/* Testimonial and case study highlights */
.metric-highlight {
    position: relative;
    display: inline-block;
}

.metric-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0EA5E9, #22C55E);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.metric-highlight:hover::after {
    transform: scaleX(1);
}

/* Contact form enhancements */
.contact-form input,
.contact-form textarea,
.contact-form select {
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

/* Footer enhancements */
footer {
    background: linear-gradient(135deg, rgb(15 23 42) 0%, rgb(30 41 59) 100%);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-center {
        text-align: center;
    }
}

/* Performance optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Dark mode specific improvements */
.dark {
    color-scheme: dark;
}

.dark img {
    opacity: 0.9;
}

.dark .bg-white {
    background-color: rgb(15 23 42);
}

.dark .bg-slate-50 {
    background-color: rgb(30 41 59);
}

/* Interactive elements */
.interactive:hover {
    cursor: pointer;
}

.interactive:active {
    transform: scale(0.98);
}

/* Gradient text effects */
.gradient-text {
    background: linear-gradient(135deg, #0EA5E9 0%, #0F766E 50%, #22C55E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section dividers */
.section-divider {
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #0EA5E9, #22C55E);
    transform: translateX(-50%);
    border-radius: 2px;
}

/* =========================================
   Enhanced AI Chats Lightbox Gallery Styles
   ========================================= */

:root {
    --ai-lb-bg: rgba(0, 0, 0, 0.85);
    --ai-lb-fg: #ffffff;
    --ai-lb-cap: #e5e7eb;
    --ai-focus: #60a5fa;
    --ai-focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/* Lightbox Container */
.ai-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ai-lightbox.open {
    display: block;
}

/* Backdrop */
.ai-lb-backdrop {
    position: absolute;
    inset: 0;
    background: var(--ai-lb-bg);
    cursor: pointer;
}

/* Content Container */
.ai-lb-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
}

.ai-lb-content > * {
    pointer-events: auto;
}

/* Figure Container */
.ai-lb-content figure {
    max-width: min(95vw, 1400px);
    max-height: 90vh;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Main Image */
.ai-lb-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease;
    object-fit: contain;
}

/* Caption */
.ai-lb-cap {
    color: var(--ai-lb-cap);
    text-align: center;
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    line-height: 1.4;
}

/* Control Buttons */
.ai-lb-close,
.ai-lb-prev,
.ai-lb-next {
    position: absolute;
    appearance: none;
    border: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--ai-lb-fg);
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Close Button */
.ai-lb-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 28px;
    line-height: 1;
}

/* Navigation Buttons */
.ai-lb-prev,
.ai-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    font-size: 32px;
    line-height: 1;
}

.ai-lb-prev {
    left: 20px;
}

.ai-lb-next {
    right: 20px;
}

/* Button Hover & Focus States */
.ai-lb-close:hover,
.ai-lb-prev:hover,
.ai-lb-next:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
    box-shadow: var(--ai-focus-ring);
}

.ai-lb-prev:hover {
    transform: translateY(-50%) scale(1.05);
}

.ai-lb-next:hover {
    transform: translateY(-50%) scale(1.05);
}

.ai-lb-close:focus,
.ai-lb-prev:focus,
.ai-lb-next:focus {
    outline: none;
    box-shadow: var(--ai-focus-ring);
    background: rgba(0, 0, 0, 0.9);
}

/* Active States */
.ai-lb-close:active,
.ai-lb-prev:active,
.ai-lb-next:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 1);
}

.ai-lb-prev:active {
    transform: translateY(-50%) scale(0.95);
}

.ai-lb-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Enhanced Chat Demo Items */
[onclick^="openChatDemo"],
[data-chat-demo] {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

[onclick^="openChatDemo"]:focus,
[data-chat-demo]:focus {
    outline: 3px solid var(--ai-focus);
    outline-offset: 2px;
    border-radius: 12px;
}

[onclick^="openChatDemo"]::after,
[data-chat-demo]::after {
    content: '🔍';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[onclick^="openChatDemo"]:hover::after,
[data-chat-demo]:hover::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-lb-content {
        padding: 16px;
    }
    
    .ai-lb-img {
        max-height: 80vh;
        border-radius: 8px;
    }
    
    .ai-lb-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .ai-lb-prev,
    .ai-lb-next {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .ai-lb-prev {
        left: 16px;
    }
    
    .ai-lb-next {
        right: 16px;
    }
    
    .ai-lb-cap {
        font-size: 1rem;
        margin-top: 12px;
        padding: 0 16px;
    }
    
    /* Touch-friendly spacing on mobile */
    .ai-lb-prev,
    .ai-lb-next {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .ai-lb-content {
        padding: 12px;
    }
    
    .ai-lb-img {
        max-height: 75vh;
        border-radius: 6px;
    }
    
    .ai-lb-prev,
    .ai-lb-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .ai-lb-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .ai-lb-cap {
        font-size: 0.9rem;
        margin-top: 10px;
    }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --ai-lb-bg: rgba(0, 0, 0, 0.92);
        --ai-lb-cap: #d1d5db;
    }
}

.dark {
    --ai-lb-bg: rgba(0, 0, 0, 0.92);
    --ai-lb-cap: #d1d5db;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .ai-lb-close,
    .ai-lb-prev,
    .ai-lb-next {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid white;
    }
    
    .ai-lb-img {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ai-lb-close,
    .ai-lb-prev,
    .ai-lb-next,
    .ai-lb-img,
    [onclick^="openChatDemo"],
    [data-chat-demo] {
        transition: none;
    }
    
    .ai-lb-close:hover,
    .ai-lb-prev:hover,
    .ai-lb-next:hover {
        transform: none;
    }
    
    .ai-lb-prev:hover {
        transform: translateY(-50%);
    }
    
    .ai-lb-next:hover {
        transform: translateY(-50%);
    }
}
