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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --text-dark: #1a202c;
    --text-medium: #2d3748;
    --text-light: #4a5568;
    --text-muted: #718096;
    --border-radius: 12px;
    --shadow-light: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.15);
    --shadow-heavy: 0 16px 64px rgba(0,0,0,0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Poppins', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Global text improvements for better visibility */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
}

p, span, div {
    color: var(--text-medium);
}

.text-muted {
    color: var(--text-muted);
}

/* Ensure high contrast on white backgrounds */
.tab-content *:not(.overview-card):not(.overview-card *) {
    color: var(--text-medium);
}

.tab-content h1, .tab-content h2, .tab-content h3, .tab-content h4, .tab-content h5, .tab-content h6 {
    color: var(--text-dark);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

.loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    animation: loadingProgress 3s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerGlow {
    0%, 100% { transform: rotate(0deg); opacity: 0.5; }
    50% { transform: rotate(180deg); opacity: 0.8; }
}

.header-content {
    position: relative;
    z-index: 2;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.brain-icon {
    animation: brainPulse 2s ease-in-out infinite;
    margin-right: 15px;
}

@keyframes brainPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 25px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.stat-item i {
    font-size: 1.2rem;
}

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

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: white;
    border-radius: var(--border-radius);
    padding: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.nav-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: var(--transition);
}

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

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active::before {
    display: none;
}

.tab-btn:hover:not(.active) {
    background: var(--light-bg);
    transform: translateY(-1px);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.1);
    min-height: 600px;
    color: #2d3748;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.section h2 {
    color: #1a202c;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    text-shadow: none;
}

.section h3 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 15px;
}

.section p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Overview Styles */
.rag-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.overview-card {
    background: var(--secondary-gradient);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: var(--transition);
    opacity: 0;
}

.overview-card:hover::before {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

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

.overview-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-heavy);
}

.card-icon {
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: var(--transition);
}

.overview-card:hover .card-icon {
    transform: scale(1.1) rotate(360deg);
    background: rgba(255,255,255,0.3);
}

.card-icon i {
    font-size: 2rem;
}

