body {
    font-family: 'Press Start 2P', cursive;
    background-color: #222;
    color: #eee;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
    image-rendering: pixelated; /* Crucial for pixel art */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
}

.container {
    width: 100%;
    max-width: 1200px;
    background-color: #333;
    border: 4px solid #555;
    box-shadow: 8px 8px 0px #111;
    padding: 20px;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #0f0;
    font-size: 2em;
    text-shadow: 4px 4px 0px #000;
    margin-bottom: 10px;
}

h2 {
    color: #0ff;
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0px #000;
}

h3 {
    color: #ff0;
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px #000;
}

.pixel-border {
    border: 2px solid #666;
    box-shadow: 4px 4px 0px #222;
    padding: 15px;
    background-color: #444;
}

.summary-panel p,
.log-output p {
    margin-bottom: 5px;
    line-height: 1.5;
}

.summary-value {
    color: #0f0;
    font-weight: bold;
}

.chart-container {
    background-color: #222;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #555;
    position: relative;
    height: 250px;
}

.log-output {
    background-color: #1a1a1a;
    border: 1px solid #0f0;
    padding: 10px;
    max-height: 300px;
    overflow-y: scroll;
    font-size: 0.8em;
    color: #0f0;
}

.log-entry {
    margin-bottom: 5px;
    border-bottom: 1px dashed #050;
    padding-bottom: 5px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-type-nginx {
    color: #0ff;
}

.log-type-system {
    color: #ff0;
}

.log-type-auth {
    color: #f0f;
}

.severity-error {
    color: #f00;
    font-weight: bold;
}

.severity-warning {
    color: #ff8c00;
}

/* Log highlighting styles */
.log-highlight-error {
    color: #f00;
    text-decoration: underline;
    font-weight: bold;
}

.log-highlight-warning {
    color: #ff8c00;
    font-weight: bold;
}

.log-highlight-attack {
    background-color: #f00;
    color: #fff;
    padding: 0 2px;
}

.log-highlight-ip {
    color: #0ff;
    border-bottom: 1px dotted #0ff;
}

.log-type {
    font-size: 0.7em;
    margin-right: 5px;
    opacity: 0.8;
}

.indicator {
    margin-right: 5px;
}

.pixel {
    image-rendering: pixelated; /* Ensure pixel rendering for specific elements if needed */
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid #555;
    color: #aaa;
    font-size: 0.8em;
}

/* Responsive adjustments for smaller screens */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 2fr 1fr; /* Two columns for main content and logs */
    }

    main {
        display: contents;
    }

    .summary-panel {
        grid-column: 1 / 2;
    }

    .metrics-panel {
        grid-column: 1 / 2;
    }

    .logs-panel {
        grid-column: 2 / 3;
        grid-row: 1 / span 2; /* Span across summary and metrics */
    }

    .log-sources-panel {
        grid-column: 1 / 3; /* Span across both columns on larger screens */
    }
}

/* Styling for form elements */
.pixel-form {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #0f0;
    background-color: #1a1a1a;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #eee;
}

.form-group input[type="text"] {
    width: calc(100% - 10px);
    padding: 5px;
    background-color: #2a2a2a;
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
}

.pixel-button {
    background-color: #0f0;
    color: #1a1a1a;
    border: 2px solid #050;
    padding: 8px 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9em;
    cursor: pointer;
    box-shadow: 2px 2px 0px #050;
    transition: all 0.1s ease;
    image-rendering: pixelated;
}

.pixel-button:hover {
    background-color: #0c0;
    box-shadow: 1px 1px 0px #050;
}

.log-source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #050;
}

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

.log-source-item .delete-button {
    background-color: #f00;
    border: 2px solid #500;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7em;
    cursor: pointer;
    box-shadow: 1px 1px 0px #500;
    image-rendering: pixelated;
}

.log-source-item .delete-button:hover {
    background-color: #c00;
    box-shadow: 0px 0px 0px #500;
}

/* Time range selector styling */
.time-range-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-range-selector label {
    color: #eee;
    font-size: 0.9em;
}

.pixel-input {
    background-color: #2a2a2a;
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    padding: 5px;
    image-rendering: pixelated;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.pixel-input:focus {
    outline: none;
    border-color: #0c0;
}
