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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: #333;
            min-height: 100vh;
        }

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

        .header {
            text-align: center;
            margin-bottom: 30px;
            color: white;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .upload-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
        }

        .drop-zone {
            border: 3px dashed #4CAF50;
            border-radius: 10px;
            padding: 40px;
            text-align: center;
            margin-bottom: 20px;
            transition: all 0.3s ease;
            background: linear-gradient(45deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
        }

        .drop-zone:hover, .drop-zone.dragover {
            border-color: #45a049;
            background: linear-gradient(45deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
            transform: translateY(-2px);
        }

        .file-input {
            display: none;
        }

        .upload-btn {
            background: linear-gradient(45deg, #4CAF50, #45a049);
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }

        .upload-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
        }

        .loaded-files {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            margin-top: 20px;
        }

        .file-tag {
            background: linear-gradient(45deg, #2196F3, #1976D2);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9rem;
            box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
        }

        .analysis-section {
            display: none;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
        }

        .severity-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .severity-card {
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            color: white;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
            transition: transform 0.3s ease;
        }

        .severity-card:hover {
            transform: translateY(-5px);
        }

        .critical { background: linear-gradient(45deg, #f44336, #d32f2f); }
        .error { background: linear-gradient(45deg, #FF9800, #F57C00); }
        .warning { background: linear-gradient(45deg, #FFC107, #F57F17); }
        .info { background: linear-gradient(45deg, #2196F3, #1976D2); }

        .severity-card h3 {
            font-size: 2rem;
            margin-bottom: 5px;
        }

        .timeline-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
        }

        .timeline-controls {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .timeline-control {
            padding: 8px 16px;
            border: 2px solid #ddd;
            border-radius: 6px;
            background: white;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .timeline-control.active {
            background: #2196F3;
            color: white;
            border-color: #2196F3;
        }

        .timeline-container {
            width: 100%;
            height: 400px;
            overflow-x: auto;
            overflow-y: hidden;
            border: 1px solid #ddd;
            border-radius: 10px;
            background: white;
            position: relative;
        }

        .timeline {
            height: 100%;
            position: relative;
            min-width: 100%;
        }

        .timeline-event {
            position: absolute;
            width: 8px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0.8;
        }

        .timeline-event:hover {
            width: 12px;
            opacity: 1;
            transform: translateY(-2px);
        }

        .event-critical { background: #f44336; height: 60px; top: 20px; }
        .event-error { background: #FF9800; height: 50px; top: 40px; }
        .event-warning { background: #FFC107; height: 40px; top: 60px; }
        .event-info { background: #2196F3; height: 30px; top: 80px; }

        .tooltip {
            position: absolute;
            background: rgba(0, 0, 0, 0.9);
            color: white;
            padding: 10px;
            border-radius: 6px;
            font-size: 0.9rem;
            max-width: 300px;
            z-index: 1000;
            display: none;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }

        .details-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
        }

        .event-list {
            max-height: 400px;
            overflow-y: auto;
            border: 1px solid #ddd;
            border-radius: 10px;
        }

        .event-item {
            padding: 15px;
            border-bottom: 1px solid #eee;
            transition: background 0.3s ease;
        }

        .event-item:hover {
            background: #f5f5f5;
        }

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

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

        .event-level {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: bold;
            color: white;
        }

        .progress-bar {
            width: 100%;
            height: 30px;
            background: #e0e0e0;
            border-radius: 8px;
            overflow: visible;
            margin: 15px 0;
            position: relative;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(45deg, #4CAF50, #45a049);
            width: 0%;
            transition: width 0.3s ease;
            border-radius: 8px;
        }
        
        .progress-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #333;
            font-weight: 600;
            font-size: 13px;
            z-index: 1;
            text-shadow: 0 1px 2px rgba(255,255,255,0.8);
            pointer-events: none;
        }

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

        .loading {
            animation: pulse 1.5s infinite;
        }

        /* Advanced Analysis Section */
        .advanced-analysis {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            backdrop-filter: blur(10px);
        }

        .analysis-controls {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .analysis-btn {
            background: linear-gradient(45deg, #2196F3, #1976D2);
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
        }

        .analysis-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
        }

        .ai-btn {
            background: linear-gradient(45deg, #9C27B0, #7B1FA2);
            box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
        }

        .ai-btn:hover {
            box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
        }

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

        .stat-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .stat-card h4 {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }

        .stat-card p {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .alerts-section, .patterns-section {
            margin-bottom: 20px;
        }

        .alerts-section h3, .patterns-section h3 {
            margin-bottom: 15px;
            color: #333;
        }

        .alert-item {
            background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
            color: white;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 10px;
            box-shadow: 0 3px 10px rgba(244, 67, 54, 0.3);
        }

        .alert-item strong {
            display: block;
            margin-bottom: 5px;
        }

        .pattern-item {
            background: linear-gradient(135deg, #FFC107 0%, #FFA000 100%);
            color: #333;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 10px;
            box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
        }

        .pattern-item strong {
            display: block;
            margin-bottom: 5px;
        }

        /* AI Modal Styles */
        .ai-modal {
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
        }

        .ai-modal-content {
            background: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 15px;
            width: 80%;
            max-width: 800px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            animation: slideIn 0.3s ease;
        }

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

        .ai-modal-close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .ai-modal-close:hover {
            color: #000;
        }

        .ai-config {
            margin: 20px 0;
        }

        .ai-config label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }

        .ai-config input {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 1rem;
            transition: border-color 0.3s ease;
        }

        .ai-config input:focus {
            outline: none;
            border-color: #9C27B0;
        }

        .ai-analysis-result {
            background: #f5f5f5;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
            min-height: 200px;
            max-height: 400px;
            overflow-y: auto;
            white-space: pre-wrap;
            line-height: 1.6;
        }

        .ai-loading {
            text-align: center;
            color: #9C27B0;
            font-style: italic;
        }

        /* Responsive Design for Mobile and Tablet */
        @media screen and (max-width: 768px) {
            .container {
                padding: 10px;
            }

            .header h1 {
                font-size: 1.8rem;
            }

            .header p {
                font-size: 0.9rem;
            }

            .upload-section, .analysis-section, .timeline-section, .details-section, .advanced-analysis {
                padding: 15px;
                border-radius: 10px;
            }

            .drop-zone {
                padding: 20px;
            }

            .drop-zone h3 {
                font-size: 1.2rem;
            }

            .drop-zone p {
                font-size: 0.9rem;
            }

            .upload-btn, .analysis-btn {
                padding: 10px 20px;
                font-size: 0.9rem;
            }

            .severity-cards, .login-stats {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .severity-card, .stat-card {
                padding: 15px;
            }

            .severity-card h3, .stat-card h4 {
                font-size: 1.5rem;
            }

            .severity-card p, .stat-card p {
                font-size: 0.85rem;
            }

            .timeline-controls, .analysis-controls {
                gap: 8px;
            }

            .timeline-control {
                padding: 6px 12px;
                font-size: 0.85rem;
            }

            .timeline-container {
                height: 250px;
            }

            .event-item {
                padding: 12px;
                font-size: 0.9rem;
            }

            .loaded-files {
                gap: 8px;
            }

            .file-tag {
                font-size: 0.8rem;
                padding: 6px 12px;
            }

            .tooltip {
                font-size: 0.8rem;
                max-width: 250px;
            }

            .ai-modal-content {
                width: 95%;
                margin: 10% auto;
                padding: 20px;
            }

            .ai-analysis-result {
                max-height: 300px;
                font-size: 0.9rem;
            }
        }

        @media screen and (max-width: 480px) {
            .header h1 {
                font-size: 1.5rem;
            }

            .severity-cards, .login-stats {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .timeline-controls, .analysis-controls {
                flex-direction: column;
            }

            .timeline-control, .analysis-btn {
                width: 100%;
                text-align: center;
            }

            .event-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }

            .event-level {
                align-self: flex-start;
            }

            .ai-modal-content {
                width: 98%;
                padding: 15px;
            }

            .ai-modal h2 {
                font-size: 1.3rem;
            }
        }

        /* Touch-friendly enhancements */
        @media (hover: none) and (pointer: coarse) {
            .upload-btn, .timeline-control {
                min-height: 44px;
            }

            .timeline-event {
                width: 12px;
            }

            .timeline-event:active {
                width: 16px;
            }
        }

        /* Event Controls */
        .event-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
            align-items: center;
        }

        .control-btn {
            background: linear-gradient(45deg, #2196F3, #1976D2);
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
        }

        .control-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
        }

        .control-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            box-shadow: none;
        }

        .tag-filter, .sort-filter {
            padding: 8px 12px;
            border: 2px solid #ddd;
            border-radius: 6px;
            font-size: 0.9rem;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s ease;
        }

        .tag-filter:focus, .sort-filter:focus {
            outline: none;
            border-color: #2196F3;
        }

        /* Event Selection */
        .event-item {
            position: relative;
        }

        .event-checkbox {
            position: absolute;
            left: 10px;
            top: 15px;
            min-width: 20px;
            min-height: 20px;
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .event-checkbox:focus {
            outline: 2px solid #2196F3;
            outline-offset: 2px;
        }

        .event-item.has-checkbox {
            padding-left: 45px;
        }

        .event-item.selected {
            background: #e3f2fd;
            border-left: 4px solid #2196F3;
        }

        /* AI Response in Event */
        .ai-response-badge {
            display: inline-block;
            background: linear-gradient(45deg, #9C27B0, #7B1FA2);
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            margin-left: 10px;
            font-weight: bold;
        }

        .ai-response-content {
            margin-top: 10px;
            padding: 10px;
            background: #f3e5f5;
            border-left: 3px solid #9C27B0;
            border-radius: 4px;
            font-size: 0.9rem;
            white-space: pre-wrap;
        }

        .ai-response-toggle {
            color: #9C27B0;
            cursor: pointer;
            text-decoration: underline;
            font-size: 0.85rem;
            margin-top: 5px;
            display: inline-block;
        }

        .ai-response-toggle:hover {
            color: #7B1FA2;
        }

        /* Chunk Viewer */
        .chunk-viewer {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 2px solid #ddd;
        }

        .chunk-viewer h3 {
            margin-bottom: 10px;
        }

        .chunk-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .chunk-item {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
        }

        .chunk-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }

        .chunk-item.active {
            background: linear-gradient(135deg, #4CAF50, #45a049);
        }

        .chunk-item strong {
            display: block;
            margin-bottom: 5px;
        }

        .chunk-item small {
            opacity: 0.9;
        }