.overview-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.overview-card p {
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

.card-highlight {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.rag-flow {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.flow-step {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-width: 120px;
    color: #2d3748;
    border: 2px solid #e2e8f0;
}

.flow-step h4 {
    color: #1a202c;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.flow-step p {
    color: #4a5568;
    font-size: 0.85rem;
    margin: 0;
}

.flow-step i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.flow-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.flow-step.active i {
    color: white;
}

.arrow {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
}

/* Process Container */
.process-container {
    margin-top: 30px;
}

.step-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.demo-help {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.demo-help i {
    color: #ffd700;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::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: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Stages */
.indexing-stages {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.stage {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 16px;
    border-left: 5px solid #667eea;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.stage.active {
    opacity: 1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(10px);
}

.stage h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Document Styles */
.document-container {
    display: flex;
    justify-content: center;
}

.document {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    transition: all 0.5s ease;
}

.document i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.document span {
    display: block;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #1a202c;
}

.document-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
    color: #2d3748;
}

.document.processing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Chunks */
.chunks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.chunk {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chunk.animate {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chunk-header {
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 10px;
    font-size: 1rem;
}

.chunk-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #2d3748;
}

/* Embedding Visualization */
.embedding-container {
    display: flex;
    justify-content: center;
}

.embedding-process {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 500px;
}

.text-input {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-style: italic;
}

.embedding-model {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.embedding-model i {
    font-size: 1.5rem;
}

.arrow-down {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
}

.vector-output {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
}

.vector-visualization {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.vector-value {
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Vector Database */
.database-container {
    display: flex;
    justify-content: center;
}

.vector-db {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 100%;
}

.vector-db h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 1.3rem;
}

.vector-db h4 i {
    color: #667eea;
    margin-right: 10px;
}

.vectors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vector-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.vector-item-header {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 5px;
    font-size: 1rem;
}

.vector-item-preview {
    font-size: 0.9rem;
    color: #4a5568;
}

/* Query Processing Styles */
.query-container {
    margin-top: 30px;
}

.query-input-section {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 300px;
}

#user-query {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    margin-bottom: 10px;
}

#user-query:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestion {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.suggestion:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.query-stages {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.query-stage {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 16px;
    border-left: 5px solid #28a745;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.query-stage.active {
    opacity: 1;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    transform: translateX(10px);
}

.query-stage h3 {
    color: #1a202c;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.query-stage p {
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Query Embedding Visualization */
.query-embedding-viz {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.query-text {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-style: italic;
    max-width: 300px;
    color: #2d3748;
    font-weight: 500;
}

.arrow-right {
    font-size: 2rem;
    color: #28a745;
    font-weight: bold;
}

.query-vector {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Similarity Search */
.similarity-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.query-vector-display {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.stored-vectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.stored-vector {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #dc3545;
}

.stored-vector.matching {
    border-left-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    transform: scale(1.05);
}

.similarity-score {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 10px;
}

.vector-content {
    font-size: 0.9rem;
    color: #2d3748;
    line-height: 1.5;
}

/* Retrieved Context */
.retrieved-context {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.context-chunk {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    animation: fadeInSlideUp 0.5s ease forwards;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.context-chunk-header {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 10px;
}

/* Generation Container */
.generation-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.context-input {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 300px;
}

.context-input h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.combined-input {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.llm-processing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.llm-processing i {
    font-size: 1.5rem;
}

.final-response {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* Interactive Chat */
.interactive-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    height: 600px;
}

.chat-interface {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message i {
    font-size: 1.5rem;
    margin-top: 5px;
}

.message.bot-message i {
    color: #667eea;
}

.message.user-message i {
    color: #28a745;
}

.message span {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.5;
    color: #2d3748;
}

.message.user-message span {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.chat-input-container {
    padding: 20px;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

#chat-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Process Monitor */
.process-monitor {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
}

.process-monitor h3 {
    color: #1a202c;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.monitor-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.monitor-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.monitor-step i {
    font-size: 1.5rem;
    color: #667eea;
    width: 30px;
}

.monitor-step span {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
    font-size: 1rem;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.idle {
    background: #e9ecef;
    color: #6c757d;
}

.status.processing {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1s infinite;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header-stats {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-btn {
        justify-content: flex-start;
        padding: 15px 20px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .flow-diagram {
        flex-direction: column;
        gap: 15px;
    }
    
    .arrow {
        transform: rotate(90deg);
        font-size: 2rem;
    }
    
    .rag-overview {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .interactive-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 20px;
    }
    
    .query-embedding-viz,
    .generation-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .arrow-right {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }
    
    .step-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .demo-help {
        order: -1;
        text-align: center;
    }
    
    .query-input-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-wrapper {
        min-width: auto;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .completion-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-stats .stat-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .tab-btn span {
        font-size: 0.9rem;
    }
    
    .overview-card {
        padding: 20px;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
    }
    
    .card-icon i {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .stage h3 {
        font-size: 1.2rem;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .message {
        max-width: 90%;
    }
}

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

/* Focus styles for keyboard navigation */
.tab-btn:focus,
.btn:focus,
input:focus,
button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-gradient: linear-gradient(135deg, #0000ff 0%, #000080 100%);
        --secondary-gradient: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
        --text-dark: #000000;
        --text-light: #333333;
    }
    
    .overview-card,
    .tab-btn.active {
        border: 2px solid #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .tab-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .stage {
        background: #374151;
    }
    
    .stage.active {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
    
    .document,
    .chunk,
    .vector-item,
    .stored-vector,
    .context-chunk {
        background: #374151;
        color: #e2e8f0;
    }
    
    .chat-interface {
        background: #374151;
    }
    
    .message span {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .process-monitor {
        background: #374151;
    }
    
    .monitor-step {
        background: #4a5568;
    }
}

/* Print styles */
@media print {
    .loading-screen,
    .nav-tabs,
    .btn,
    .chat-interface,
    .process-monitor {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .tab-content {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .header {
        color: black !important;
    }
    
    .overview-card {
        background: #f8f9fa !important;
        color: black !important;
        break-inside: avoid;
    }
}

/* Enhanced animations for better UX */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes softGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.6); }
}

.overview-card:hover {
    animation: gentleFloat 3s ease-in-out infinite;
}

.tab-btn.active {
    animation: softGlow 2s ease-in-out infinite;
}

/* Loading animations for better feedback */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced notification system */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition);
    max-width: 400px;
    border-left: 4px solid #667eea;
}

.notification.success { border-left-color: #28a745; }
.notification.error { border-left-color: #dc3545; }
.notification.warning { border-left-color: #ffc107; }
.notification.info { border-left-color: #17a2b8; }

.notification.show {
    transform: translateX(0);
}

.notification i {
    font-size: 1.2rem;
}

.notification.success i { color: #28a745; }
.notification.error i { color: #dc3545; }
.notification.warning i { color: #ffc107; }
.notification.info i { color: #17a2b8; }

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    margin-left: auto;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--light-bg);
    color: var(--text-dark);
}

/* Enhanced tooltip system */
.tooltip {
    position: absolute;
    background: var(--dark-bg);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 1001;
    opacity: 0;
    transform: translateY(5px);
    transition: var(--transition);
    pointer-events: none;
    white-space: nowrap;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-bg) transparent transparent transparent;
}

/* Enhanced loading components */
.stage-loading, .progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.step-counter {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-bar-container {
    width: 100px;
    height: 4px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Completion animations */
.completion-animation, .query-completion {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.completion-animation.show, .query-completion.show {
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    background: rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.success-icon i {
    font-size: 2rem;
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.completion-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 8px;
}

.completion-stats .stat i {
    font-size: 1.5rem;
}

.completion-stats .stat span {
    font-size: 0.9rem;
}

/* Footer Styles */
.footer {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
    margin-top: 80px;
    overflow: hidden;
}

.footer-wave {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
    transform: rotateY(180deg);
}

.footer-wave path {
    fill: var(--light-bg);
}

.footer-content {
    position: relative;
    padding: 80px 20px 30px;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
    align-items: start;
}

.footer-left {
    animation: slideInLeft 1s ease-out;
}

.footer-right {
    animation: slideInRight 1s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.developer-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.developer-avatar {
    flex-shrink: 0;
    position: relative;
}

.developer-avatar i {
    font-size: 4rem;
    color: #667eea;
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.developer-details h3 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.developer-title {
    color: #a0aec0;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    opacity: 0.9;
}

.developer-description {
    color: #cbd5e0;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
}

.social-links h4 {
    color: #f7fafc;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.social-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderSpin 3s linear infinite;
}

@keyframes borderSpin {
    to {
        transform: rotate(360deg);
    }
}

.social-link.gmail {
    background: linear-gradient(135deg, #ea4335, #fbbc05);
}

.social-link.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.social-link.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
}

.social-link.medium {
    background: linear-gradient(135deg, #12100e, #2d2d2d);
}

.social-link.github {
    background: linear-gradient(135deg, #333, #24292e);
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.social-link i {
    font-size: 1.5rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.social-link:hover i {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    80% {
        transform: translateY(-4px);
    }
}

.tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(0,0,0,0.8);
}

.social-link:hover .tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -45px;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.05);
    padding: 20px 25px;
    border-radius: 15px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.stat-card i {
    font-size: 2rem;
    color: #667eea;
    animation: statIconPulse 2s ease-in-out infinite;
}

@keyframes statIconPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f7fafc;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #a0aec0;
    font-weight: 500;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    text-align: center;
}

.footer-divider {
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin: 0 auto 20px;
    border-radius: 2px;
    animation: dividerGlow 2s ease-in-out infinite;
}

@keyframes dividerGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

.footer-copyright p {
    color: #a0aec0;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.footer-tech {
    color: #718096;
    font-size: 0.85rem !important;
    font-weight: 500;
}

.heart-beat {
    color: #e53e3e;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 50%, 100% {
        transform: scale(1);
    }
    25%, 75% {
        transform: scale(1.2);
    }
}

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 15s linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.particle:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
    animation-duration: 15s;
}

.particle:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 18s;
}

.particle:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
    animation-duration: 14s;
}

.particle:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
    animation-duration: 16s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Responsive Design for Footer */
@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .developer-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .developer-details h3 {
        font-size: 1.8rem;
    }
    
    .social-icons {
        gap: 15px;
    }
    
    .social-link {
        width: 50px;
        height: 50px;
    }
    
    .social-link i {
        font-size: 1.3rem;
    }
    
    .footer-stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .stat-card {
        justify-content: center;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 60px 15px 20px;
    }
    
    .developer-details h3 {
        font-size: 1.5rem;
    }
    
    .developer-description {
        font-size: 0.9rem;
    }
    
    .social-links h4 {
        font-size: 1.1rem;
    }
}
