/* Log File Analyzer - Complete Styles with Light/Dark Theme Support */

/* ===== CSS Variables ===== */
.log-analyzer-container {
    --la-primary: var(--primary-color, #3498db);
    --la-secondary: var(--secondary-color, #2ecc71);
    --la-bg: var(--card-bg-color, #fcfcfc);
    --la-surface: var(--background-color, #ffffff);
    --la-text: var(--text-color, #333333);
    --la-text-muted: #6c757d;
    --la-border: var(--border-color, rgba(52, 152, 219, 0.1));
    --la-shadow: var(--box-shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
    --la-radius: var(--border-radius-md, 8px);
    --la-radius-lg: var(--border-radius-lg, 16px);
    --la-transition: var(--transition-fast, 0.2s ease);
    --la-gradient: linear-gradient(135deg, var(--la-primary), var(--la-secondary));
    --la-success: #27ae60;
    --la-warning: #f39c12;
    --la-danger: #e74c3c;
    --la-info: #3498db;
    --la-critical: #9b59b6;
    --la-debug: #7f8c8d;
}

.dark-theme .log-analyzer-container {
    --la-text-muted: #9ca3af;
    --la-surface: #1a1d24;
    --la-bg: #242830;
}

/* ===== Base Container ===== */
.log-analyzer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: var(--font-family, 'Inter', sans-serif);
    color: var(--la-text);
}

/* ===== Header ===== */
.la-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.05));
    border-radius: 16px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.la-header .header-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.la-header .header-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.35);
}

.la-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--la-text);
}

.la-header p {
    margin: 0;
    opacity: 0.7;
    font-size: 0.9rem;
    color: var(--la-text);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.log-analyzer-container .btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.log-analyzer-container .btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

/* ===== Privacy Notice ===== */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--la-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(52, 152, 219, 0.1));
    border: 1px solid rgba(39, 174, 96, 0.2);
    color: var(--la-success);
}

.dark-theme .privacy-notice {
    background: rgba(39, 174, 96, 0.15);
}

/* ===== Controls ===== */
.la-controls {
    margin-bottom: 1.5rem;
}

.primary-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.upload-zone {
    padding: 2rem;
    border: 2px dashed var(--la-border);
    border-radius: var(--la-radius-lg);
    background: var(--la-bg);
    text-align: center;
    cursor: pointer;
    transition: var(--la-transition);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--la-primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-content i {
    font-size: 3rem;
    color: var(--la-primary);
    margin-bottom: 1rem;
    display: block;
}

.upload-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--la-text);
}

.upload-content p {
    margin: 0 0 1rem;
    color: var(--la-text-muted);
    font-size: 0.9rem;
}

.supported-formats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.format-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--la-primary);
    font-weight: 500;
}

.or-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.or-divider span {
    padding: 0.5rem 1rem;
    background: var(--la-bg);
    border-radius: 50%;
    color: var(--la-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.paste-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paste-area textarea {
    flex: 1;
    min-height: 180px;
    max-height: 500px;
    padding: 1rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    resize: vertical;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--la-primary) var(--la-bg);
}

.paste-area textarea:focus {
    outline: none;
    border-color: var(--la-primary);
}

/* Textarea custom scrollbar for webkit browsers */
.paste-area textarea::-webkit-scrollbar {
    width: 8px;
}

.paste-area textarea::-webkit-scrollbar-track {
    background: var(--la-bg);
    border-radius: 4px;
}

.paste-area textarea::-webkit-scrollbar-thumb {
    background: var(--la-primary);
    border-radius: 4px;
}

.paste-area textarea::-webkit-scrollbar-thumb:hover {
    background: var(--la-secondary);
}

/* Dark theme specific scrollbar colors */
.dark-theme .paste-area textarea {
    scrollbar-color: var(--la-primary) #1a1d24;
}

.dark-theme .paste-area textarea::-webkit-scrollbar-track {
    background: #1a1d24;
}

.dark-theme .paste-area textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--la-primary), var(--la-secondary));
}

/* Sample Logs */
.sample-logs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
}

.sample-label {
    font-weight: 600;
    color: var(--la-text);
    font-size: 0.9rem;
}

/* ===== Buttons ===== */
.log-analyzer-container .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--la-radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--la-transition);
    text-decoration: none;
}

.log-analyzer-container .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.log-analyzer-container .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.log-analyzer-container .btn-primary {
    background: var(--la-gradient);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.log-analyzer-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.log-analyzer-container .btn-secondary {
    background: var(--la-bg);
    color: var(--la-text);
    border: 2px solid var(--la-border);
}

.log-analyzer-container .btn-secondary:hover {
    border-color: var(--la-primary);
    color: var(--la-primary);
}

.log-analyzer-container .btn-outline {
    background: transparent;
    color: var(--la-primary);
    border: 2px solid var(--la-primary);
}

.log-analyzer-container .btn-outline:hover {
    background: var(--la-primary);
    color: #fff;
}

.log-analyzer-container .btn-danger {
    background: var(--la-danger);
    color: #fff;
}

/* ===== Processing Indicator ===== */
.processing-indicator {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--la-border);
}

