/**
 * TabPilot Styles
 * 
 * Acrobat PDF Spaces Theme - Dark sidebar with light content area
 */

/* === Variables === */
:root {
    --tp-bg-primary: #ffffff;
    --tp-bg-secondary: #f9f9f9;
    --tp-bg-tertiary: #f5f5f5;
    --tp-bg-hover: #e8e8e8;
    --tp-sidebar-bg: rgba(255, 255, 255, 0.8);
    --tp-sidebar-hover: rgba(0, 120, 212, 0.08);
    --tp-sidebar-active: #e3f2fd;
    --tp-header-bg: rgba(255, 255, 255, 0.95);
    --tp-text-primary: #2c2c2c;
    --tp-text-secondary: #505050;
    --tp-text-muted: #787878;
    --tp-sidebar-text: #505050;
    --tp-sidebar-text-muted: #787878;
    --tp-accent: #0078d4;
    --tp-accent-hover: #106ebe;
    --tp-accent-light: #0078d4;
    --tp-acrobat-red: #d13438;
    --tp-acrobat-blue: #0078d4;
    --tp-border: #e1e1e1;
    --tp-sidebar-border: rgba(0, 0, 0, 0.08);
    --tp-success: #10b981;
    --tp-warning: #f59e0b;
    --tp-error: #ef4444;
    --tp-radius: 12px;
    --tp-radius-sm: 6px;
    --tp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --tp-sidebar-width-collapsed: 70px;
    --tp-sidebar-width-expanded: 240px;
}

/* === Container === */
.tabpilot-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    color: var(--tp-text-primary);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* === Sidebar === */
.tabpilot-sidebar {
    width: var(--tp-sidebar-width-collapsed);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 250, 252, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--tp-sidebar-border);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.tabpilot-sidebar:hover {
    width: var(--tp-sidebar-width-expanded);
    box-shadow: 4px 0 24px rgba(0, 120, 212, 0.1);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
}

/* === Sidebar Shine Effect === */
.tabpilot-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.tabpilot-sidebar:hover::after {
    left: 100%;
}

.sidebar-header {
    padding: 20px;
    background: transparent;
    border-bottom: 1px solid var(--tp-sidebar-border);
    display: flex;
    justify-content: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sidebar-icon {
    font-size: 24px;
}

.sidebar-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 120, 212, 0.2));
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tp-text-primary);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabpilot-sidebar:hover .sidebar-title {
    opacity: 1;
    transform: translateX(0);
}

/* === Main Content Area === */
.tabpilot-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === Header === */
.tabpilot-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabpilot-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 120, 212, 0.05);
    padding: 16px 24px;
}

.tabpilot-header.scrolled .tabpilot-title {
    font-size: 16px;
}

.tabpilot-header.scrolled .header-search-wrapper {
    height: 38px;
}

/* === Animated Gradient Underline === */
.tabpilot-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--tp-acrobat-blue) 20%,
        var(--tp-accent-hover) 50%,
        var(--tp-acrobat-blue) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: gradientSlide 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tabpilot-header:hover::after {
    opacity: 0.3;
}

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

.tabpilot-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tabpilot-icon {
    font-size: 24px;
}

.tabpilot-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tp-text-primary);
    white-space: nowrap;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Chat Header Styling === */
.tabpilot-header.chat-header {
    background: 
        linear-gradient(135deg, 
            rgba(0, 120, 212, 0.05) 0%, 
            rgba(16, 110, 190, 0.03) 50%,
            rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(0, 120, 212, 0.12);
    box-shadow: 
        0 2px 8px rgba(0, 120, 212, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 20px 24px;
    position: relative;
}

.tabpilot-header.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 120, 212, 0.04),
        transparent
    );
    animation: shimmerChat 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerChat {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

.tabpilot-header.chat-header::after {
    opacity: 0.15;
}

.tabpilot-header.chat-header .tabpilot-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.tabpilot-header.chat-header .tabpilot-title {
    font-size: 20px;
    margin-bottom: 2px;
}

.header-subtitle-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out;
}

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

.header-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--tp-text-secondary);
    margin: 0;
    line-height: 1.4;
    opacity: 0.85;
}

