/* --- Global Styles --- */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* MODIFIED: Very Dark Main Background */
    background-color: #1a1a1a; 
    /* MODIFIED: Subtle red/gray gradient background */
    background-image: radial-gradient(circle at top right, rgba(231, 76, 60, 0.15), transparent), 
                      radial-gradient(circle at bottom left, rgba(46, 204, 113, 0.05), transparent);
    background-attachment: fixed;
    color: #e0e0e0; /* Light text for contrast */
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px; 
    margin: 40px auto;
    padding: 0 20px;
}
h1, h2 {
    color: #e0e0e0;
    border-bottom: 2px solid rgba(40, 40, 40, 0.5); /* Darker, subtle separator */
    padding-bottom: 10px;
    margin-top: 30px;
    font-weight: 300; 
}
a {
    color: #e74c3c; /* MODIFIED: Red Accent Color for links */
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: #c0392b; /* Darker red on hover */
}

/* --- Transparency and Frosted Glass Effect --- */
/* Applied to all main structural elements */
.sidebar, .filter-form, .login-container {
    background-color: rgba(30, 30, 30, 0.9); 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(50, 50, 50, 0.7); 
    border-radius: 12px; /* Retain standard rounded corners */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

/* --- Layout --- */
.content-wrapper {
    display: flex;
    gap: 25px;
}
.sidebar {
    width: 320px; 
    flex-shrink: 0;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.main-content {
    flex-grow: 1;
}

/* --- Login Form & Header (Standard elements) --- */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    text-align: center;
}
input[type="text"], input[type="password"], input[type="submit"] {
    background-color: rgba(40, 40, 40, 0.7);
    color: #e0e0e0;
    border: 1px solid rgba(60, 60, 60, 0.5);
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    margin-bottom: 15px;
}
input[type="submit"] {
    background-color: #e74c3c; 
    color: #ffffff;
    cursor: pointer;
    font-weight: bold;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(40, 40, 40, 0.5);
}

/* --- Filter Form --- */
.filter-form {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px;
}
.filter-form input[type="text"] {
    flex-grow: 1;
    width: auto; 
    margin: 0; 
    margin-left: 10px;
}
.filter-form label {
    flex-shrink: 0;
    font-weight: 500;
}
.filter-form .clear-filter {
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #3a3a3a;
    color: #ffffff;
    flex-shrink: 0;
    display: inline-block;
    min-width: 80px; 
    text-align: center;
    border: 1px solid #555555;
}

/* --- Log Entries (STANDARD Box Style) --- */

/* Outer wrapper for margin and effects */
.log-card-wrapper {
    margin-bottom: 25px;
    transition: all 0.2s ease-in-out;
}
.log-card-wrapper:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.7);
    transform: translateY(-2px); /* Subtle lift */
    background-color: rgba(30, 30, 30, 0.99); /* Ensure inner element does not conflict if hover is on wrapper */
}

.log-entry {
    background-color: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(50, 50, 50, 0.7);
    border-left: 5px solid rgba(50, 50, 50, 0.5); 
    border-radius: 12px;
    padding: 20px;
}
.log-entry:hover {
    /* If hover is applied to log-entry itself */
    background-color: rgba(30, 30, 30, 0.99); 
}

/* 1. PRIMARY TITLE AREA: Log Title & Log Level (New Grouping) */
.primary-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(40, 40, 40, 0.5);
    margin-bottom: 15px;
}
.log-title {
    font-size: 1.5em; 
    font-weight: 700;
    color: #ffffff; /* MODIFIED: Changed from yellow/amber to WHITE */
}
.log-level-badge {
    text-transform: uppercase;
    font-size: 0.75em;
    padding: 5px 10px;
    border-radius: 50px; 
    font-weight: bold;
    color: #ffffff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

/* 2. USER & TIMESTAMP ROW (New Grouping) */
.user-timestamp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-block {
    display: flex;
    align-items: center;
    color: #e0e0e0;
}
.user-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #e74c3c; /* Highlight user photo with accent color */
    object-fit: cover;
}
.user-info strong {
    font-size: 1.1em;
    display: block;
}
.user-id {
    font-size: 0.8em;
    color: #999999;
}

.log-metadata {
    display: flex;
    align-items: center;
    gap: 15px;
}

.log-timestamp {
    font-weight: 500;
    color: #e74c3c;
    letter-spacing: 0.5px;
}
.log-id {
    font-size: 0.8em;
    color: #999999;
    padding: 3px 8px;
    border: 1px solid rgba(50, 50, 50, 0.5);
    border-radius: 4px;
}

/* 3. MESSAGE CONTENT */
.log-data-section {
    margin-top: 15px;
}
.log-data-section.message-content {
    margin-top: 0; 
}
.log-data-section h4 {
    border-bottom: 1px dashed rgba(40, 40, 40, 0.5);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #e0e0e0;
    font-weight: 500;
    font-size: 1em;
}
.log-message-pre {
    border: 1px solid rgba(60, 60, 60, 0.5);
    background-color: rgba(40, 40, 40, 0.7);
    font-size: 0.95em;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 4. TECHNICAL DETAILS (Footer) */
.tech-details {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.85em;
    color: #999999;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(40, 40, 40, 0.5);
}
code {
    background-color: rgba(40, 40, 40, 0.7);
    padding: 2px 4px;
    border-radius: 3px;
    color: #ffffff; /* MODIFIED: Changed from yellow/amber to WHITE */
}

/* 5. Raw Data Toggle */
details.raw-data-toggle {
    margin-top: 15px;
    border-top: 1px solid rgba(40, 40, 40, 0.5);
    padding-top: 10px;
}
details.raw-data-toggle summary {
    cursor: pointer;
    font-weight: 500;
    color: #e74c3c; /* Use red accent for the toggle label */
    margin-bottom: 10px;
}


/* --- Active Users Sidebar Styling --- */
.sidebar h2 {
    border-bottom: 1px solid rgba(60, 60, 60, 0.5);
    margin-top: 0;
}
.active-user-list {
    list-style: none;
    padding: 0;
}
.active-user-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(40, 40, 40, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.active-user-link {
    display: flex;
    align-items: center;
    flex-grow: 1; 
    transition: opacity 0.3s;
}
.active-user-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #555555;
    object-fit: cover;
}
.active-username {
    font-weight: 600;
    color: #e74c3c;
}
.active-time {
    font-size: 0.75em;
    color: #999999;
    flex-shrink: 0;
}


/* --- Log Level Colors --- */
.LOG-LEVEL-INFO { border-left-color: #cccccc; } 
.LOG-LEVEL-INFO.log-level-badge { background-color: #666666; color: #ffffff; }

.LOG-LEVEL-ERROR { border-left-color: #e74c3c; } 
.LOG-LEVEL-ERROR.log-level-badge { background-color: #e74c3c; }
.LOG-LEVEL-FATAL, .LOG-LEVEL-CRITICAL { border-left-color: #c0392b; } 
.LOG-LEVEL-FATAL.log-level-badge, .LOG-LEVEL-CRITICAL.log-level-badge { background-color: #c0392b; }

.LOG-LEVEL-WARNING { border-left-color: #f39c12; } /* WARNING kept orange for distinction */
.LOG-LEVEL-WARNING.log-level-badge { background-color: #f39c12; }

.LOG-LEVEL-DEBUG { border-left-color: #2ecc71; } 
.LOG-LEVEL-DEBUG.log-level-badge { background-color: #2ecc71; }