/* CSS Variables for Consistent Color Scheme */
:root {
    /* Primary Colors */
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-cyan: #06b6d4;
    --primary-green: #10b981;
    --primary-red: #ef4444;
    
    /* Secondary Colors */
    --secondary-blue: #2563eb;
    --secondary-purple: #7c3aed;
    --secondary-cyan: #0891b2;
    --secondary-green: #059669;
    --secondary-red: #dc2626;
    
    /* Dark Theme Base Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-quaternary: #475569;
    --bg-quinary: #64748b;
    
    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #3b82f6;
    
    /* Content Background */
    --content-bg: #f8fafc;
    --content-bg-secondary: #f1f5f9;
    
    /* Border Colors */
    --border-primary: rgba(59, 130, 246, 0.2);
    --border-secondary: rgba(59, 130, 246, 0.3);
    --border-accent: rgba(59, 130, 246, 0.5);
    
    /* Shadow Colors */
    --shadow-primary: rgba(0, 0, 0, 0.2);
    --shadow-secondary: rgba(0, 0, 0, 0.3);
    --shadow-blue: rgba(59, 130, 246, 0.3);
    --shadow-blue-hover: rgba(59, 130, 246, 0.5);
    
    /* Gradient Variables */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    --gradient-dark: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    --gradient-dark-secondary: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    --gradient-content: linear-gradient(135deg, var(--content-bg) 0%, var(--content-bg-secondary) 100%);
    --gradient-text: linear-gradient(135deg, var(--primary-blue), var(--primary-purple), var(--primary-cyan));
    --gradient-success: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    --gradient-error: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
    
    /* Background Patterns */
    --bg-body: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-quaternary) 75%, var(--bg-quinary) 100%);
    --bg-glass: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.8) 100%);
    --bg-glass-light: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.5) 100%);
    
    /* Animation Variables */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Sizes */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-pill: 25px;
    --border-radius-full: 50%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--gradient-dark);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    color: white;
    padding: 20px 30px;
    height: 80px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 32px var(--shadow-secondary);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--shadow-blue-hover);
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.nav-upload-btn {
    background: var(--gradient-primary);
    color: white;
    border: 1px solid var(--border-secondary);
    padding: 10px 20px;
    border-radius: var(--border-radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px var(--border-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-upload-btn svg {
    transition: transform var(--transition-normal);
}

.nav-upload-btn:hover {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--secondary-purple) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-blue);
    border-color: var(--border-accent);
}

.nav-upload-btn:hover svg {
    transform: scale(1.1);
}

.main-content {
    display: flex;
    flex: 1;
    height: calc(100vh - 80px);
    /* Subtract header height */
    position: relative;
}

.sidebar {
    width: 300px;
    background: var(--gradient-dark-secondary);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-primary);
    overflow-y: auto;
    transition: all var(--transition-normal);
    height: 100%;
    box-shadow: 4px 0 20px var(--shadow-primary);
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-toggle-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.8rem;
    box-shadow: 0 4px 15px var(--shadow-blue);
}

.sidebar-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-blue-hover);
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--secondary-purple) 100%);
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar.collapsed .file-list {
    display: none;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-primary);
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-panel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.toggle-panel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.toggle-panel-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.right-panel {
    position: fixed;
    right: -400px;
    top: 80px;
    width: 400px;
    height: calc(100vh - 80px);
    background: var(--gradient-dark);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-primary);
    box-shadow: -8px 0 32px var(--shadow-secondary);
    transition: right var(--transition-normal);
    z-index: 1000;
    overflow-y: auto;
}

.right-panel.open {
    right: 0;
}

.panel-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-panel-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.panel-content {
    padding: 20px;
}

.file-manager-section,
.analysis-section {
    margin-bottom: 30px;
}

.file-manager-section h4,
.analysis-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.file-manager-list,
.analysis-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    backdrop-filter: blur(10px);
}

.file-manager-list::-webkit-scrollbar,
.analysis-list::-webkit-scrollbar {
    width: 8px;
}