.header-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(0, 120, 212, 0.08);
    border: 1px solid rgba(0, 120, 212, 0.15);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--tp-acrobat-blue);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 2px 6px rgba(0, 120, 212, 0.08),
        0 0 0 0 rgba(0, 120, 212, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: fit-content;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.header-privacy-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.header-privacy-badge:hover {
    background: rgba(0, 120, 212, 0.12);
    border-color: rgba(0, 120, 212, 0.25);
    box-shadow: 
        0 3px 10px rgba(0, 120, 212, 0.15),
        0 0 0 4px rgba(0, 120, 212, 0.05);
    transform: translateY(-1px);
}

.header-privacy-badge:hover::before {
    transform: translate(-50%, -50%) scale(2);
}

.privacy-icon {
    font-size: 12px;
    display: flex;
    align-items: center;
}

.privacy-text {
    letter-spacing: 0.3px;
    line-height: 1;
}

/* === Header Search === */
.header-search-wrapper {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 10px;
    height: 42px;
    position: relative;
}

.header-search-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--tp-acrobat-blue);
    box-shadow: 
        0 0 0 4px rgba(0, 120, 212, 0.1),
        0 4px 16px rgba(0, 120, 212, 0.15);
    transform: scale(1.01);
}

/* Animated border glow for header search */
.header-search-wrapper::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(0, 120, 212, 0.3) 0%,
        rgba(16, 110, 190, 0.2) 50%,
        rgba(0, 120, 212, 0.3) 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.header-search-wrapper:focus-within::before {
    opacity: 1;
    animation: borderPulse 2s ease-in-out infinite;
}

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

.header-search-icon {
    font-size: 16px;
    color: var(--tp-text-muted);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.header-search-wrapper:focus-within .header-search-icon {
    color: var(--tp-acrobat-blue);
}

.header-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--tp-text-primary);
    font-size: 14px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.header-search-input::placeholder {
    color: var(--tp-text-muted);
    transition: color 0.3s ease;
}

.header-search-wrapper:focus-within .header-search-input::placeholder {
    color: var(--tp-acrobat-blue);
    opacity: 0.6;
}

/* === Animated Search Icon === */
@keyframes searchPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.header-search-wrapper:focus-within .header-search-icon:not(.search-spinner) {
    animation: searchPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(0, 120, 212, 0.4));
}

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

/* === Organize Button (Gradient Pill) === */
.header-organize-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    border: none;
    border-radius: 28px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(0, 120, 212, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Gradient animation on button */
.header-organize-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

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

.header-organize-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 
        0 8px 24px rgba(0, 120, 212, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.header-organize-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(0.98);
}

.header-organize-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
}

.header-organize-btn.loading {
    animation: pulse 1s infinite, gradientShift 2s ease-in-out infinite;
}

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

/* === Organize Button Icon === */
.header-organize-btn span {
    transition: all 0.3s ease;
}

.header-organize-btn:hover span {
    letter-spacing: 0.5px;
}

/* === Icon Bounce on Cluster Update === */
@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.header-organize-btn.success {
    animation: iconBounce 0.6s ease-in-out;
}

.tabpilot-stats {
    font-size: 11px;
    color: var(--tp-text-muted);
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tabpilot-stats:hover {
    background: rgba(0, 120, 212, 0.08);
    color: var(--tp-acrobat-blue);
}

/* === Responsive Header === */
@media (max-width: 900px) {
    .tabpilot-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-search-wrapper {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }
    
    .tabpilot-stats {
        display: none;
    }
}

/* === Search Bar === */
.tabpilot-search {
    display: none; /* Hidden - search is now in header */
    padding: 20px 24px;
    background: transparent;
    border-bottom: none;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 0 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(0, 120, 212, 0.04);
    position: relative;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.2) 0%, 
        rgba(16, 110, 190, 0.1) 50%,
        rgba(0, 120, 212, 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.search-input-wrapper:focus-within {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 120, 212, 0.12),
        0 4px 12px rgba(0, 120, 212, 0.08),
        0 0 0 4px rgba(0, 120, 212, 0.05);
}

.search-input-wrapper:focus-within::before {
    opacity: 1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        background: linear-gradient(135deg, 
            rgba(0, 120, 212, 0.3) 0%, 
            rgba(16, 110, 190, 0.15) 50%,
            rgba(0, 120, 212, 0.3) 100%);
    }
    50% {
        background: linear-gradient(135deg, 
            rgba(0, 120, 212, 0.5) 0%, 
            rgba(16, 110, 190, 0.25) 50%,
            rgba(0, 120, 212, 0.5) 100%);
    }
}