.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.processing-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.progress-bar-container {
    height: 8px;
    background: var(--la-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: var(--la-gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.processing-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

.processing-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Format Detection ===== */
.format-detection {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.05));
    border-radius: var(--la-radius);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.format-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.format-info i {
    color: var(--la-primary);
}

/* ===== View Tabs ===== */
.view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--la-text-muted);
    border-radius: var(--la-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--la-transition);
    position: relative;
}

.view-tab:hover {
    background: var(--la-surface);
    color: var(--la-text);
}

.view-tab.active {
    background: var(--la-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tab-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tab-badge.error-badge {
    background: var(--la-danger);
    color: #fff;
}

.view-tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Summary Dashboard ===== */
.summary-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    transition: var(--la-transition);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--la-shadow);
}

.summary-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.total-entries .card-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.error-count .card-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.warning-count .card-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.time-span .card-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.unique-ips .card-icon {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

.health-score .card-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.card-content {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--la-text);
}

.card-label {
    font-size: 0.8rem;
    color: var(--la-text-muted);
}

/* ===== View Panels ===== */
.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== Overview Grid ===== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.overview-card {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    overflow: hidden;
}

.overview-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--la-border);
}

.overview-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.overview-card .card-body {
    padding: 1.5rem;
}

.overview-card canvas {
    max-height: 250px;
}

/* Severity Legend */
.severity-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* Error List */
.error-list,
.ip-list,
.anomaly-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.error-item,
.ip-item,
.anomaly-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
    border-left: 3px solid var(--la-danger);
}

.ip-item {
    border-left-color: var(--la-info);
}

.anomaly-item {
    border-left-color: var(--la-warning);
}

.error-item .error-count,
.ip-item .request-count {
    min-width: 40px;
    padding: 0.25rem 0.5rem;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

.error-item .error-message,
.ip-item .ip-address,
.anomaly-item .anomaly-text {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

/* ===== Log Entries View ===== */
.entries-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--la-text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--la-primary);
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--la-text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

.filter-select,
.filter-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--la-primary);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entries-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.entries-count {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

/* Log Entries Container */
.log-entries-container {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    max-height: 600px;
    overflow-y: auto;
}

.virtual-scroll-container {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
}

.log-entry {
    display: flex;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--la-border);
    transition: background 0.2s ease;
}

.log-entry:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.log-entry.level-error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--la-danger);
}

.log-entry.level-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left: 3px solid var(--la-warning);
}

.log-entry.level-critical {
    background: rgba(155, 89, 182, 0.15);
    border-left: 3px solid var(--la-critical);
}

.log-entry.level-debug {
    border-left: 3px solid var(--la-debug);
    opacity: 0.8;
}

.log-entry .line-number {
    min-width: 50px;
    color: var(--la-text-muted);
    user-select: none;
    padding-right: 1rem;
    border-right: 1px solid var(--la-border);
    margin-right: 1rem;
}

.log-entry .timestamp {
    min-width: 160px;
    color: var(--la-info);
}

.log-entry .level {
    min-width: 80px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-entry .level.error {
    color: var(--la-danger);
}

.log-entry .level.warning {
    color: var(--la-warning);
}

.log-entry .level.info {
    color: var(--la-info);
}

.log-entry .level.debug {
    color: var(--la-debug);
}

.log-entry .level.critical {
    color: var(--la-critical);
}

.log-entry .message {
    flex: 1;
    word-break: break-word;
}

.log-entry .message.wrap {
    white-space: pre-wrap;
}

.log-entry .message.nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-entry .message .highlight {
    background: rgba(243, 156, 18, 0.4);
    padding: 0 2px;
    border-radius: 2px;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
}

.page-info {
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

/* ===== Errors View ===== */
.error-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.error-stat-card {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    padding: 1.5rem;
    border: 1px solid var(--la-border);
    position: relative;
    overflow: hidden;
}

.stat-content {
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

.stat-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-bar.critical {
    background: var(--la-critical);
}

.stat-bar.error {
    background: var(--la-danger);
}

.stat-bar.warning {
    background: var(--la-warning);
}

/* Error Groups */
.error-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.error-group {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    overflow: hidden;
}

.error-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: var(--la-surface);
    border-bottom: 1px solid var(--la-border);
}

.error-group-header:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.error-group .occurrence-badge {
    padding: 0.25rem 0.75rem;
    background: var(--la-danger);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.error-group .error-preview {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--la-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.error-group-content {
    padding: 1rem 1.5rem;
    display: none;
}

.error-group.expanded .error-group-content {
    display: block;
}

/* Stack Traces */
.stack-traces-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stack-traces-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stack-trace {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    overflow: hidden;
}

.stack-trace-header {
    padding: 1rem;
    background: rgba(231, 76, 60, 0.1);
    border-bottom: 1px solid var(--la-border);
    font-weight: 600;
    color: var(--la-danger);
}

.stack-trace-content {
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* ===== Timeline View ===== */
.timeline-chart-container {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--la-border);
}

.timeline-chart-container canvas {
    max-height: 300px;
}

.timeline-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    padding: 1.5rem;
    border: 1px solid var(--la-border);
}

.insight-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1rem;
}

.insight-content {
    font-size: 0.95rem;
    color: var(--la-text);
}

.insight-content .highlight {
    font-weight: 700;
    color: var(--la-primary);
}

/* ===== Patterns View ===== */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.pattern-card {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    overflow: hidden;
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--la-surface);
    border-bottom: 1px solid var(--la-border);
}

.pattern-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
}

