/* Research AI Specific Styles */

/* Landing Page Styles */
.screen {
    min-height: 100vh;
}

/* Landing Navigation */
.landing-nav {
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.landing-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.section-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

/* AI Products Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-toggle:hover {
    color: var(--primary-color);
}

.dropdown-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 8px;
    padding-bottom: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item.current {
    background: #4a90e2;
    color: white;
}

.dropdown-item.current .week-badge {
    background: white;
    color: #4a90e2;
}

.dropdown-item.current .product-desc {
    color: rgba(255, 255, 255, 0.9);
}

.week-badge {
    min-width: 44px;
    height: 24px;
    background: #4a90e2;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.week-badge.current {
    background: white;
    color: #4a90e2;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    color: inherit;
}

.product-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 15px;
}

.nav-link:hover {
    color: var(--primary-color);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.cta-button.small {
    padding: 8px 16px;
    font-size: 14px;
}

.cta-button.large {
    padding: 16px 32px;
    font-size: 16px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-color);
    cursor: pointer;
}

.mobile-nav-menu {
    display: none;
}

/* Hero Section */
.hero-section {
    padding: 80px 0 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.cta-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.app-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-card {
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: white;
}

.preview-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-tabs {
    display: flex;
    gap: 8px;
}

.tab {
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.tab.active {
    background: var(--primary-color);
    color: white;
}

.preview-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.value-section {
    padding: 80px 0;
    background: white;
}

.value-header {
    text-align: center;
    margin-bottom: 60px;
}

.value-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.value-header p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.value-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.value-card {
    text-align: center;
    padding: 40px 20px;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.value-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.value-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.features-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-item {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon i {
    color: white;
    font-size: 20px;
}

.feature-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.feature-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item li {
    padding: 6px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.feature-item li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.how-it-works-section {
    padding: 80px 0;
    background: white;
}

.how-it-works-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text-color);
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 24px;
}

.step h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    padding: 80px 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cta-section .cta-button {
    background: white;
    color: var(--primary-color);
}

.cta-section .cta-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.signup-hint {
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.8;
}

.landing-footer {
    background: #1a1a1a;
    color: white;
    padding: 60px 0 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.footer-brand p {
    color: #999;
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-separator {
    height: 1px;
    background: #333;
    margin: 40px 0 20px;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* Navigation */
.research-nav {
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 100%;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-color);
}

.nav-icon {
    color: var(--primary-color);
    font-size: 24px;
}

.nav-brand h2 {
    margin: 0;
    font-size: 20px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.model-selector label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.model-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--background);
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
}

.nav-button {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background-color: var(--surface);
    color: var(--text-color);
}

/* Back to Dashboard Button */
.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    width: auto;
    height: auto;
}

.back-button:hover {
    background-color: var(--primary-hover);
    color: white;
}

.back-button i {
    font-size: 12px;
}

.back-button span {
    font-size: 14px;
}

/* Ensure navigation elements are clickable */
.nav-container,
.nav-actions,
.user-menu,
.nav-button {
    position: relative;
    z-index: 1002;
    pointer-events: auto;
}

.user-menu button {
    pointer-events: auto !important;
}

/* Main Container */
.research-container {
    height: calc(100vh - 73px);
    position: relative;
    overflow: hidden;
}

/* Upload Screen */
.upload-screen {
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.upload-content-scrollable {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.upload-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 20px 40px;
}

.upload-header {
    margin-bottom: 40px;
}

/* When sessions are present, reduce upload header prominence */
.existing-sessions:not([style*="display: none"])~.upload-header h1 {
    font-size: 28px;
}

.existing-sessions:not([style*="display: none"])~.upload-header p {
    font-size: 16px;
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.upload-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 60px 40px;
    background-color: var(--background);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.02);
}

.upload-placeholder {
    pointer-events: none;
}

.upload-placeholder .upload-button {
    pointer-events: auto;
}

.upload-placeholder i {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-placeholder p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-button {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.upload-button:hover {
    background-color: var(--primary-hover);
}

.upload-progress {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Research Screen */
.research-screen {
    height: 100%;
    display: flex;
    background-color: var(--surface);
}

.pdf-panel {
    width: 60%;
    background-color: var(--background);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.pdf-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
}

.pdf-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.pdf-title i {
    color: var(--error-color);
    font-size: 16px;
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-control-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-control-btn:hover {
    background-color: var(--surface);
    color: var(--text-color);
}

#zoom-level {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.pdf-viewer-container {
    flex: 1;
    overflow: auto;
    position: relative;
    background-color: #f5f5f5;
}

.pdf-viewer {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.pdf-page {
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    background-color: white;
    position: relative;
}

.pdf-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* PDF Text Layer - for text selection with minimal visibility */
.pdf-text-layer {
    position: absolute !important;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2 !important;
    /* Slightly more visible for better selection */
    line-height: 1;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    pointer-events: auto;
    z-index: 10 !important;
    /* Ensure it's above canvas */
}

.pdf-text-layer>span {
    color: transparent !important;
    /* Invisible text */
    -webkit-text-fill-color: transparent !important;
    /* Ensure webkit browsers respect transparency */
    position: absolute;
    white-space: pre;
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    transform-origin: 0% 0%;
}

/* Chrome-specific selection override - text-indent technique */
html body .pdf-text-layer>span::selection {
    background-color: rgba(0, 123, 255, 0.4) !important;
    /* Blue highlight */
    color: transparent !important;
    /* Force transparent */
    -webkit-text-fill-color: transparent !important;
    /* Chrome override */
    text-shadow: none !important;
    text-indent: -9999px !important;
    /* Push text off screen */
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 1px !important;
    line-height: 1px !important;
}

html body .pdf-text-layer>span::-moz-selection {
    background-color: rgba(0, 123, 255, 0.4) !important;
    /* Blue highlight */
    color: transparent !important;
    /* Force transparent */
    text-shadow: none !important;
    text-indent: -9999px !important;
    /* Push text off screen */
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 1px !important;
    line-height: 1px !important;
}

/* Ensure text layer divs are properly positioned */
.pdf-text-layer .textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

/* Text selection highlighting - make more visible */
.pdf-text-layer ::selection {
    background: rgba(0, 100, 255, 0.3) !important;
}

.pdf-text-layer ::-moz-selection {
    background: rgba(0, 100, 255, 0.3) !important;
}

/* Alternative selection styles for better visibility */
.pdf-text-layer span::selection {
    background: rgba(51, 144, 255, 0.4) !important;
}

.pdf-text-layer span::-moz-selection {
    background: rgba(51, 144, 255, 0.4) !important;
}

/* Global selection styles for PDF viewer */
.pdf-viewer ::selection {
    background: rgba(51, 144, 255, 0.35) !important;
}

.pdf-viewer ::-moz-selection {
    background: rgba(51, 144, 255, 0.35) !important;
}

/* Ensure text divs created by PDF.js are selectable */
.textLayer {
    opacity: 0.2 !important;
    /* Slightly more visible for better selection */
    line-height: 1;
    z-index: 10 !important;
    position: absolute !important;
}

/* Chrome-specific textLayer selection - text-indent technique */
html body .textLayer>span::selection {
    background-color: rgba(0, 123, 255, 0.4) !important;
    /* Blue highlight */
    color: transparent !important;
    /* Force transparent */
    -webkit-text-fill-color: transparent !important;
    /* Chrome override */
    text-shadow: none !important;
    text-indent: -9999px !important;
    /* Push text off screen */
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 1px !important;
    line-height: 1px !important;
}

html body .textLayer>span::-moz-selection {
    background-color: rgba(0, 123, 255, 0.4) !important;
    /* Blue highlight */
    color: transparent !important;
    /* Force transparent */
    text-shadow: none !important;
    text-indent: -9999px !important;
    /* Push text off screen */
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 1px !important;
    line-height: 1px !important;
}

.textLayer>span {
    color: transparent !important;
    /* Invisible text */
    -webkit-text-fill-color: transparent !important;
    /* Ensure webkit browsers respect transparency */
    position: absolute;
    white-space: pre;
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.textLayer .highlight {
    margin: -1px;
    padding: 1px;
    background-color: rgba(180, 0, 170, 0.3);
    border-radius: 4px;
}

.textLayer .highlight.begin {
    border-radius: 4px 0 0 4px;
}

.textLayer .highlight.end {
    border-radius: 0 4px 4px 0;
}

.textLayer .highlight.middle {
    border-radius: 0;
}

.textLayer .highlight.selected {
    background-color: rgba(0, 100, 255, 0.3);
}

/* Ensure proper stacking context for PDF pages */
.pdf-page {
    position: relative;
    margin: 0 auto 20px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdf-page canvas {
    display: block;
    position: relative;
    z-index: 1;
}

.pdf-highlight {
    position: absolute;
    background-color: rgba(255, 255, 0, 0.3);
    border: 1px solid rgba(255, 193, 7, 0.8);
    pointer-events: none;
}

.pdf-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface);
}

.page-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--surface);
    color: var(--text-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* Chat Panel */
.chat-panel {
    width: 40%;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
}

.chat-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.chat-title i {
    color: var(--primary-color);
    font-size: 16px;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background-color: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.status-indicator.thinking {
    color: var(--warning-color);
    border-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.status-indicator.ready {
    color: var(--success-color);
    border-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

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

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    min-width: 0;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.ai-message .message-avatar {
    background-color: var(--primary-color);
    color: white;
}

.user-message .message-avatar {
    background-color: var(--surface);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.message-content {
    background-color: var(--surface);
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    line-height: 1.5;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Enhanced Message Typography and Formatting */
.message-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.user-message .message-text {
    color: white;
}

/* AI Response Formatting */
.ai-message .message-text {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
}

.ai-message .message-text h1,
.ai-message .message-text h2,
.ai-message .message-text h3,
.ai-message .message-text h4,
.ai-message .message-text h5,
.ai-message .message-text h6 {
    margin: 8px 0 4px 0;
    font-weight: 600;
    color: var(--text-color);
}

.ai-message .message-text h1:first-child,
.ai-message .message-text h2:first-child,
.ai-message .message-text h3:first-child,
.ai-message .message-text h4:first-child,
.ai-message .message-text h5:first-child,
.ai-message .message-text h6:first-child {
    margin-top: 0;
}

.ai-message .message-text h1 {
    font-size: 18px;
}

.ai-message .message-text h2 {
    font-size: 17px;
}

.ai-message .message-text h3 {
    font-size: 16px;
}

.ai-message .message-text h4 {
    font-size: 15px;
}

.ai-message .message-text p {
    margin: 6px 0;
    line-height: 1.6;
}

.ai-message .message-text p:first-child {
    margin-top: 0;
}

.ai-message .message-text p:last-child {
    margin-bottom: 0;
}

/* Lists */
.ai-message .message-text ul,
.ai-message .message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message .message-text li {
    margin: 2px 0;
    line-height: 1.5;
}

/* Code formatting */
.ai-message .message-text code {
    background-color: rgba(0, 0, 0, 0.06);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    color: #d63384;
}

.ai-message .message-text pre {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.ai-message .message-text pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* Blockquotes */
.ai-message .message-text blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 8px 0;
    padding: 6px 0 6px 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Links */
.ai-message .message-text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.ai-message .message-text a:hover {
    border-bottom-color: var(--primary-color);
}

/* Tables */
.ai-message .message-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.ai-message .message-text th,
.ai-message .message-text td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.ai-message .message-text th {
    background-color: var(--surface);
    font-weight: 600;
}

/* Emphasis */
.ai-message .message-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.ai-message .message-text em {
    font-style: italic;
}

/* Highlighting for key information */
.ai-message .message-text .highlight-box {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

/* Academic formatting for research content */
.ai-message .message-text .key-points {
    background-color: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 6px 6px 0;
}

.ai-message .message-text .key-points h4 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 600;
}

/* Special formatting for research-specific content */
.ai-message .message-text .research-term {
    background-color: rgba(74, 144, 226, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.ai-message .message-text .pdf-reference {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #6c757d;
    font-family: monospace;
}

.ai-message .message-text .section-number {
    color: var(--primary-color);
    font-weight: 600;
}

.ai-message .message-text .numbered-point {
    margin: 8px 0;
    padding-left: 8px;
}

.ai-message .message-text .academic-emphasis {
    background-color: #fff3cd;
    padding: 1px 4px;
    border-radius: 3px;
    color: #856404;
}

/* Code block enhancements */
.ai-message .message-text .code-block {
    position: relative;
    margin: 12px 0;
}

.ai-message .message-text .code-block .copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.ai-message .message-text .code-block:hover .copy-code {
    opacity: 1;
}

/* Better spacing for streaming messages */
.message.streaming .message-text {
    min-height: 20px;
}

.message.streaming .typing-indicator {
    margin-top: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-message .message-text {
        font-size: 14px;
        line-height: 1.5;
    }

    .ai-message .message-text h1 {
        font-size: 16px;
    }

    .ai-message .message-text h2 {
        font-size: 15px;
    }

    .ai-message .message-text h3 {
        font-size: 14px;
    }

    .ai-message .message-text h4 {
        font-size: 14px;
    }

    .ai-message .message-text pre {
        font-size: 12px;
        padding: 8px;
    }
}

.message-citations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.citation-link {
    display: inline-block;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: inherit;
    text-decoration: none;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 4px;
    transition: var(--transition);
}

.citation-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.welcome-message .message-content {
    background-color: rgba(0, 102, 204, 0.05);
    border: 1px solid rgba(0, 102, 204, 0.1);
    color: var(--text-color);
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface);
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-family: inherit;
    line-height: 1.4;
    background-color: var(--background);
}

.send-button {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.send-button:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.input-hints {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.model-indicator {
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-content p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-color);
}

/* Typing Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingDot {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pdf-panel {
        width: 50%;
    }

    .chat-panel {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px;
    }

    .nav-actions {
        gap: 12px;
    }

    .model-selector label {
        display: none;
    }

    .model-dropdown {
        min-width: 120px;
    }

    /* Mobile back button adjustments */
    .back-button span {
        display: none;
        /* Hide "Dashboard" text on mobile */
    }

    .back-button {
        padding: 8px;
        min-width: 36px;
    }

    .research-screen {
        flex-direction: column;
    }

    .pdf-panel,
    .chat-panel {
        width: 100%;
    }

    .pdf-panel {
        height: 60%;
    }

    .chat-panel {
        height: 40%;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .upload-content {
        padding: 20px;
    }

    .upload-header h1 {
        font-size: 24px;
    }

    .upload-area {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .nav-brand h2 {
        font-size: 18px;
    }

    .upload-header h1 {
        font-size: 20px;
    }

    .upload-header p {
        font-size: 16px;
    }

    .pdf-header,
    .chat-header,
    .pdf-footer,
    .chat-input-area {
        padding: 12px 16px;
    }

    .chat-messages {
        padding: 16px;
    }

    .message {
        max-width: 95%;
    }
}

/* Landing Page Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }

    .hero-title {
        font-size: 42px;
    }

    .value-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .steps-row {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .landing-nav {
        margin-top: 12px;
    }

    .section-nav {
        display: flex;
        gap: 0;
    }

    .section-nav>.nav-link:not(.dropdown-toggle) {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-nav-menu.open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }

    .mobile-nav-links {
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .hero-section {
        padding: 140px 0 80px;
    }

    .hero-container {
        gap: 40px;
        padding: 0 20px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .container {
        padding: 0 20px;
    }

    .value-section,
    .features-section,
    .how-it-works-section,
    .cta-section {
        padding: 60px 0;
    }

    .value-header h2,
    .features-header h2,
    .how-it-works-section h2,
    .cta-section h2 {
        font-size: 30px;
    }

    .value-cards {
        gap: 30px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .steps-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .feature-item {
        padding: 24px;
        text-align: center;
    }

    .features-grid .feature-item {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: left;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .cta-button {
        padding: 14px 20px;
        font-size: 14px;
    }

    .cta-button.large {
        padding: 16px 24px;
        font-size: 15px;
    }

    .nav-logo {
        width: 28px;
        height: 28px;
    }

    .container {
        padding: 0 16px;
    }

    .value-cards {
        grid-template-columns: 1fr;
    }

    .features-grid,
    .steps-row {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Session Display Styles */
.existing-sessions {
    margin: 0 0 60px 0;
    /* Top of page, with space below */
    width: 100%;
    max-width: 100%;
}

.sessions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.sessions-header h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.sessions-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sessions Grid */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Session Card */
.session-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.session-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.session-file-icon {
    width: 40px;
    height: 40px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.session-file-icon i {
    color: var(--error-color);
    font-size: 18px;
}

.session-info {
    flex: 1;
    min-width: 0;
    /* For text truncation */
}

.session-filename {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-action-btn {
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 12px;
}

.session-action-btn:hover {
    background: var(--surface);
    color: var(--text-color);
}

.session-action-btn.delete-session:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

.session-card-body {
    padding: 16px;
}

.session-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.session-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.session-stat i {
    font-size: 12px;
    color: var(--primary-color);
}

.session-card-footer {
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
}

.session-resume-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.session-resume-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Loading and Empty States */
.sessions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.sessions-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.sessions-loading p {
    margin: 0;
    font-size: 14px;
}

.sessions-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.sessions-empty i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.sessions-empty p {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.sessions-empty span {
    font-size: 14px;
    color: var(--text-secondary);
}

.sessions-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.sessions-error i {
    font-size: 32px;
    color: var(--error-color);
    margin-bottom: 12px;
}

.sessions-error p {
    margin: 0 0 16px 0;
    font-size: 14px;
}

.retry-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--primary-hover);
}

/* Responsive Grid for Sessions */
/* Scrollable content adjustments */
.upload-content-scrollable::-webkit-scrollbar {
    width: 8px;
}

.upload-content-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.upload-content-scrollable::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.upload-content-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .upload-content-scrollable {
        padding: 10px 0;
    }

    .upload-content {
        padding: 10px 20px;
    }

    .sessions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sessions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .session-card-header {
        padding: 12px;
    }

    .session-card-body {
        padding: 12px;
    }

    .session-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .session-filename {
        font-size: 15px;
    }

    .existing-sessions {
        margin: 0 0 40px 0;
    }
}

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

    .session-card {
        margin: 0 -10px;
        /* Expand to edges on mobile */
    }

    .session-stats {
        gap: 6px;
    }

    .session-stat {
        font-size: 12px;
    }

    .sessions-header h3 {
        font-size: 20px;
    }
}

/* PDF Loading and Placeholder Styles */
.pdf-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.loading-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text-color);
    font-weight: 500;
}

.loading-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
    background-color: var(--surface);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    margin: 20px;
}

.pdf-placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.pdf-placeholder-text h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-color);
    font-weight: 500;
}

.pdf-placeholder-text p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Responsive adjustments for loading/placeholder */
@media (max-width: 768px) {

    .pdf-loading-state,
    .pdf-placeholder {
        min-height: 300px;
        padding: 30px 20px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 20px;
    }

    .pdf-placeholder-icon {
        font-size: 48px;
        margin-bottom: 16px;
    }

    .loading-text h3,
    .pdf-placeholder-text h3 {
        font-size: 16px;
    }

    .loading-text p,
    .pdf-placeholder-text p {
        font-size: 13px;
    }
}

/* ====================================
   Maven & Discord Banner Styles
   ==================================== */

/* Maven Course Announcement Banner */
.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #4338ca 0%, #c084fc 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.announcement-banner.show {
    transform: translateY(0);
}

.announcement-banner.hiding {
    transform: translateY(-100%);
}

.banner-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.banner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 200px;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.banner-badge i {
    font-size: 0.875rem;
}

.banner-text {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.banner-text strong {
    font-weight: 600;
    font-size: 0.95rem;
}

.banner-separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    font-size: 0.85rem;
}

.banner-detail {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.banner-countdown {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    animation: countdown-glow 2s ease-in-out infinite;
}

@keyframes countdown-glow {

    0%,
    100% {
        background: rgba(255, 255, 255, 0.15);
    }

    50% {
        background: rgba(255, 255, 255, 0.25);
    }
}

.banner-students {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.banner-students i {
    font-size: 0.7rem;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.banner-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #4338ca;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 180px;
}

.banner-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: #3730a3;
}

.banner-cta i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.banner-cta:hover i {
    transform: translateX(4px);
}

.banner-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.banner-close i {
    font-size: 0.875rem;
}

/* Discord Community Banner */
.discord-banner {
    background: linear-gradient(135deg, #5865F2 0%, #7289DA 100%);
}

.discord-badge {
    animation: discord-pulse 2s ease-in-out infinite;
}

@keyframes discord-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.banner-members {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.banner-members i {
    font-size: 0.7rem;
}

.discord-cta {
    background: white;
    color: #5865F2;
}

.discord-cta:hover {
    color: #4752C4;
}

/* Adjust body padding based on which banners are visible */
body.maven-visible {
    padding-top: 60px;
}

body.discord-visible {
    padding-top: 60px;
}

body.both-banners-visible {
    padding-top: 120px;
}

/* Adjust navigation based on which banners are visible */
body.maven-visible .landing-nav {
    top: 60px;
}

body.discord-visible .landing-nav {
    top: 60px;
}

body.both-banners-visible .landing-nav {
    top: 120px;
}

/* Legacy support for single banner */
body.banner-visible {
    padding-top: 60px;
}

body.banner-visible .landing-nav {
    top: 60px;
}

/* Responsive Design for Banners */
@media (max-width: 768px) {

    /* Banner mobile styles - Stacked Layout */
    .announcement-banner {
        padding: 8px 12px;
    }

    .banner-container {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .banner-content {
        flex-direction: column;
        gap: 6px;
        align-items: center;
        text-align: center;
    }

    .banner-badge,
    .discord-badge {
        display: flex;
        width: 100%;
        min-width: auto;
        max-width: 240px;
        padding: 5px 12px;
        font-size: 0.7rem;
        justify-content: center;
    }

    .banner-text {
        flex-direction: column;
        gap: 4px;
        width: 100%;
        font-size: 0.85rem;
    }

    .banner-text strong {
        font-size: 0.85rem;
    }

    .banner-detail,
    .banner-countdown,
    .banner-students,
    .banner-members {
        font-size: 0.8rem;
    }

    .banner-separator {
        display: none;
    }

    .banner-actions {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .banner-cta {
        flex: 1;
        max-width: 240px;
        padding: 8px 16px;
        font-size: 0.85rem;
        min-width: 150px;
    }

    .banner-close {
        width: 28px;
        height: 28px;
    }

    .banner-close i {
        font-size: 0.8rem;
    }

    /* Mobile body padding adjustments - optimized spacing (130px) */
    body.maven-visible,
    body.discord-visible,
    body.banner-visible {
        padding-top: 130px !important;
    }

    body.both-banners-visible {
        padding-top: 260px !important;
    }

    body.maven-visible .landing-nav,
    body.discord-visible .landing-nav,
    body.banner-visible .landing-nav {
        top: 130px !important;
    }

    body.both-banners-visible .landing-nav {
        top: 260px !important;
    }
}

/* ==================================
   Screencatch Image Messages
   ================================== */

/* Image Message Container */
.image-message-container {
    margin: 8px 0;
    max-width: 500px;
}

.message-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.image-zoom-btn,
.image-download-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.image-zoom-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.image-zoom-btn:hover {
    background: var(--background);
}

.image-download-btn {
    background: var(--accent-color);
    border: none;
    color: white;
}

.image-download-btn:hover {
    background: #3a7fd5;
}

/* Image Zoom Modal */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.image-zoom-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-zoom-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-zoom-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-zoom-actions {
    margin-top: 16px;
}

.image-zoom-download {
    background: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.image-zoom-download:hover {
    background: #3a7fd5;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ============================================
   SUBSCRIPTION UI COMPONENTS
   ============================================ */

/* Subscription Info Container */
.subscription-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fb 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subscription-info:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Tier Badge */
.tier-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-transform: capitalize;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Free Tier */
.tier-badge.tier-free {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

/* Researcher Tier */
.tier-badge.tier-researcher {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Professional Tier */
.tier-badge.tier-professional {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* Enterprise Tier */
.tier-badge.tier-enterprise {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

/* Usage Summary */
.usage-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.usage-summary span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.usage-summary span:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.usage-summary i {
    font-size: 12px;
    color: #64748b;
    opacity: 0.8;
}

/* Subscription Button */
.subscription-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subscription-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.subscription-btn:active {
    transform: translateY(0);
}

/* Upgrade Button Style */
.subscription-btn.btn-upgrade {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.subscription-btn.btn-upgrade::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 ease;
}

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

.subscription-btn.btn-upgrade:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

/* Manage Plan Button Style */
.subscription-btn:not(.btn-upgrade) {
    background: white;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.subscription-btn:not(.btn-upgrade):hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Usage Limit Modal */
.tier-comparison-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.tier-option {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tier-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.tier-option.recommended {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.tier-option h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.tier-option p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tier-option .price {
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .subscription-info {
        display: none;
        /* Hide on mobile for now to save space */
    }
}