.search-icon {
    font-size: 20px;
    color: var(--tp-text-muted);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--tp-acrobat-blue);
    transform: scale(1.1);
}

.search-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--tp-border);
    border-top-color: var(--tp-acrobat-blue);
    border-right-color: var(--tp-acrobat-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--tp-text-primary);
    font-size: 15px;
    font-weight: 400;
    padding: 14px 0;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--tp-text-muted);
    font-weight: 400;
    transition: color 0.3s ease;
}

.search-input:focus::placeholder {
    color: var(--tp-acrobat-blue);
    opacity: 0.6;
}

/* === AI Typing Indicator === */
.search-input:not(:placeholder-shown) {
    font-weight: 500;
    color: var(--tp-acrobat-blue);
}

/* === Keyboard Shortcut Hint === */
.search-shortcut {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--tp-text-muted);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
}

.search-shortcut kbd {
    font-family: inherit;
    font-size: inherit;
}

.search-input-wrapper:focus-within .search-shortcut {
    opacity: 0;
    transform: scale(0.9);
}

.search-clear {
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.search-clear:active {
    transform: scale(0.92);
}

.search-hint {
    font-size: 12px;
    color: var(--tp-text-muted);
    margin-top: 10px;
    text-align: center;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.8;
}

/* === Content === */
.tabpilot-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* === Loading State === */
.tabpilot-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--tp-text-secondary);
    gap: 16px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tp-border);
    border-top-color: var(--tp-acrobat-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === AI Pulse Effect === */
@keyframes aiPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(0, 120, 212, 0));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 8px rgba(0, 120, 212, 0.4));
    }
}

.search-input-wrapper:focus-within .search-icon:not(.search-spinner) {
    animation: aiPulse 2s ease-in-out infinite;
}

/* === Shimmer Effect on Idle === */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

.search-input-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: 2s;
    pointer-events: none;
}

.search-input-wrapper:focus-within::after {
    display: none;
}

/* === Empty State === */
.tabpilot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tabpilot-empty h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--tp-text-primary);
}

.tabpilot-empty p {
    margin: 0 0 8px;
    color: var(--tp-text-secondary);
    max-width: 280px;
}

.empty-hint {
    font-size: 12px;
    color: var(--tp-text-muted);
}

/* === Error State === */
.tabpilot-error {
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid var(--tp-error);
    color: var(--tp-error);
    font-size: 13px;
}

/* === Smart Recents === */
.tabpilot-recents {
    padding: 16px 20px;
}

.recents-group {
    margin-bottom: 24px;
}

.recents-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

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

.group-header {
    padding: 12px 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tp-text-primary);
    background: transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === Document Item === */
.tabpilot-doc-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    position: relative;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.tabpilot-doc-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.1) 0%, 
        rgba(16, 110, 190, 0.05) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tabpilot-doc-item:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 24px rgba(0, 120, 212, 0.12),
        0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 120, 212, 0.2);
}

.tabpilot-doc-item:hover::before {
    opacity: 1;
}

.tabpilot-doc-item:active {
    transform: translateY(-2px);
}

/* Card Header with Icon and Type */
.doc-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 250, 252, 0.7) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid var(--tp-sidebar-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tabpilot-doc-item:hover .doc-icon {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.15);
    border-color: rgba(0, 120, 212, 0.3);
}

.doc-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.doc-type-icon {
    font-size: 22px;
}

.doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--tp-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-bottom: 4px;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--tp-text-secondary);
    flex-wrap: wrap;
}

