:root {
    /* Modern Color Palette */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    
    --success-500: #10b981;
    --warning-500: #f59e0b;
    --error-500: #ef4444;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--neutral-800);
    background: var(--neutral-50);
    min-height: 100vh;
}

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

header {
    margin-bottom: var(--space-10);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    color: white;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-5);
}

.header-left {
    text-align: left;
    flex: 1;
}

.header-right {
    text-align: right;
    display: flex;
    gap: var(--space-3);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

header h1 i {
    font-size: 2rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

.download-btn, .help-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.download-btn:hover, .help-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.help-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        text-align: center;
    }
    
    .header-right {
        text-align: center;
    }
}

main {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--neutral-200);
}

/* Upload Section */
.upload-section {
    margin-bottom: var(--space-10);
}

.upload-area {
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--neutral-50);
}

.upload-area:hover {
    border-color: var(--primary-500);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-area.dragover {
    border-color: var(--primary-600);
    background: var(--primary-100);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    color: var(--primary-500);
}

.upload-content h3 {
    margin-bottom: var(--space-2);
    color: var(--neutral-800);
    font-weight: 600;
}

.upload-content p {
    color: var(--neutral-600);
    margin-bottom: var(--space-5);
}

.upload-progress {
    margin-top: var(--space-5);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    width: 0%;
    transition: width 0.3s ease;
}

/* Buttons */
.btn {
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--success-500), #45a049);
    color: white;
    border: 1px solid transparent;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border: 1px solid var(--primary-600);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-50);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error-500);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Search Section */
.search-section {
    margin-bottom: var(--space-10);
}

.search-container {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.search-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.search-results {
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: none;
    border: 1px solid var(--neutral-200);
}

.search-results.show {
    display: block;
}

.search-result-item {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border-left: 4px solid var(--primary-500);
    box-shadow: var(--shadow-sm);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.search-result-filename {
    font-weight: 600;
    color: #333;
}

.search-result-time {
    color: #666;
    font-size: 0.9rem;
}

.search-matches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.match-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Traces Section */
.traces-section {
    margin-bottom: 20px;
}

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

.section-header h2 {
    color: var(--neutral-800);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.traces-list {
    display: grid;
    gap: 20px;
}

.trace-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--neutral-200);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.trace-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-200);
}

.trace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.trace-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.trace-meta {
    color: #666;
    font-size: 0.9rem;
}

.trace-actions {
    display: flex;
    gap: 10px;
}

.trace-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.trace-summary {
    background: white;
    border-radius: 8px;
    padding: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: var(--neutral-800);
}

.summary-value {
    color: var(--neutral-600);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--neutral-200);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    color: var(--neutral-800);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--neutral-500);
    padding: var(--space-2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--neutral-200);
    color: var(--neutral-700);
    transform: scale(1.1);
}

.modal-body {
    padding: var(--space-8);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--space-2);
    }
    
    header {
        padding: var(--space-6);
        margin-bottom: var(--space-8);
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }
    
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    main {
        padding: var(--space-5);
    }
    
    .upload-area {
        padding: var(--space-8);
    }
    
    .search-container {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .traces-list {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .trace-header {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .trace-actions {
        align-self: stretch;
        justify-content: center;
        gap: var(--space-2);
    }
    
    .trace-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: var(--space-4);
        max-height: 85vh;
    }
    
    .modal-header,
    .modal-body {
        padding: var(--space-5);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .upload-area {
        padding: var(--space-6);
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: 0.9rem;
    }
    
    .trace-card {
        padding: var(--space-4);
    }
    
    .modal-content {
        width: 98%;
        margin: var(--space-2);
    }
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.trace-card {
    animation: fadeIn 0.5s ease-out;
}

.trace-card:nth-child(even) {
    animation: slideInLeft 0.5s ease-out;
}

.upload-area.dragover {
    animation: pulse 0.6s ease-in-out;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Loading shimmer effect */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--neutral-200) 0%,
        var(--neutral-100) 50%,
        var(--neutral-200) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth transitions for interactive elements */
.search-input,
.upload-area,
.trace-card,
.btn,
.modal-close {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered animation for trace cards */
.trace-card:nth-child(1) { animation-delay: 0.1s; }
.trace-card:nth-child(2) { animation-delay: 0.2s; }
.trace-card:nth-child(3) { animation-delay: 0.3s; }
.trace-card:nth-child(4) { animation-delay: 0.4s; }
.trace-card:nth-child(5) { animation-delay: 0.5s; }

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--neutral-50);
    opacity: 0.8;
    border-radius: inherit;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--neutral-200);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

/* Enhanced Help Book Modal Styling */
#helpModal .modal-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#helpModal h3 {
    color: #333;
    font-size: 1.4rem;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

#helpModal h4 {
    color: #555;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

#helpModal p {
    line-height: 1.7;
    margin-bottom: 15px;
    color: #666;
}

#helpModal ul {
    margin: 15px 0;
    padding-left: 25px;
}

#helpModal li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #666;
}

#helpModal code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

#helpModal .copy-btn {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#helpModal .copy-btn:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

/* Enhanced progress bar */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* Notification animations */
.notification {
    animation: slideInRight 0.3s ease-out;
}

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