/* error_view.css */

/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Special Elite', monospace;
    background: url('/images/mainBackground.png') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    color: #ffffff;
}

/* Container styles */
.error-container {
    width: 90%;
    max-width: 1400px;
    margin: 80px auto 0;
    padding: 20px;
    min-height: calc(100vh - 75px);
    box-sizing: border-box;
}

/* Header styles */
.error-header {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 1.8rem;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Table container */
.table-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Table styles */
.error-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

.error-table th {
    background: rgba(76, 175, 80, 0.2);
    color: #90EE90;
    text-align: left;
    padding: 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.error-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

/* Column specific styles */
.col-timestamp {
    min-width: 150px;
    color: #90EE90;
}

.col-component {
    min-width: 120px;
    color: #ffffff;
    font-weight: bold;
}

.col-message {
    min-width: 200px;
}

.col-details {
    min-width: 250px;
}

/* Details cell with pre formatting */
.details-content {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0;
}

/* Row hover effect */
@media (hover: hover) {
    .error-table tr:hover td {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Empty state */
.no-errors {
    text-align: center;
    padding: 2rem;
    color: #90EE90;
    font-style: italic;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin: 1rem 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 1.5rem;
    color: #90EE90;
}

/* Error state */
.error-message {
    text-align: center;
    padding: 1rem;
    color: #ff6b6b;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    margin: 1rem 0;
}

/* Tablet Responsive adjustments */
@media (max-width: 768px) {
    .error-container {
        width: 95%;
        margin-top: 60px;
        padding: 15px;
        min-height: calc(100vh - 60px);
    }

    .error-title {
        font-size: 1.6rem;
    }

    .error-table {
        font-size: 0.8rem;
    }

    .error-table th,
    .error-table td {
        padding: 0.6rem;
    }

    /* Adjust column widths for tablet */
    .col-timestamp { min-width: 120px; }
    .col-component { min-width: 100px; }
    .col-message { min-width: 150px; }
    .col-details { min-width: 200px; }

    /* Stack table on tablets */
    .table-container {
        margin: 0.75rem -0.5rem;
        border-radius: 6px;
    }

    .details-content {
        max-height: 150px;
        overflow-y: auto;
    }
}

/* Mobile Responsive adjustments */
@media (max-width: 480px) {
    .error-container {
        width: 100%;
        margin-top: 75px;
        padding: 10px;
        min-height: calc(100vh - 50px);
    }

    .error-title {
        font-size: 1.4rem;
        padding: 0 10px;
    }

    .table-container {
        margin: 0;
        padding: 10px;
        overflow-x: hidden; /* Prevent horizontal scroll */
        border-radius: 8px;
    }

    .error-table {
        display: block;
        width: 100%;
        min-width: unset; /* Remove min-width */
    }
    
    /* Card style for each row */
    .error-table tr {
        display: block;
        margin-bottom: 15px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 8px;
        padding: 10px;
    }

    /* Hide table headers */
    .error-table thead {
        display: none;
    }

    /* Style each cell as a flex container */
    .error-table td {
        display: flex;
        flex-direction: column;
        padding: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    /* Style the labels */
    .error-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #90EE90;
        margin-bottom: 5px;
        font-size: 0.8rem;
    }

    /* Style the content */
    .error-table td > * {
        width: 100%;
        margin-left: 0;
    }

    /* Specific styling for details */
    .details-content {
        width: 100%;
        margin: 5px 0;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        padding: 8px;
        box-sizing: border-box;
        overflow-x: hidden;
        word-break: break-word;
    }

    /* Reset all column widths */
    .col-timestamp,
    .col-component,
    .col-message,
    .col-details {
        min-width: unset;
        width: 100%;
    }
}