.doc-domain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.08) 0%, 
        rgba(16, 110, 190, 0.05) 100%);
    border-radius: 8px;
    font-weight: 500;
    font-size: 11px;
    color: var(--tp-acrobat-blue);
    border: 1px solid rgba(0, 120, 212, 0.15);
}

.doc-domain-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.doc-url {
    font-size: 11px;
    color: var(--tp-text-muted);
}

.doc-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--tp-text-muted);
    margin-top: 2px;
}

.doc-visit-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tabpilot-doc-item:hover .doc-visit-count {
    background: rgba(0, 120, 212, 0.1);
    color: var(--tp-acrobat-blue);
}

/* === Card Shine Effect === */
.tabpilot-doc-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.tabpilot-doc-item:hover::after {
    left: 100%;
}

/* === Card Shimmer on Load === */
@keyframes cardShimmer {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabpilot-doc-item {
    animation: cardShimmer 0.5s ease-out backwards;
}

.tabpilot-doc-item:nth-child(1) { animation-delay: 0.05s; }
.tabpilot-doc-item:nth-child(2) { animation-delay: 0.1s; }
.tabpilot-doc-item:nth-child(3) { animation-delay: 0.15s; }
.tabpilot-doc-item:nth-child(4) { animation-delay: 0.2s; }
.tabpilot-doc-item:nth-child(5) { animation-delay: 0.25s; }
.tabpilot-doc-item:nth-child(6) { animation-delay: 0.3s; }

.doc-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    background: var(--tp-bg-secondary);
    color: var(--tp-text-secondary);
    border: 1px solid var(--tp-border);
    transition: all 0.2s ease;
}

.tabpilot-doc-item:hover .badge {
    transform: translateY(-1px);
}

.badge-type {
    font-size: 14px;
    padding: 4px 8px;
}

.badge-downloaded {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.12) 0%, 
        rgba(16, 185, 129, 0.08) 100%);
    color: var(--tp-success);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge-history {
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.12) 0%, 
        rgba(245, 158, 11, 0.08) 100%);
    color: var(--tp-warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-chunks {
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.12) 0%, 
        rgba(0, 120, 212, 0.08) 100%);
    color: var(--tp-acrobat-blue);
    border-color: rgba(0, 120, 212, 0.3);
    font-weight: 600;
}

/* === Search Results === */
.tabpilot-results {
    padding: 8px 0;
}

.results-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--tp-border);
}

.results-count {
    font-size: 13px;
    color: var(--tp-text-secondary);
}

.results-list {
    padding: 8px 0;
}

/* === Result Item === */
.tabpilot-result-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--tp-sidebar-border);
    position: relative;
}

.tabpilot-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabpilot-result-item:hover {
    background: linear-gradient(90deg, rgba(0, 120, 212, 0.03) 0%, transparent 100%);
}

