/* LogLama Viewer Styles */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --debug-color: #95a5a6;
    --critical-color: #9b59b6;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-radius: 0.25rem;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.navbar {
    background-color: var(--secondary-color) !important;
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: white !important;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Log level colors */
.level-debug {
    background-color: var(--debug-color);
    color: white;
}

.level-info {
    background-color: var(--info-color);
    color: white;
}

.level-warning {
    background-color: var(--warning-color);
    color: white;
}

.level-error {
    background-color: var(--danger-color);
    color: white;
}

.level-critical {
    background-color: var(--critical-color);
    color: white;
}

/* Level badge */
.level-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius);
}

/* Message content styling */
.message-content {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.message-content:hover {
    white-space: normal;
    word-wrap: break-word;
}

/* Truncated message styling */
.message-content.truncated {
    position: relative;
    border-left: 3px solid var(--warning-color);
    padding-left: 8px;
}

.truncation-indicator {
    color: var(--warning-color);
    font-style: italic;
    font-size: 0.85em;
    margin-left: 5px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Truncate long messages */
.message-truncate {
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Improve pre formatting */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    padding: 1rem;
    border: 1px solid #eee;
}

/* Stats panel styling */
.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    transition: var(--transition);
}

.stat-item:hover {
    background-color: #e9ecef;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
}

/* Improve table layout */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    white-space: nowrap;
    background-color: #f8f9fa;
    font-weight: 600;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}

th.sortable:hover {
    background-color: #e9ecef;
}

.sort-icon {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    content: "";
}

th.sort-asc .sort-icon {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #555;
}

th.sort-desc .sort-icon {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #555;
}

/* Form controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    border-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    border-color: #7f8c8d;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--primary-color);
    border-radius: var(--border-radius);
    margin: 0 2px;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Modal styling */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Notification styling */
#notification-area {
    max-width: 400px;
    width: 90%;
    text-align: center;
    margin: 0 auto;
}

.notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    animation: fadeInUp 0.3s ease-out;
    position: relative;
    background-color: white;
    border-left: 5px solid var(--info-color);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    body.dark-mode .card {
        background-color: #2c2c2c;
        color: #f8f9fa;
    }
    
    body.dark-mode .card-header {
        background-color: #2c2c2c;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    body.dark-mode .table th {
        background-color: #2c2c2c;
        color: #f8f9fa;
    }
    
    body.dark-mode .table {
        color: #f8f9fa;
    }
    
    body.dark-mode .table-hover tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    body.dark-mode pre {
        background-color: #2c2c2c;
        border-color: #444;
        color: #f8f9fa;
    }
    
    body.dark-mode .stat-item {
        background-color: #2c2c2c;
    }
    
    body.dark-mode .stat-item:hover {
        background-color: #3c3c3c;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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