.pattern-badge {
    padding: 0.25rem 0.75rem;
    background: var(--la-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.pattern-body {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* ===== Security View ===== */
.security-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.security-score-card {
    flex: 0 0 200px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--la-bg);
    border: 8px solid var(--la-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.score-circle .score-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--la-success);
}

.score-circle .score-label {
    font-size: 0.85rem;
    color: var(--la-text-muted);
}

.score-circle.low .score-value {
    color: var(--la-danger);
}

.score-circle.medium .score-value {
    color: var(--la-warning);
}

.score-circle.high .score-value {
    color: var(--la-success);
}

.threat-overview {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.threat-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    min-width: 120px;
}

.threat-stat i {
    font-size: 1.5rem;
}

.threat-stat.high i {
    color: var(--la-danger);
}

.threat-stat.medium i {
    color: var(--la-warning);
}

.threat-stat.low i {
    color: var(--la-info);
}

.threat-count {
    font-size: 2rem;
    font-weight: 700;
}

.threat-label {
    font-size: 0.85rem;
    color: var(--la-text-muted);
}

/* Threat Categories */
.threat-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.threat-category {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    overflow: hidden;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--la-surface);
    border-bottom: 1px solid var(--la-border);
    cursor: pointer;
}

.category-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
}

.category-badge {
    padding: 0.25rem 0.75rem;
    background: var(--la-danger);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.category-content {
    padding: 1rem 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.threat-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--la-danger);
}

.threat-item .threat-details {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

/* ===== Performance View ===== */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.perf-card {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    padding: 1.5rem;
}

.perf-card.full-width {
    grid-column: 1 / -1;
}

.perf-header {
    margin-bottom: 1rem;
}

.perf-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
}

.perf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.perf-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
}

.perf-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--la-text-muted);
    margin-bottom: 0.25rem;
}

.perf-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--la-text);
}

.slow-requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slow-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
    font-size: 0.9rem;
}

.slow-request-item .request-time {
    font-weight: 700;
    color: var(--la-warning);
}

.throughput-info {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.throughput-stat {
    text-align: center;
}

.throughput-stat span:first-child {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--la-primary);
}

.throughput-stat span:last-child {
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

/* ===== Search View ===== */
.search-panel {
    background: var(--la-bg);
    border-radius: var(--la-radius);
    border: 1px solid var(--la-border);
    padding: 1.5rem;
}

.search-form {
    margin-bottom: 1.5rem;
}

.search-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-main-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
}

.search-main-input:focus {
    outline: none;
    border-color: var(--la-primary);
}

.search-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.quick-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.quick-label {
    font-size: 0.9rem;
    color: var(--la-text-muted);
    margin-right: 0.5rem;
}

.quick-btn {
    padding: 0.5rem 1rem;
    background: var(--la-surface);
    border: 1px solid var(--la-border);
    border-radius: var(--la-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--la-transition);
}

.quick-btn:hover {
    border-color: var(--la-primary);
    color: var(--la-primary);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--la-border);
    margin-bottom: 1rem;
}

.results-count {
    font-size: 0.9rem;
    color: var(--la-text-muted);
}

.search-results-list {
    max-height: 500px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--la-border);
    font-family: monospace;
    font-size: 0.85rem;
}

.search-result-item:hover {
    background: var(--la-surface);
}

.search-result-item .match {
    background: rgba(243, 156, 18, 0.4);
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    background: var(--la-bg);
    border-radius: var(--la-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--la-border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--la-surface);
    color: var(--la-text-muted);
    cursor: pointer;
    transition: var(--la-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--la-danger);
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--la-border);
}

/* Format Modal */
.format-form .form-group {
    margin-bottom: 1rem;
}

.format-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.format-form input,
.format-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
    font-size: 0.9rem;
}

.format-form textarea {
    min-height: 100px;
    font-family: monospace;
}