.tabpilot-result-item:hover::before {
    width: 3px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.result-title {
    font-weight: 500;
    color: var(--tp-text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-score {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.score-high {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tp-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tp-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-low {
    background: rgba(0, 120, 212, 0.1);
    color: var(--tp-acrobat-blue);
    border: 1px solid rgba(0, 120, 212, 0.3);
}

.result-snippet {
    font-size: 13px;
    color: var(--tp-text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    font-style: italic;
}

.result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--tp-text-muted);
}

/* === Sidebar Footer === */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--tp-sidebar-border);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-stats {
    font-size: 10px;
    color: var(--tp-text-muted);
    text-align: center;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    height: 0;
    overflow: hidden;
}

.tabpilot-sidebar:hover .sidebar-stats {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-bottom: 10px;
}

.sidebar-refresh-btn {
    width: 100%;
    min-width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--tp-border);
    color: var(--tp-text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    border-radius: var(--tp-radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
}

.tabpilot-sidebar:hover .sidebar-refresh-btn {
    gap: 8px;
    padding: 0 14px;
    height: auto;
    min-height: 42px;
}

.sidebar-refresh-btn:hover {
    background: var(--tp-acrobat-blue);
    border-color: var(--tp-acrobat-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

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

.sidebar-refresh-btn::before {
    content: '↻';
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-refresh-btn span {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
}

.tabpilot-sidebar:hover .sidebar-refresh-btn span {
    opacity: 1;
    transform: translateX(0);
    max-width: 100px;
}

/* Rotate icon on hover */
.sidebar-refresh-btn:hover::before {
    animation: rotateRefresh 0.6s ease-in-out;
}

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

/* Icon-only styling when collapsed */
.sidebar-refresh-btn {
    overflow: hidden;
}

/* Make button more circular when collapsed */
@media (min-width: 1px) {
    .sidebar-refresh-btn {
        aspect-ratio: auto;
    }
}

/* Tooltip for collapsed state */
.sidebar-refresh-btn::after {
    content: 'Refresh';
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
}

.sidebar-refresh-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.tabpilot-sidebar:hover .sidebar-refresh-btn::after {
    display: none;
}

/* === Footer === */
.tabpilot-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    color: var(--tp-text-muted);
    font-weight: 500;
}

.tabpilot-footer::before {
    content: '🔒';
    margin-right: 6px;
}

.tabpilot-refresh-btn {
    background: var(--tp-bg-primary);
    border: 1px solid var(--tp-border);
    color: var(--tp-text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--tp-radius-sm);
    transition: all 0.2s;
}

.tabpilot-refresh-btn:hover {
    background: var(--tp-acrobat-blue);
    color: white;
    border-color: transparent;
}

/* === Scrollbar === */
.tabpilot-content::-webkit-scrollbar {
    width: 8px;
}

.tabpilot-content::-webkit-scrollbar-track {
    background: var(--tp-bg-secondary);
}

.tabpilot-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tabpilot-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* === Tab Navigation (Sidebar) === */
.tabpilot-tabs {
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
    flex: 1;
    gap: 8px;
}

.tabpilot-tab {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    color: var(--tp-sidebar-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--tp-radius);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.tabpilot-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--tp-acrobat-blue);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabpilot-tab:hover {
    background: var(--tp-sidebar-hover);
}

.tabpilot-tab.active {
    color: var(--tp-acrobat-blue);
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.12) 0%, 
        rgba(0, 120, 212, 0.08) 100%);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
}

.tabpilot-tab.active::before {
    height: 60%;
}

.tabpilot-tab.active .tab-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 120, 212, 0.3));
}

.tab-icon {
    font-size: 20px;
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabpilot-tab:hover .tab-icon {
    transform: scale(1.1);
}

.tabpilot-tab span:not(.tab-icon) {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tabpilot-sidebar:hover .tabpilot-tab span:not(.tab-icon) {
    opacity: 1;
    transform: translateX(0);
}

/* === Tooltip for collapsed state === */
.tabpilot-tab::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tabpilot-tab:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.tabpilot-sidebar:hover .tabpilot-tab::after {
    display: none;
}

/* === Chat Panel === */
.chat-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

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

.chat-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--tp-text-primary);
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--tp-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--tp-radius);
    line-height: 1;
    transition: all 0.15s;
}

.chat-close-btn:hover {
    background: var(--tp-bg-hover);
    color: var(--tp-text-primary);
}

.chat-ai-banner {
    padding: 8px 16px;
    font-size: 12px;
    text-align: center;
}

.chat-ai-banner.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tp-success);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.chat-ai-banner.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tp-warning);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.chat-ai-banner a {
    color: var(--tp-accent-light);
    text-decoration: underline;
    margin-left: 8px;
}

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

/* === Hero-Style Empty State === */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    text-align: center;
    min-height: 500px;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 120, 212, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 110, 190, 0.02) 0%, transparent 50%);
}

.chat-empty::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(0deg, rgba(0, 120, 212, 0.02) 0px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, rgba(0, 120, 212, 0.02) 0px, transparent 1px, transparent 40px);
    pointer-events: none;
    opacity: 0.5;
}

/* Brain Icon Container */
.chat-empty-icon {
    position: relative;
    margin-bottom: 32px;
    animation: floatIcon 3s ease-in-out infinite;
    z-index: 1;
}

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

