/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

header {
    background-color: #990e0e;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: smaller;
}

/* Summary Section */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fceaea;
    border-radius: 8px;
    max-width: 1200px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: smaller;
}

.summary-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.summary-section h2 {
    color: #990e0e;
    margin-bottom: 10px;
}

.summary-section p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Tabs */
.tabs {
    text-align: center;
    margin: 20px 0;
}

.tabs button {
    margin: 0 10px;
    padding: 10px 20px;
    background-color: #990e0e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.tabs button:disabled {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Test Details */
#test-details-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-details {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fefefe;
}

.test-details h3 {
    color: #990e0e;
}

/* Step and Assertion Details */
.step, .assertion {
    margin-left: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.step h4, .assertion p {
    margin: 0;
    color: #555;
}

/* Collapsible Sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    gap: 10px;
    flex-wrap: nowrap;
}

.collapsible-header h3 {
    flex-grow: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collapsible-header h4,
.collapsible-header p {
    flex-grow: 1;
    margin: 0;
}

.collapsible-header:hover {
    background-color: #f0f0f0;
}

.collapsible-body {
    display: none;
    padding: 10px 20px;
    border-left: 2px solid #ddd;
    margin-left: 20px;
}

.collapsible-body.active {
    display: block;
}

/* Toggle Indicator */
.toggle-indicator {
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

/* Status Indicators */
.status-indicator {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.status-indicator.pass {
    color: green;
}

.status-indicator.fail {
    color: red;
}

/* Details and Screenshot Layout */
.details-and-screenshot {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.details {
    flex: 1;
    max-width: calc(100% - 180px);
}

.details p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Screenshot Styling */
.screenshot {
    flex-shrink: 0;
    position: relative;
    margin: 10px 0;
}

.screenshot img {
    width: auto;
    height: 80px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.screenshot img:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Exception Styling */
.exception-details {
    margin: 10px 0;
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    background-color: #fff5f5;
    padding: 15px;
}

.exception-header {
    margin: -15px -15px 15px -15px;
    padding: 10px 20px;
    background-color: #ffe3e3;
    border-bottom: 1px solid #ff6b6b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exception-type {
    font-weight: bold;
    color: #e03131;
}

.exception-timestamp {
    color: #666;
    font-size: 0.9em;
}

.exception-message,
.exception-stack {
    margin: 15px 0;
    padding: 0 15px;
}

.exception-message pre,
.exception-stack pre {
    margin: 10px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ffe3e3;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.9em;
    max-height: 200px;
    overflow-y: auto;
}

.exception-message strong,
.exception-stack strong {
    display: block;
    margin-bottom: 5px;
    color: #e03131;
}

/* Pass/Fail Colors */
.status-badge {
    font-weight: bold;
    color: #555;
}

.pass {
    color: green;
}

.fail {
    color: red;
}

/* Logs Section */
.logs-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.logs-header h2 {
    color: #990e0e;
    margin: 0;
}

.logs-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

#log-search-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
}

.search-btn {
    background: #990e0e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover {
    background: #7a0b0b;
}

.pop-out-btn {
    background: #990e0e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pop-out-btn:hover {
    background: #7a0b0b;
}

.search-results {
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
}

.search-results-header {
    padding: 8px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #990e0e;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.clear-search-btn:hover {
    text-decoration: underline;
}

.search-results-list {
    padding: 0;
}

.search-result-item {
    padding: 8px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

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

.search-result-item:hover {
    background: #f9f9f9;
}

.search-result-file {
    font-weight: bold;
    color: #990e0e;
    margin-right: 10px;
}

.search-result-context {
    color: #333;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.search-result-context mark {
    background-color: #ffe066;
    padding: 2px 0;
}

.highlight {
    background-color: #ffe066;
}

.log-container select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.log-container pre {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    font-family: monospace;
    white-space: pre-wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logs-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .logs-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
    }

    #log-search-input {
        width: 100%;
    }
}