/* Custom CSS for Keeneyes Landing Page - Light Theme, Mobile-First */

/* Removed old search overlay styles - replaced with app interface demo */

/* Removed old scattered visual styles - replaced with app interface demo */

/* Scenario Tab System */
.scenario-tabs {
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.scenario-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Touch target minimum */
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenario-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.05), transparent);
    transition: left 0.6s ease;
}

.scenario-tab:hover::before {
    left: 100%;
}

.scenario-tab:hover {
    background: rgba(250, 250, 248, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.scenario-tab.active {
    background: #FFFFFF;
    color: #0066CC;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
}

.scenario-tab:focus-visible {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
}

/* Scenario Panel Transitions */
.scenario-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.scenario-panel.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Interface Mockup Enhancements */
.interface-mockup {
    position: relative;
}

.search-interface, .relationship-view, .knowledge-map {
    position: relative;
}

.result-item, .interaction-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.result-item:hover, .interaction-item:hover {
    transform: translateX(4px);
}

/* Enhanced Pain Point and Solution Styling */
.pain-point, .solution {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pain-point:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
}

.solution:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.08);
}

/* Demo Cards */
.demo-card {
    position: relative;
    overflow: hidden;
    min-height: 280px; /* Consistent height */
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.03), transparent);
    transition: left 0.8s ease;
}

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

.step-number {
    position: relative;
    overflow: hidden;
    min-width: 40px;
    min-height: 40px;
}

.step-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.demo-card:hover .step-number::before {
    transform: scale(1.2);
}

/* Button enhancements */
button {
    position: relative;
    min-height: 44px; /* Touch target minimum */
}

button::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.6s ease;
}

button:hover::before {
    left: 100%;
}

/* Navbar transitions */
nav {
    transition: all 0.3s ease;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

/* Animation Keyframes */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes search-overlay-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

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

::-webkit-scrollbar-track {
    background: #F5F5F0;
}

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

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

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
}