.brain-icon {
    font-size: 80px;
    filter: drop-shadow(0 8px 20px rgba(0, 120, 212, 0.15));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 8px 20px rgba(0, 120, 212, 0.15));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 12px 30px rgba(0, 120, 212, 0.25));
    }
}

.sparkle-1, .sparkle-2 {
    position: absolute;
    font-size: 24px;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle-1 {
    top: -10px;
    right: -10px;
    animation-delay: 0s;
}

.sparkle-2 {
    bottom: 5px;
    left: -15px;
    animation-delay: 1s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

/* Title & Subtitle */
.chat-empty-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--tp-text-primary);
    margin: 0 0 12px;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.chat-empty-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: var(--tp-text-secondary);
    margin: 0 0 48px;
    line-height: 1.6;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

/* Example Cards Container */
.chat-examples-container {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.chat-examples-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 20px;
}

.chat-example-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-example-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 120, 212, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-align: left;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out backwards;
}

.chat-example-card:nth-child(1) {
    animation-delay: 0.1s;
}

.chat-example-card:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-example-card:nth-child(3) {
    animation-delay: 0.3s;
}

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

.chat-example-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 120, 212, 0.05),
        transparent
    );
    transition: left 0.5s ease;
}

.chat-example-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--tp-acrobat-blue);
    box-shadow: 
        0 6px 20px rgba(0, 120, 212, 0.12),
        0 0 0 1px rgba(0, 120, 212, 0.1);
    transform: translateY(-3px) scale(1.02);
}

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

.chat-example-card:active {
    transform: translateY(-1px) scale(1);
}

.example-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.1) 0%, 
        rgba(16, 110, 190, 0.05) 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.chat-example-card:hover .example-icon {
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.15) 0%, 
        rgba(16, 110, 190, 0.1) 100%);
    transform: scale(1.1) rotate(5deg);
}

.example-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--tp-text-primary);
    line-height: 1.4;
    flex: 1;
}

.chat-message {
    max-width: 85%;
}

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

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message-content {
    padding: 12px 16px;
    border-radius: var(--tp-radius);
    line-height: 1.6;
    white-space: pre-wrap;
}

.chat-message.user .chat-message-content {
    background: var(--tp-acrobat-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-message-content {
    background: var(--tp-bg-secondary);
    color: var(--tp-text-primary);
    border: 1px solid var(--tp-border);
    border-bottom-left-radius: 4px;
}

.chat-cursor {
    animation: blink 1s infinite;
    color: var(--tp-acrobat-blue);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.chat-sources {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--tp-bg-secondary);
    border-radius: var(--tp-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.chat-sources-label {
    font-size: 11px;
    color: var(--tp-text-muted);
    margin-right: 4px;
    font-weight: 500;
}

.chat-source-btn {
    background: var(--tp-bg-primary);
    border: 1px solid var(--tp-border);
    color: var(--tp-acrobat-blue);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--tp-radius);
    cursor: pointer;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s;
}

.chat-source-btn:hover {
    background: var(--tp-acrobat-blue);
    color: white;
    border-color: var(--tp-acrobat-blue);
}

.chat-loading-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chat-loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--tp-acrobat-blue);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chat-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* === Modern Chat Input Bar === */
.chat-input-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 120, 212, 0.1);
    box-shadow: 
        0 -4px 16px rgba(0, 0, 0, 0.03),
        0 -1px 3px rgba(0, 0, 0, 0.02);
    position: relative;
    animation: slideUpForm 0.4s ease-out;
}

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

.chat-input-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 120, 212, 0.3) 20%,
        rgba(16, 110, 190, 0.4) 50%,
        rgba(0, 120, 212, 0.3) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: gradientShine 3s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.8;
}

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

.chat-input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 120, 212, 0.12);
    border-radius: 24px;
    color: var(--tp-text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
}

.chat-input:hover {
    border-color: rgba(0, 120, 212, 0.2);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.06),
        inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.chat-input:focus {
    border-color: var(--tp-acrobat-blue);
    box-shadow: 
        0 0 0 4px rgba(0, 120, 212, 0.1),
        0 4px 16px rgba(0, 120, 212, 0.12);
    background: rgba(255, 255, 255, 1);
    transform: scale(1.01);
}

