/**
 * Elasticsearch Log Analyzer - Modern Design System (Light Mode)
 */

/* 1. Global Variables & Color Tokens */
:root {
    /* Color Palette */
    --elastic-blue: #005a9c;
    --elastic-blue-hover: #00457a;
    --elastic-teal: #00a294;
    --elastic-teal-hover: #008277;
    --elastic-red: #d32f2f;
    --elastic-red-light: #ffebee;
    
    --bg-primary: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    /* Layout & Shadows */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Base Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Font Headings */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

/* 3. Utility Classes */
.text-center { text-align: center; }
.bg-gray-50 { background-color: #f9fafb; }
.text-gray-800 { color: #1f2937; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--elastic-blue);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--elastic-blue-hover);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    color: #718096;
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover:not(:disabled) {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    color: var(--text-primary);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.select-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: white;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25em;
}
.select-control:focus {
    border-color: var(--elastic-blue);
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.form-help-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.alert-error {
    background-color: var(--elastic-red-light);
    border: 1px solid #ffcdd2;
    color: #c62828;
}
.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* 4. Landing Upload Portal Layout */
.portal-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.portal-header {
    margin-bottom: 3rem;
}

.brand-logo-container {
    width: 60px;
    height: 60px;
    background-color: #e6f0fa;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    font-size: 2rem;
}

.portal-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--elastic-blue), var(--elastic-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
}

.portal-card {
    margin-bottom: 2rem;
}

.portal-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.portal-actions > * {
    flex: 1;
    min-width: 200px;
}

/* Dropzone Interface */
.dropzone {
    border: 2px dashed #cbd5e0;
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background-color: #fafbfd;
    cursor: pointer;
    transition: var(--transition);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--elastic-blue);
    background-color: #f2f7fc;
}

.dropzone-icon-wrapper {
    width: 64px;
    height: 64px;
    background-color: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    font-size: 1.75rem;
    transition: var(--transition);
}
.dropzone:hover .dropzone-icon-wrapper, .dropzone.dragover .dropzone-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
    border-color: #a3c4f3;
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dropzone-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Selected File Display */
.selected-file-display {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.75rem;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remove-file-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}
.remove-file-btn:hover {
    color: var(--elastic-red);
    transform: scale(1.1);
}

/* Upload Status / Progress */
.upload-status-container {
    display: none;
    margin-top: 1.5rem;
    background-color: #f7fafc;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.upload-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-wrapper {
    height: 8px;
    background-color: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--elastic-blue);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.processing-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--elastic-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Recent Reports History */
.history-card {
    padding: 1.75rem;
}

.history-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background-color: white;
}
.report-item:hover {
    border-color: #cbd5e0;
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.report-meta {
    flex: 1;
    min-width: 0;
}

.report-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.report-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.report-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.action-view {
    background-color: #ebf8ff;
    color: var(--elastic-blue);
}
.action-view:hover {
    background-color: var(--elastic-blue);
    color: white;
}

.action-delete {
    background-color: #fff5f5;
    color: var(--elastic-red);
}
.action-delete:hover {
    background-color: var(--elastic-red);
    color: white;
}

.empty-history {
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fcfcfd;
}

/* Landing SEO & FAQ Sections */
.info-section {
    margin-top: 4.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.section-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem auto;
    font-size: 1.05rem;
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.info-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-card-icon-container {
    width: 44px;
    height: 44px;
    background-color: #f0f4f8;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.info-card-icon {
    font-size: 1.35rem;
}

.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Steps Block */
.steps-box {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3.5rem;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.step-card {
    text-align: center;
}

.step-number {
    width: 32px;
    height: 32px;
    background-color: var(--elastic-blue);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 90, 156, 0.25);
}

.step-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ Section Accordion */
.faq-accordion {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    outline: none;
}
.faq-question:hover {
    background-color: #fafbfc;
}

.faq-answer {
    padding: 0 1.25rem 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid transparent;
}
.faq-item[open] .faq-answer {
    border-top-color: var(--border-color);
}
.faq-answer ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* 5. Interactive Dashboard Layout */
.dashboard-body {
    padding-top: 70px; /* Space for fixed navigation */
    background-color: #f6f8fb;
    font-size: 0.9rem;
}

/* Navbar */
.dash-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.dash-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-brand-icon {
    font-size: 1.85rem;
}

.dash-brand-texts {
    display: flex;
    flex-direction: column;
}

.dash-brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.dash-brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-nav-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-meta-file {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: #f1f5f9;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-meta-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background-color: var(--elastic-teal);
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
}

.dash-back-btn {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    background-color: white;
    transition: var(--transition);
}
.dash-back-btn:hover {
    border-color: #cbd5e0;
    color: var(--text-primary);
    background-color: #f7fafc;
}

/* Query Bar & Filters */
.dash-query-bar {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.dash-query-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.kql-input-group {
    flex: 1;
    min-width: 300px;
    display: flex;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    overflow: hidden;
    align-items: center;
    transition: var(--transition);
}
.kql-input-group:focus-within {
    border-color: var(--elastic-blue);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.kql-icon {
    font-size: 0.95rem;
    margin-left: 0.85rem;
    color: var(--text-muted);
}

.kql-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
}

.kql-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem;
    margin-right: 0.25rem;
    border-radius: 50%;
}
.kql-clear-btn:hover {
    color: var(--text-primary);
    background-color: #edf2f7;
}

.kql-submit-btn {
    background-color: var(--elastic-blue);
    color: white;
    border: none;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
}
.kql-submit-btn:hover {
    background-color: var(--elastic-blue-hover);
}

.dash-time-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.time-picker-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.time-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: white;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1em;
}

/* Active Filters Row */
.active-filters-row {
    max-width: 1400px;
    margin: 0.5rem auto 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-tags-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-tag {
    background-color: #ebf8ff;
    border: 1px solid #bee3f8;
    color: var(--elastic-blue);
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-tag-remove {
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--text-muted);
}
.filter-tag-remove:hover {
    color: var(--elastic-red);
}

/* Dash Container Layout */
.dash-main-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* KPI Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.metric-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-val {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.metric-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Visualizations Dash Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.grid-span-full {
    grid-column: 1 / -1;
}

.grid-2-col {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

.dash-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dash-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Tabular Dash Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dash-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1.5px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.dash-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-secondary);
    vertical-align: middle;
}
.dash-table tr:hover td {
    background-color: #fcfdfe;
    color: var(--text-primary);
}

.dash-table tr:last-child td {
    border-bottom: none;
}

/* Log Documents Discover Explorer */
.raw-logs-section {
    grid-column: 1 / -1;
    padding: 1.5rem;
}

.raw-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.raw-logs-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filtered-badge {
    background-color: #edf2f7;
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.raw-logs-actions {
    display: flex;
    gap: 0.5rem;
}

/* Discover table specs */
.discover-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.discover-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    background-color: #f8fafc;
}

.discover-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-primary);
    vertical-align: top;
    font-family: inherit;
}

.discover-table tbody tr.log-row:hover td {
    background-color: #f7fafc;
    cursor: pointer;
}

/* Log doc row details */
.detail-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1;
}
.detail-toggle-btn:hover {
    color: var(--elastic-blue);
}
tr.log-row.expanded .detail-toggle-btn {
    transform: rotate(90deg);
}