.file-manager-list::-webkit-scrollbar-track,
.analysis-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.file-manager-list::-webkit-scrollbar-thumb,
.analysis-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.file-manager-list::-webkit-scrollbar-thumb:hover,
.analysis-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.file-manager-item,
.analysis-item {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.file-manager-item:hover,
.analysis-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.file-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.serial-number {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-size {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

.file-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.file-status.processing {
    background: #ffa500;
    animation: pulse 1.5s infinite;
}

.file-status.completed {
    background: #28a745;
}

.file-status.error {
    background: #dc3545;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.panel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.panel-section-title {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1.2rem;
}

.panel-section-count {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.sidebar h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.file-list {
    /* max-height: 400px; */
    overflow-y: auto;
}

.file-item {
    background: var(--gradient-dark-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.file-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 8px 25px var(--shadow-blue);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-quaternary) 100%);
}

.file-item.active {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.1);
}

.file-item .file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    word-break: break-all;
}

.file-item .file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-item .file-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.file-item .file-status.processing {
    background: #ffa500;
    animation: pulse 1.5s infinite;
}

.file-item .file-status.completed {
    background: #28a745;
}

.file-item .file-status.error {
    background: #dc3545;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* Ensure all text in content area is properly styled */
.content-area * {
    color: inherit;
}

.content-area h1, .content-area h2, .content-area h3, .content-area h4, .content-area h5, .content-area h6 {
    color: var(--text-primary);
}

.content-area p, .content-area div, .content-area span {
    color: var(--text-primary);
}

.content-area .highlight {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-blue);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Specific styles for extractedContent */
#extractedContent {
    color: var(--text-primary);
    background: var(--bg-glass-light);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    margin-top: 15px;
}

#extractedContent * {
    color: var(--text-primary) !important;
}

#extractedContent p, #extractedContent div, #extractedContent span, #extractedContent pre {
    color: var(--text-primary) !important;
}

/* Excel content styling */
#extractedContent h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 8px;
}

/* Excel sheet headers */
#extractedContent h3:contains("===") {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 20px 0 10px 0;
    text-align: center;
    border-bottom: none;
}

/* Excel data formatting */
#extractedContent pre {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    margin: 10px 0;
}



#fileInput {
    display: none;
}

.btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin: 5px;
    box-shadow: 0 4px 15px var(--shadow-blue);
    backdrop-filter: blur(10px);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-blue-hover);
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--secondary-purple) 100%);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.search-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.search-section h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-normal);
    font-weight: 600;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
}

.tab.active {
    border-bottom-color: var(--primary-blue);
    color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    font-weight: 700;
}

.tab:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    transform: translateY(-1px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-primary);
    backdrop-filter: blur(20px);
}

/* Table container for horizontal scroll */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    display: block;
    position: relative;
    max-height: calc(100vh - 300px);
    /* Limit height to prevent overflow */
    overflow-y: auto;
}

.table-container table {
    min-width: 800px;
    /* Minimum width for table */
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-glass);
    table-layout: auto;
    display: table;
}

/* Force horizontal scroll for wide tables */
.table-container::-webkit-scrollbar {
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Ensure scrollbar is always visible */
.table-container {
    scrollbar-width: auto;
    scrollbar-color: var(--primary-blue) #f1f1f1;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
    vertical-align: top;
    min-width: 150px;
    color: var(--text-primary);
}

.data-table td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-wrap: break-word;
    min-width: 200px;
    color: var(--text-primary);
}

/* Force table to maintain minimum width */
.table-container .data-table {
    min-width: 800px !important;
    width: auto !important;
}

/* Ensure table doesn't shrink - already handled above */

/* Force table to expand beyond container */
.table-container .data-table {
    min-width: 800px !important;
    width: max-content !important;
}

.data-table th {
    background: var(--gradient-dark-secondary);
    font-weight: 600;
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.highlight {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-blue) !important;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid var(--border-secondary);
    font-weight: 600;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-file {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.result-text {
    color: var(--text-primary);
    line-height: 1.5;
}

.progress-container {
    margin: 20px 0;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-purple) 50%, var(--primary-cyan) 100%);
    width: 0%;
    transition: width var(--transition-slow);
    border-radius: var(--border-radius-xl);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: var(--primary-red);
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin: 15px 0;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
    font-weight: 500;
}



.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: var(--gradient-dark-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px var(--shadow-primary);
    text-align: center;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-blue);
    border-color: var(--shadow-blue);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: 0 0 20px var(--shadow-blue);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* New styles for collapsible sections */