.chat-input::placeholder {
    color: var(--tp-text-muted);
    transition: color 0.3s ease;
}

.chat-input:focus::placeholder {
    color: rgba(0, 120, 212, 0.5);
}

.chat-input:not(:focus):empty {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        border-color: rgba(0, 120, 212, 0.12);
    }
    50% {
        border-color: rgba(0, 120, 212, 0.2);
    }
}

.chat-send-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(0, 120, 212, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 120, 212, 0.35),
        0 3px 10px rgba(0, 0, 0, 0.1);
}

.chat-send-btn:hover:not(:disabled)::before {
    transform: translate(-50%, -50%) scale(2);
}

.chat-send-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Neural Back Button ===== */
.neural-back-container {
    border-bottom: 1px solid var(--tp-border);
    background: var(--tp-bg-primary);
}

.neural-back-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: var(--tp-text-primary);
    cursor: pointer;
    transition: all 0.2s;
    gap: 12px;
    font-weight: 600;
}

.neural-back-header:hover {
    background: var(--tp-bg-secondary);
}

.neural-back-header.expanded {
    background: var(--tp-bg-tertiary);
}

.neural-back-icon {
    font-size: 18px;
}

.neural-back-title {
    flex: 1;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

.neural-back-arrow {
    font-size: 10px;
    color: var(--tp-text-muted);
    transition: transform 0.2s;
}

.neural-back-content {
    padding: 0 16px 16px;
}

.neural-back-loading,
.neural-back-error,
.neural-back-empty {
    text-align: center;
    padding: 20px;
    color: var(--tp-text-secondary);
    font-size: 13px;
}

.neural-back-loading .loading-spinner {
    display: inline-block;
    animation: pulse 1s infinite;
    margin-right: 8px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.neural-back-error {
    color: var(--tp-danger);
}

.retry-btn {
    margin-left: 10px;
    padding: 5px 12px;
    background: var(--tp-bg-primary);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    color: var(--tp-text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.retry-btn:hover {
    background: var(--tp-acrobat-blue);
    color: white;
    border-color: var(--tp-acrobat-blue);
}

.neural-back-empty p {
    margin: 8px 0;
}

.neural-back-empty .hint {
    font-size: 11px;
    color: var(--tp-text-muted);
}

.neural-back-subtitle {
    font-size: 11px;
    color: var(--tp-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.neural-back-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.neural-back-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    gap: 12px;
    width: 100%;
}

.neural-back-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--tp-acrobat-blue);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.item-rank {
    font-size: 11px;
    font-weight: 600;
    min-width: 22px;
    color: var(--tp-acrobat-blue);
}

.item-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-title {
    font-size: 13px;
    color: var(--tp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-similarity {
    font-size: 11px;
    color: var(--tp-success);
    font-weight: 500;
}

.item-arrow {
    color: var(--tp-text-muted);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.neural-back-item:hover .item-arrow {
    opacity: 1;
}

.refresh-btn {
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    background: var(--tp-bg-primary);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    color: var(--tp-text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.refresh-btn:hover {
    background: var(--tp-acrobat-blue);
    color: white;
    border-color: var(--tp-acrobat-blue);
}

/* ===== Footer Actions ===== */
.footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tabpilot-cluster-btn {
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--tp-acrobat-blue) 0%, var(--tp-accent-hover) 100%);
    border: none;
    border-radius: var(--tp-radius);
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.tabpilot-cluster-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.4);
}

.tabpilot-cluster-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

.tabpilot-cluster-btn.loading {
    animation: pulse 1s infinite;
}

/* ===== Cluster Group Styles ===== */
.cluster-group {
    background: transparent;
    border-radius: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cluster-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
    color: var(--tp-text-primary);
}

.cluster-icon {
    font-size: 16px;
}

.cluster-count {
    margin-left: auto;
    background: linear-gradient(135deg, 
        rgba(0, 120, 212, 0.12) 0%, 
        rgba(16, 110, 190, 0.08) 100%);
    color: var(--tp-acrobat-blue);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(0, 120, 212, 0.2);
}