/* Text selection */
::selection {
    background: rgba(0, 102, 204, 0.15);
    color: #1A1A1A;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    /* Adjust overlay for mobile */
    .overlay-content {
        width: calc(100% - 20px);
        padding: 16px;
        border-radius: 12px;
        margin-top: env(safe-area-inset-top, 20px);
        margin-bottom: env(safe-area-inset-bottom, 20px);
    }

    .search-result {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    /* Ensure overlay doesn't interfere with mobile browser UI */
    .search-results-overlay {
        top: env(safe-area-inset-top, 0);
        bottom: env(safe-area-inset-bottom, 0);
        padding: 10px;
    }

    /* Hide complex animations on mobile for performance */
    .scatter-dot {
        animation: none;
        position: static;
        display: none;
    }

    .scatter-text {
        display: none;
    }

    /* Ensure touch targets are large enough */
    .scenario-tab {
        min-height: 48px;
        padding: 12px 16px;
    }

    /* Stack interface mockups */
    .interface-mockup {
        margin-top: 24px;
    }

    /* Adjust font sizes for mobile */
    .result-item p,
    .interaction-item {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Remove hover effects on mobile */
    .demo-card:hover::before,
    .scenario-tab:hover::before,
    .pain-point:hover,
    .solution:hover {
        transform: none;
        box-shadow: none;
        background: none;
    }
}

@media (max-width: 768px) {
    /* Ensure horizontal scroll works for tabs */
    .scenario-tabs {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .scenario-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Adjust grid layouts */
    .grid.lg\\:grid-cols-2 {
        gap: 24px;
    }

    /* Mobile overlay positioning */
    .search-results-overlay {
        top: -20px;
        bottom: -20px;
    }

    .overlay-content {
        top: 40%;
        max-height: 60vh;
        overflow-y: auto;
        /* Enable smooth scrolling on mobile */
        -webkit-overflow-scrolling: touch;
    }

    /* Handle mobile keyboard appearance */
    .mobile-keyboard-open .search-results-overlay {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 9999;
    }

    .mobile-keyboard-open .overlay-content {
        top: 20% !important;
        max-height: 70vh !important;
        transform: translate(-50%, 0) !important;
    }
}

/* Large screen optimizations */
@media (min-width: 1024px) {
    /* Enhanced hover states */
    .interface-mockup:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08);
    }

    .search-result:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scatter-dot,
    .scatter-text {
        animation: none;
    }

    .search-result {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .search-results-overlay,
    .overlay-backdrop,
    .overlay-content {
        transition-duration: 0.1s !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .scenario-tab.active {
        border: 2px solid #0066CC;
    }

    .result-item {
        border: 1px solid #737373;
    }

    .pain-point {
        border-width: 2px;
    }

    .solution {
        border-width: 2px;
    }

    .search-result {
        border: 2px solid #0066CC;
    }

    .overlay-content {
        border: 2px solid #0066CC;
    }
}

/* Intelligence Demo */
.intelligence-demo {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(10px);
}

.intelligence-demo:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

/* Magnet Button Effect */
.magnet-container {
    position: relative;
    display: inline-block;
    padding: 30px;
    margin: -30px;
}

.magnet-particle {
    position: absolute !important;
    width: 3px !important;
    height: 3px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 50% !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.15) !important;
    z-index: 100 !important;
}

.magnet-container:hover .magnet-particle {
    opacity: 0.8 !important;
}

/* Print styles */
@media print {
    .search-demo,
    .scenario-tabs,
    .scattered-info-visual,
    .search-results-overlay,
    nav {
        display: none;
    }

    .scenario-panel {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Mac App Interface Responsive Styles */
.mac-window, .mac-app {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App content layout adjustments */
.app-content {
    transition: all 0.3s ease;
}

.insights-panel, .solutions-panel {
    transition: all 0.3s ease;
}

/* Mobile responsive for Mac app interfaces */
@media (max-width: 768px) {
    /* Stack app content vertically on mobile */
    .app-content {
        flex-direction: column !important;
        height: auto !important;
        min-height: 400px;
    }

    /* Make panels full width on mobile */
    .transcript-panel,
    .conversation-panel,
    .client-context {
        flex: 1 !important;
        width: 100% !important;
        min-height: 200px;
        max-height: 300px;
        overflow-y: auto;
    }

    .insights-panel,
    .solutions-panel {
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid rgb(226 223 208 / 0.5) !important;
        margin-top: 16px;
        padding-top: 16px;
    }

    /* Adjust Mac window minimum height for mobile */
    .mac-window, .mac-app {
        min-height: 600px !important;
    }

    /* Improve readability on mobile */
    .message-text,
    .text-ink-600 {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    .text-xs {
        font-size: 12px !important;
    }

    .text-sm {
        font-size: 13px !important;
    }

    /* Ensure touch targets are large enough */
    .window-header {
        padding: 16px !important;
        min-height: 56px;
    }

    /* Mobile styles for new Mac app interfaces */
    .app-body {
        padding: 16px !important;
    }

    .developer-profile, .understanding-shift, .client-context {
        margin-bottom: 16px !important;
    }

    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .pattern-recognition .grid, .framework-item {
        grid-template-columns: 1fr !important;
    }

    .recording-timeline,
    .activity-status,
    .knowledge-status {
        padding: 16px !important;
        min-height: 56px;
    }

    /* Hide timeline scrubber details on very small screens */
    .time-display {
        display: none;
    }

    /* Compact spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 12px !important;
    }

    .space-y-3 > * + * {
        margin-top: 8px !important;
    }

    /* Ensure query interface is touch-friendly */
    .query-interface .flex {
        padding: 12px !important;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    /* Extra small screens - more aggressive stacking */
    .mac-window, .mac-app {
        border-radius: 8px !important;
        min-height: 500px !important;
    }

    /* Simplify window header */
    .window-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .window-header .flex:first-child {
        margin-bottom: 8px;
    }

    /* Hide some detailed elements on very small screens */
    .text-ink-300,
    .hidden.sm\\:inline {
        display: none !important;
    }

    /* Ensure pattern cards are readable */
    .pattern-analysis,
    .developer-profile,
    .pattern-recognition,
    .solutions-library,
    .client-context,
    .hidden-dynamics,
    .client-trap {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    /* Stack Mac app content vertically on very small screens */
    .app-body {
        padding: 12px !important;
    }

    .understanding-shift .grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* Stack solution cases vertically */
    .solution-case,
    .context-item {
        margin-bottom: 8px !important;
    }

    /* Improve button spacing */
    .recommendation,
    .strategy-recommendation {
        padding: 12px !important;
        margin-top: 12px !important;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Optimize for tablet landscape */
    .insights-panel,
    .solutions-panel {
        width: 320px !important;
    }

    .text-sm {
        font-size: 13px;
    }

    .text-xs {
        font-size: 11px;
    }
}

/* Waveform Visualization */
.waveform {
    display: flex;
    align-items: center;
    height: 40px;
    gap: 2px;
}

.waveform .bar {
    flex: 1;
    min-width: 3px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Behavioral Fingerprint Visualization */
.fingerprint-viz {
    display: flex;
    align-items: flex-end;
    height: 32px;
    gap: 8px;
}

.fingerprint-viz .metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.fingerprint-viz .metric > div:first-child {
    width: 4px;
    background: currentColor;
    border-radius: 2px;
    margin-bottom: 4px;
}