:root {
    --primary-color: #592a8a;
    --primary-linear-gradient: linear-gradient(135deg, #20113e, #880081);
    --pdf-icon-bg: #dbeafe;
    --pdf-icon-color: #2563eb;
    --brand: #592b8b;
    --question-hover-border: #8b5cf6;
    --question-hover-text: #8b5cf6;
    --tab-active-text: #8b5cf6;
    --tab-active-border: #8b5cf6;
    --ticker-dot-color: #8b5cf6;
    --document-hover-border: #8b5cf6;
    --brand-contrast: #ffffff;
    --muted: #64748b;
    --card: #f1f5f9;
    --stroke: #e2e8f0;
    --border-beam-color: #9c40ff;
}

/* Ticker animation for seamless infinite loop */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-ticker {
    display: flex;
    width: max-content;
    animation: ticker 60s linear infinite;
}

.animate-ticker:hover {
    animation-play-state: paused;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Segoe UI Semibold', 'Segoe UI Bold', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* Ensure proper font weight loading and fallbacks */
@font-face {
    font-family: 'Segoe UI';
    src: local('Segoe UI');
    font-weight: 400;
}

@font-face {
    font-family: 'Segoe UI';
    src: local('Segoe UI Semibold');
    font-weight: 600;
}

@font-face {
    font-family: 'Segoe UI';
    src: local('Segoe UI Bold');
    font-weight: 700;
}

/* Progressive blur effect for AI panel footer during answer phase */
#aiPanel footer,
.test-container .test-footer {
  position: relative;
}

/* Progressive white overlay - created dynamically by JavaScript */
.progressive-overlay {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

/* Show overlay when answering */
#aiPanel.answering .progressive-overlay,
.test-container.answering .progressive-overlay {
  opacity: 1;
}

/* Progressive overlay for PDF Viewer - fixed at bottom of viewport */
.progressive-overlay-viewer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.6) 60%, rgba(255, 255, 255, 0.8) 80%, rgba(255, 255, 255, 0.95) 100%);
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  display: none;
}

/* Show overlay when PDF viewer is active and content is scrollable */
#pdfViewerContainer:not(.hidden) .progressive-overlay-viewer {
  display: block;
}

/* PDF Text Layer Styles for Text Selection */
.pdf-page-container {
  position: relative;
  margin: 0 auto;
}

/* PDF Viewer Toolbar */
#pdfToolbar {
  flex-shrink: 0;
}

#pdfToolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pdfToolbar button:not(:disabled):hover {
  background-color: #e5e7eb;
}

/* PDF Canvas */
#pdfPagesContainer canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.textLayer {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0;
  line-height: 1;
  user-select: text;
  pointer-events: auto;
}

.textLayer span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}

.textLayer::selection,
.textLayer span::selection {
  background: rgba(0, 0, 255, 0.3);
}

/* Fallback font weights for better distinction */
.font-semibold {
    font-weight: 600 !important;
    font-family: 'Segoe UI', 'Segoe UI Semibold', 'Helvetica Neue', Arial, sans-serif !important;
}

.font-bold {
    font-weight: 700 !important;
    font-family: 'Segoe UI', 'Segoe UI Bold', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Alternative font weight classes that will definitely work */
.font-weight-medium {
    font-weight: 500 !important;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

.font-weight-semibold {
    font-weight: 600 !important;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

.font-weight-bold {
    font-weight: 700 !important;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

.font-weight-extrabold {
    font-weight: 800 !important;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Triangle clip-path for gradient accents */
.clip-path-triangle {
    clip-path: polygon(100% 0%, 0% 0%, 100% 100%);
}

/* Heatmap Styling */
.heatmap-cell {
    position: relative;
    overflow: hidden;
}

/* Questions transition animations */
#suggestions button {
    transition: opacity 0.3s ease-in-out;
}

/* Dynamic question hover colors based on selected gradient */
#suggestions button:hover {
    border-color: var(--question-hover-border) !important;
}

#suggestions button:hover .text-sm {
    color: var(--question-hover-text) !important;
}

/* Heatmap color variations for better data visualization */
.heatmap-positive-strong {
    background: linear-gradient(135deg, #10b981, #059669);
}

.heatmap-positive-moderate {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.heatmap-positive-weak {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
}

.heatmap-negative-strong {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.heatmap-negative-moderate {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

.heatmap-negative-weak {
    background: linear-gradient(135deg, #fca5a5, #f87171);
}

.heatmap-neutral {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}



.website-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.website-image {
    width: 100%;
    height: auto;
    display: block;
}

.wise-gradient-button {
    overflow: hidden;
    position: relative;
}

.wise-gradient-button:before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background-image: var(--primary-linear-gradient);
    opacity: 1;
    transition-property: opacity;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    transition-duration: .3s;
    content: "";
    animation-duration: .3s;
}

.wise-gradient-button:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background-color: var(--primary-color);
    opacity: 0;
    transition-property: opacity;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    transition-duration: .3s;
    content: "";
    animation-duration: .3s;
}

.wise-gradient-button:hover:before {
    opacity: 0;
}

.wise-gradient-button:hover:after {
    opacity: 1;
}

.document-icon {
    transition: all 0.3s ease;
}

/* Modal Styles */
#animationModal.show {
    display: block !important;
}

/* Active animation choice styling */
.animation-choice.active {
    background-color: #e5e7eb;
    border-left: 3px solid #3b82f6;
}

/* Preview particles container */
.preview-particles {
    overflow: hidden;
}

/* Hidden particle groups */
.particle-group-hidden {
    display: none !important;
}

/* Auto-expanding search textarea styles */
#query {
    font-family: inherit;
    line-height: 1.5;
    min-height: 24px;
    max-height: 200px;
    transition: height 0.1s ease-out;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    vertical-align: top;
}

#query:focus {
    outline: none;
}

/* Ensure the search container maintains proper alignment */
.search-container {
    align-items: flex-start;
}

/* Make textarea look like input by removing scrollbars and ensuring proper text alignment */
#query::-webkit-scrollbar {
    display: none;
}

#query {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Ensure proper text alignment and spacing */
#query::placeholder {
    color: #64748b;
    opacity: 1;
}