.log-timestamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.log-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.log-method {
    font-weight: 700;
    font-size: 0.75rem;
    color: #4a5568;
    background-color: #edf2f7;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.log-path {
    word-break: break-all;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.log-status {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
}

.badge-status {
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-2xx { background-color: #e6fffa; color: #00875a; }
.badge-3xx { background-color: #ebf8ff; color: #0052cc; }
.badge-4xx { background-color: #fffaf0; color: #de350b; }
.badge-5xx { background-color: #fff5f5; color: var(--elastic-red); }

.log-bytes {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Expand Doc Detail Structure */
.log-details-tr {
    background-color: #fafbfc;
}

.log-details-container {
    padding: 1.5rem;
    border-left: 3px solid var(--elastic-blue);
    background-color: #fdfdfe;
    border-bottom: 1px solid #cbd5e0;
}

.log-details-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.log-details-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.details-tab-btn {
    background: none;
    border: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.details-tab-btn:hover {
    color: var(--text-primary);
    background-color: #edf2f7;
}
.details-tab-btn.active {
    color: white;
    background-color: var(--elastic-blue);
}

.details-tab-content {
    display: none;
}
.details-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Key Value details table style */
.details-kv-table {
    width: 100%;
    border-collapse: collapse;
}

.details-kv-table td {
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid #f0f4f8 !important;
    vertical-align: middle !important;
}

.details-key {
    font-weight: 700;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    width: 250px;
    background-color: #f8fafc;
}

.details-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
}

.details-json {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    background-color: #2d3748;
    color: #edf2f7;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #1a202c;
}

/* Pagination discover section */
.discover-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.paginate-btn {
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}
.paginate-btn:hover:not(:disabled) {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    color: var(--text-primary);
}
.paginate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer layout */
.dash-footer {
    text-align: center;
    padding: 2.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    background-color: white;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    .portal-title {
        font-size: 2rem;
    }
    
    .dash-nav-container {
        flex-direction: column;
        justify-content: center;
        gap: 0.25rem;
        height: auto;
        padding: 0.75rem;
    }
    .dashboard-body {
        padding-top: 100px;
    }
    .dash-navbar {
        height: auto;
    }
    .dash-nav-meta {
        width: 100%;
        justify-content: space-between;
    }
    .dash-meta-file {
        max-width: 150px;
    }
    
    .dash-query-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .kql-input-group {
        width: 100%;
    }
    
    .dash-time-picker {
        width: 100%;
        justify-content: space-between;
    }
    .time-select {
        flex: 1;
        max-width: 250px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