.file-section {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.file-section-header {
    background: var(--gradient-dark-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    padding: 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.file-section-header:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-quaternary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--border-primary);
}

.file-section-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.file-section-count {
    background: var(--gradient-primary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-xl);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--shadow-blue);
}

.file-section-content {
    padding: 20px;
    background: white;
    display: none;
}

.file-section-content.expanded {
    display: block;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* Common data styles */
.common-data-section {
    margin-bottom: 20px;
}

.common-data-header {
    background: #28a745;
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.common-data-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.common-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 5px;
}

.common-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.common-item-value {
    color: var(--primary-blue);
    font-family: monospace;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Visualization styles */
.visualization-controls {
    margin-bottom: 20px;
    padding: 24px;
    background: var(--gradient-dark-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px var(--shadow-primary);
}

.visualization-controls h4 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.visualization-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.viz-btn {
    background: var(--gradient-primary);
    color: white;
    border: 1px solid var(--border-secondary);
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px var(--shadow-blue);
}

.viz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

.viz-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.visualization-container {
    display: flex;
    gap: 20px;
    height: 600px;
}

.graph-container {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.graph-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: center;
    padding: 20px;
}

.graph-instructions {
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
}

.graph-instructions h5 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.graph-instructions ul {
    list-style: none;
    padding: 0;
}

.graph-instructions li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.graph-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

/* Fullscreen styles */
.graph-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.graph-container.fullscreen .graph-placeholder {
    height: 100vh;
}

/* Graph node styles */
.graph-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.graph-node:hover {
    stroke-width: 4;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.graph-node.file-node {
    fill: #667eea;
    stroke: #fff;
    stroke-width: 3;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.graph-node.value-node {
    fill: #28a745;
    stroke: #fff;
    stroke-width: 3;
    filter: drop-shadow(0 2px 4px rgba(40, 167, 69, 0.3));
}

.graph-link {
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 2;
    transition: stroke-opacity 0.3s ease;
}

.graph-link:hover {
    stroke-opacity: 1;
    stroke-width: 3;
}

.graph-link:hover {
    stroke: #667eea;
    stroke-width: 3;
}

.graph-text {
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
}

.graph-text.file-text {
    fill: white;
}

.graph-text.value-text {
    fill: white;
}

/* Delete button styles */
.delete-btn {
    transition: opacity 0.3s ease;
}

.delete-btn:hover {
    fill: #c82333;
    stroke-width: 2;
}

/* Graph toolbar styles */
.graph-toolbar {
    pointer-events: all;
}

.toolbar-btn {
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    filter: brightness(1.2);
}

.toolbar-btn:hover circle {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Tooltip styles */
.graph-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

/* Loading animation */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

.loading {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Smooth transitions for all interactive elements */
button, .btn, .tab, .file-item, .stat-card, .feature-card {
    will-change: transform;
}

/* Focus styles for accessibility */
button:focus-visible, .btn:focus-visible, .tab:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Enhanced hover effects */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
    border-radius: inherit;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn:hover::before {
    left: 100%;
}

/* Responsive design for visualization */
@media (max-width: 768px) {
    .visualization-container {
        flex-direction: column;
        height: auto;
    }
    
    .graph-container {
        height: 400px;
    }
    
    .visualization-buttons {
        justify-content: center;
    }
    
    .graph-controls {
        justify-content: center;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.modal-menu {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.modal-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.modal-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.modal-table th,
.modal-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.modal-table th {
    background: #f8f9ff;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-table tr:hover {
    background: #f8f9ff;
}

.common-value-cell {
    font-weight: 600;
    color: var(--primary-blue);
    font-family: monospace;
}

/* Additional modern styles */
.search-input {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.search-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.search-section h4 {
    color: #e2e8f0;
    font-weight: 600;
}

/* Duplicate data-table styles removed - already defined above */

.file-section-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.5) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

@media (max-width: 768px) {
    .container {
        height: 100vh;
    }

    .main-content {
        flex-direction: column;
        height: calc(100vh - 120px);
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.2);
        height: auto;
        max-height: 200px;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .brand h1 {
        font-size: 1.4rem;
        text-align: center;
    }

    .nav-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .header {
        padding: 15px 20px;
        height: auto;
    }

    .right-panel {
        top: 120px;
        height: calc(100vh - 120px);
        width: 100%;
        right: -100%;
    }
}