/* Typing animation styles for notifications */
#notificationText {
    position: relative;
    transition: all 0.1s ease-out;
}

#notificationText.typing::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--ticker-dot-color, #8b5cf6);
    font-weight: bold;
    margin-left: 2px;
    opacity: 1;
    position: relative;
    top: 0px;
    line-height: 1;
    font-size: 1.1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
}

/* Smooth text transitions for typing effects */
#notificationText {
    min-height: 1em;
    display: inline-block;
    vertical-align: middle;
}

#notificationText.typing {
    position: relative;
}

/* Ensure proper alignment of notification container */
#eventNotification {
    align-items: center;
}

/* Dynamic document hover colors based on selected gradient */
#searchContent .group:hover {
    border-color: var(--document-hover-border) !important;
}

/* Dynamic pinned document border color on hover */
#searchContent .group:hover > div {
    border-color: var(--document-hover-border) !important;
}

/* Dynamic pinned document text and icon colors on hover */
#searchContent .group:hover h4,
#searchContent .group:hover svg {
    color: var(--pdf-icon-color) !important;
}

/* Clear button styling */
#clearQueryBtn {
    transition: all 0.2s ease-in-out;
}

#clearQueryBtn:hover {
    background-color: #d1d5db;
}

/* Custom color input styling */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

/* Line clamp utility support */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

/* Hex input styling */
input[type="text"][id*="Hex"] {
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

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

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button Positioning */
#aiButton {
    position: fixed !important;
    bottom: 1.25rem;
    right: 2.25rem;
    z-index: 50 !important;
    /* Ensure no borders, outlines, or focus rings */
    border: none !important;
    outline: none !important;
    /* Base transitions - optimized for smooth magnetic animations like processing */
    transition: transform 0.3s ease-out, filter 0.3s ease-out, box-shadow 0.3s ease-out;
}

/* Mobile drag improvements */
@media (max-width: 768px) {
    #aiButton {
        /* Prevent text selection during drag on mobile */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Improve touch handling - none allows interact.js to handle all touch events */
        -webkit-tap-highlight-color: transparent;
        touch-action: none;
        /* Smooth dragging */
        will-change: right, bottom;
    }
    
    /* Disable transitions and hover effects when dragging */
    #aiButton.dragging {
        transition: none !important;
        transform: none !important;
        filter: none !important;
        box-shadow: none !important;
    }
    
    #aiButton:active:not(.dragging) {
        /* Visual feedback when pressed (but not dragging) */
        opacity: 0.9;
    }
}
/* Blinking cursor animation */
@keyframes blink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0; }
}

/* Force scrollbar to always be present during loader phase and beyond */
#searchContent.loading #searchMainContent,
#searchContent.answering #searchMainContent,
#searchContent.complete #searchMainContent {
    min-height: calc(82vh);
}

/* Streaming answer content styling - only the horizontal lines you liked */
.streaming-answer h2 {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Border Beam Effect for Search Field */
@property --search-beam-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.search-field-border-beam {
    position: relative;
}

.search-field-border-beam::after,
.search-field-border-beam::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background-image: conic-gradient(from var(--search-beam-angle), transparent 70%, var(--border-beam-color));
    opacity: 0.85;
    z-index: -1;
    border-radius: 14px;
    animation: search-beam-spin 1.5s cubic-bezier(1, 0.25, 0, 0.75) infinite;
    pointer-events: none;
}

.search-field-border-beam::before {
    filter: blur(1.5rem);
    opacity: 0.55;
}

@keyframes search-beam-spin {
    from {
        --search-beam-angle: 0deg;
    }
    to {
        --search-beam-angle: 360deg;
    }
}

/* Peers Performance Carousel - Mobile */
/* Hide mobile carousel on desktop */
@media (min-width: 768px) {
    .peers-container-mobile {
        display: none !important;
    }
    .peers-container-desktop {
        display: flex !important;
    }
}

/* Hide desktop grid on mobile, show carousel */
@media (max-width: 767px) {
    .peers-container-desktop {
        display: none !important;
    }
    .peers-container-mobile {
        display: block !important;
    }
    
    /* Smooth scrolling for carousel */
    .peers-container-mobile {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }
    
    .peers-container-mobile::-webkit-scrollbar {
        height: 4px;
    }
    
    .peers-container-mobile::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .peers-container-mobile::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}
