/* 
 * BMW Miner Log Analysis Suite - Styles
 * Dark theme with orange/amber accents
 */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-primary: #f59e0b;
    --accent-secondary: #d97706;
    --accent-light: #fbbf24;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --info: #3b82f6;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   NAVBAR - Clean Rewrite
   ======================================== */
.navbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon {
    background-color: var(--accent-primary);
    color: var(--bg-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.brand-text {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-text span {
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

/* Mobile Menu Button - Hidden by default */
.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
}

.menu-btn:hover {
    color: var(--accent-primary);
}

/* Nav Content - The main navigation wrapper */
.nav-content {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-left: 2rem;
}

/* Nav Links - Centered relative to entire navbar */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-item i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-item:hover {
    color: var(--accent-primary);
    background-color: rgba(245, 158, 11, 0.15);
}

.nav-item:hover i {
    color: var(--accent-primary);
}

.nav-item.active {
    color: var(--accent-primary);
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.nav-item.active i {
    color: var(--accent-primary);
}

.nav-item-primary {
    background: var(--accent-primary);
    color: var(--bg-secondary) !important;
}

.nav-item-primary i {
    color: var(--bg-secondary) !important;
}

.nav-item-primary:hover {
    filter: brightness(1.1);
}

/* Right Side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
    margin-left: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #d97706 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.user-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    border-color: rgba(245, 158, 11, 0.6);
}

/* Tippy.js custom theme - BMW Amber */
.tippy-box[data-theme~='bmw-amber'] {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 20px rgba(245, 158, 11, 0.15);
    padding: 0;
}

.tippy-box[data-theme~='bmw-amber'] .tippy-content {
    padding: 12px 16px;
}

.tippy-box[data-theme~='bmw-amber'] .tippy-arrow {
    color: #1a1a2e;
}

.tippy-box[data-theme~='bmw-amber'][data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: #1a1a2e;
    filter: drop-shadow(0 -1px 0 rgba(245, 158, 11, 0.4));
}

.tippy-box[data-theme~='bmw-amber'][data-placement^='top'] > .tippy-arrow::before {
    border-top-color: #1a1a2e;
    filter: drop-shadow(0 1px 0 rgba(245, 158, 11, 0.4));
}

/* Email tooltip content styling */
.email-tooltip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.email-tooltip i {
    color: var(--accent-primary);
    font-size: 0.9rem;
    opacity: 0.9;
}

.email-tooltip span {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}


.logout-link {
    text-decoration: none;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.logout-link:hover {
    opacity: 1;
}

/* ========================================
   NAVBAR RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
    .brand-text span {
        display: none;
    }
}

@media (max-width: 950px) {
    .menu-btn {
        display: block;
    }

    .nav-content {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: var(--bg-tertiary);
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        padding: 1rem;
        border-bottom: 2px solid var(--accent-primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .nav-content.show {
        display: flex;
    }

    .nav-links {
        position: static;
        transform: none;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        padding: 12px 16px;
    }

    .nav-right {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 1rem;
        margin-top: 1rem;
        margin-left: 0;
    }

    .user-profile {
        width: 100%;
    }

    .logout-link {
        width: 100%;
        padding: 12px 16px;
        background: rgba(248, 113, 113, 0.1);
        border-radius: 8px;
        justify-content: center;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
}

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

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Analysis Form */
.analysis-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Input Tabs */
.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-primary);
}

.tab-icon {
    font-size: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

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

textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

textarea::placeholder {
    color: var(--text-muted);
}

select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f59e0b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.upload-icon i {
    display: block;
}

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

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

.file-name {
    display: block;
    margin-top: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-md);
    color: #000;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-icon {
    font-size: 1rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.3s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.processing-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Root Cause Banner */
.root-cause-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

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

.root-cause-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.root-cause-icon {
    font-size: 1.5rem;
    color: var(--info);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.root-cause-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.6;
}

.root-cause-text strong {
    color: var(--info);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.root-cause-text span {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 0; /* Prevents overflow */
    overflow: hidden; /* Prevents content from breaking out */
}

.card-icon {
    font-size: 2rem;
    color: var(--accent-primary);
}

.card-icon i {
    display: block;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* Allows text to wrap properly */
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Severity Card Variants */
.severity-card.severity-critical {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.severity-card.severity-critical .card-value {
    color: var(--danger);
}

.severity-card.severity-major {
    border-color: var(--warning);
    background: rgba(234, 179, 8, 0.1);
}

.severity-card.severity-major .card-value {
    color: var(--warning);
}

.severity-card.severity-minor {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.severity-card.severity-minor .card-value {
    color: var(--success);
}

/* Warranty Status Colors */
.card-value.warranty-in_warranty,
.overview-value.warranty-in_warranty,
.timeline-metric-value.warranty-in_warranty {
    color: var(--success);
}

.card-value.warranty-out_of_warranty,
.overview-value.warranty-out_of_warranty,
.timeline-metric-value.warranty-out_of_warranty {
    color: var(--danger);
}

.card-value.warranty-not_found,
.card-value.warranty-unknown,
.overview-value.warranty-not_found,
.overview-value.warranty-unknown,
.timeline-metric-value.warranty-not_found,
.timeline-metric-value.warranty-unknown {
    color: var(--text-secondary);
}

/* Legacy warranty classes for backward compatibility */
.card-value.warranty-in {
    color: var(--success);
}

.card-value.warranty-out {
    color: var(--danger);
}

.card-subvalue,
.overview-subvalue {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Result Panel */
.result-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-panel.full-width {
    grid-column: 1 / -1;
}

.result-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.category-tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.error-tag {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Mapping Table */
.mapping-table-container {
    overflow-x: auto;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table th,
.mapping-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mapping-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mapping-table td code {
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--danger);
}

/* Log Lines */
.log-lines {
    max-height: 400px;
    overflow-y: auto;
}

.log-line {
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-color);
    margin-bottom: 0.25rem;
    background: var(--bg-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    word-break: break-all;
}

.log-line:hover {
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Triage Ideas Content */
.triage-ideas-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(80, 200, 120, 0.1) 100%);
    border-left: 4px solid var(--accent-primary);
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* LLM Solution Content */
.llm-solution-content {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
    padding: 0;
}

.llm-solution-content p {
    margin-bottom: 0.75rem;
}

.llm-solution-content p:last-child {
    margin-bottom: 0;
}

/* Chinese Translations */
.translation-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 0.5rem;
}

.translations-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.translation-summary-card {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.translation-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.translation-summary-text {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-primary);
}

.btn-view-translations {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-view-translations:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.translation-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

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

.translation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s;
}

.translation-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.translation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.translation-index {
    color: var(--text-muted);
    font-weight: bold;
    min-width: 1.5rem;
}

.translation-original {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.translation-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.translation-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.translation-badge.metadata {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.translation-badge.ui_element {
    background: rgba(139, 149, 158, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(139, 149, 158, 0.3);
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.severity-badge.major {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.severity-badge.minor {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.translation-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.translation-arrow {
    color: var(--accent-primary);
    font-size: 1.25rem;
    font-weight: bold;
}

.translation-text {
    color: var(--text-primary);
    font-style: italic;
    flex: 1;
}

.translation-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.translation-context {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.translation-confidence {
    color: var(--text-muted);
}

.translation-summary-card {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.translation-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.translation-summary-text {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-primary);
}

.btn-view-translations {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-view-translations:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.translation-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

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

/* Collapsible */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapse-icon {
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible.collapsed .collapsible-content {
    display: none;
}

.collapsible-content pre {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-height: 400px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
}

.footer-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .page-header {
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header .subtitle {
        font-size: 0.9rem;
    }
    
    .input-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
        font-size: 0.875rem;
    }
    
    .form-group textarea {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .file-upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-text {
        font-size: 0.9rem;
    }
    
    .submit-btn {
        width: 100%;
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .card {
        padding: 0.875rem;
    }
    
    .card-icon {
        font-size: 1.25rem;
    }
    
    .card-label {
        font-size: 0.75rem;
    }
    
    .card-value {
        font-size: 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-panel {
        padding: 1rem;
    }
    
    .result-panel h3 {
        font-size: 1rem;
    }
    
    .triage-ideas-content {
        font-size: 0.95rem;
        padding: 0.875rem 1rem;
    }
    
    .llm-solution-content {
        font-size: 0.875rem;
    }
    
    .tags-container {
        gap: 0.5rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .mapping-table {
        font-size: 0.8rem;
    }
    
    .mapping-table th,
    .mapping-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .log-line {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .processing-time {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    .form-group textarea {
        font-size: 0.8rem;
        padding: 0.625rem;
    }
    
    .file-upload-area {
        padding: 1.5rem 0.75rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .result-panel {
        padding: 0.875rem;
    }
    
    .result-panel h3 {
        font-size: 0.95rem;
    }
    
    .triage-ideas-content {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }
    
    .mapping-table {
        font-size: 0.75rem;
    }
    
    .mapping-table th,
    .mapping-table td {
        padding: 0.4rem 0.3rem;
    }
    
    .log-line {
        font-size: 0.75rem;
        padding: 0.4rem 0.625rem;
    }
    
    .footer {
        padding: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-content p {
        font-size: 0.875rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .results-header h2 {
        font-size: 1.5rem;
    }
    
    .root-cause-banner {
        padding: 1rem;
    }
    
    .root-cause-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .root-cause-icon {
        font-size: 1.25rem;
    }
    
    .root-cause-text {
        font-size: 0.9rem;
    }
    
    .analysis-form {
        padding: 1.5rem;
    }
    
    .mapping-table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .log-lines {
        max-height: 300px;
    }
}

/* Ensure all text is readable and doesn't overflow */
@media (max-width: 768px) {
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    code {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Batch Upload Page */
.batch-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.2s;
}

.batch-upload-area:hover,
.batch-upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.05);
}

.file-list {
    margin-top: 1.5rem;
    text-align: left;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.file-item-name {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
}

.file-item-remove:hover {
    color: var(--danger);
}

/* Batch Results */
.batch-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.batch-result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-result-item:hover {
    border-color: var(--accent-primary);
}

.batch-result-item.severity-critical {
    border-left: 4px solid var(--danger);
}

.batch-result-item.severity-major {
    border-left: 4px solid var(--warning);
}

.batch-result-item.severity-minor {
    border-left: 4px solid var(--success);
}

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.auth-form small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--danger);
    margin-top: 1rem;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--success);
    margin-top: 1rem;
}

.auth-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.miners-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.miner-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

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

.miner-item:hover {
    background: var(--bg-tertiary);
}

.miner-info {
    flex: 1;
}

.miner-serial {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 500;
}

.miner-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.miner-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 1rem;
}

.miner-status.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.miner-status.major {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.miner-status.minor {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.historical-context {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.historical-context h4 {
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.historical-context p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.trend-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.trend-badge.improved {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.trend-badge.degraded {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.trend-badge.same {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-secondary);
}