.format-test-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
    font-family: monospace;
    font-size: 0.85rem;
}

.predefined-formats {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--la-border);
}

.predefined-formats h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.format-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.format-btn {
    padding: 0.5rem 1rem;
    background: var(--la-surface);
    border: 1px solid var(--la-border);
    border-radius: var(--la-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--la-transition);
}

.format-btn:hover,
.format-btn.active {
    border-color: var(--la-primary);
    color: var(--la-primary);
}

/* ===== Educational Panel ===== */
.edu-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 100%;
    background: var(--la-bg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--la-border);
}

.edu-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
}

.edu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--la-surface);
}

.edu-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--la-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--la-radius);
    transition: var(--la-transition);
}

.edu-tab:hover {
    background: var(--la-bg);
}

.edu-tab.active {
    background: var(--la-primary);
    color: #fff;
}

.edu-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.edu-content h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--la-text);
}

.edu-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.edu-content code {
    padding: 0.2rem 0.5rem;
    background: var(--la-surface);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.edu-content pre {
    padding: 1rem;
    background: var(--la-surface);
    border-radius: var(--la-radius);
    overflow-x: auto;
    font-size: 0.85rem;
}

/* ===== Settings Panel ===== */
.settings-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px;
    max-width: 100%;
    background: var(--la-bg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--la-border);
}

.settings-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.setting-group select,
.setting-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 2px solid var(--la-border);
    border-radius: var(--la-radius);
    background: var(--la-surface);
    color: var(--la-text);
}

.setting-group input[type="range"] {
    width: calc(100% - 40px);
    margin-top: 0.5rem;
}

/* ===== Export Bar ===== */
.export-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--la-bg);
    border-radius: var(--la-radius);
    margin-top: 1.5rem;
    border: 1px solid var(--la-border);
    flex-wrap: wrap;
}

.export-label {
    font-weight: 600;
    color: var(--la-text);
    font-size: 0.95rem;
}

/* ===== Help Sections ===== */
.help-section {
    margin-bottom: 1.5rem;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--la-primary);
}

.help-section p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--la-text);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .primary-controls {
        grid-template-columns: 1fr;
    }

    .or-divider {
        padding: 1rem 0;
    }

    .or-divider span {
        border-radius: 20px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .patterns-grid {
        grid-template-columns: 1fr;
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .security-summary {
        flex-direction: column;
        align-items: center;
    }

    .threat-overview {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .log-analyzer-container {
        padding: 1rem;
    }

    .la-header {
        flex-direction: column;
        text-align: center;
    }

    .la-header .header-content {
        flex-direction: column;
    }

    .view-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .view-tab span {
        display: none;
    }

    .view-tab i {
        font-size: 1.1rem;
    }

    .summary-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .date-filter {
        flex-direction: column;
    }

    .log-entry {
        flex-direction: column;
        gap: 0.5rem;
    }

    .log-entry .line-number {
        border-right: none;
        border-bottom: 1px solid var(--la-border);
        padding-right: 0;
        padding-bottom: 0.5rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .perf-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .edu-panel,
    .settings-panel {
        width: 100%;
    }

    .modal-content {
        max-height: 85vh;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-options {
        flex-direction: column;
        gap: 0.75rem;
    }

    .quick-searches {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-bar {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .summary-dashboard {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 1rem;
    }

    .card-value {
        font-size: 1.1rem;
    }

    .upload-zone {
        padding: 1.5rem;
        min-height: 150px;
    }

    .upload-content i {
        font-size: 2rem;
    }

    .upload-content h3 {
        font-size: 1rem;
    }

    .sample-logs {
        flex-direction: column;
        align-items: stretch;
    }

    .sample-logs .btn {
        width: 100%;
        justify-content: center;
    }

    .error-stats-grid {
        grid-template-columns: 1fr;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-circle .score-value {
        font-size: 2.5rem;
    }

    .threat-overview {
        flex-direction: column;
    }

    .threat-stat {
        width: 100%;
    }

    .timeline-insights {
        grid-template-columns: 1fr;
    }
}

/* ===== Print Styles ===== */
@media print {
    .log-analyzer-container {
        max-width: 100%;
        padding: 0;
    }

    .la-header .header-actions,
    .upload-zone,
    .paste-area,
    .or-divider,
    .sample-logs,
    .view-tabs,
    .export-bar,
    .processing-indicator,
    .format-detection button,
    .panel-actions,
    .pagination-controls,
    .edu-panel,
    .settings-panel,
    .modal {
        display: none !important;
    }

    .view-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }

    .overview-card,
    .summary-card {
        break-inside: avoid;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-panel.active {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.processing-indicator .fa-spin {
    animation: fa-spin 1s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--la-border) 25%, var(--la-surface) 50%, var(--la-border) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
    border-radius: var(--la-radius);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}