/**
 * Test Dashboard Styles
 * Includes styles for both dashboard table and report viewer
 */

/* Base styles inherited from styles.css */
@import url('/css/styles.css');

/* =========================
   Dashboard Table Styles
   ========================= */

/* View report button/link */
.view-report-btn {
    padding: 0.5rem 1rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.view-report-btn:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Column width optimization */
#test-suites-table th:nth-child(1), /* Test Suite */
#test-suites-table td:nth-child(1) {
    width: 25%;
    min-width: 200px;
}

#test-suites-table th:nth-child(2), /* Device */
#test-suites-table td:nth-child(2) {
    width: 10%;
    min-width: 80px;
}

#test-suites-table th:nth-child(3), /* Region */
#test-suites-table td:nth-child(3) {
    width: 8%;
    min-width: 70px;
}

#test-suites-table th:nth-child(4), /* Passed */
#test-suites-table td:nth-child(4),
#test-suites-table th:nth-child(5), /* Failed */
#test-suites-table td:nth-child(5),
#test-suites-table th:nth-child(6), /* Mixed */
#test-suites-table td:nth-child(6),
#test-suites-table th:nth-child(7), /* Total */
#test-suites-table td:nth-child(7) {
    width: 8%;
    min-width: 70px;
    text-align: center;
}

#test-suites-table th:nth-child(8), /* Pass Rate */
#test-suites-table td:nth-child(8) {
    width: 10%;
    min-width: 90px;
    text-align: center;
}

#test-suites-table th:nth-child(9), /* Actions */
#test-suites-table td:nth-child(9) {
    width: 13%;
    min-width: 120px;
    text-align: center;
}

/* Fix pagination text contrast for test-suites-table */
#test-suites-table_wrapper .dataTables_info,
#test-suites-table_wrapper .dataTables_paginate .paginate_button,
#test-suites-table_wrapper .dataTables_paginate a.paginate_button {
    color: var(--text-color) !important;
}

#test-suites-table_wrapper .dataTables_paginate .paginate_button.current,
#test-suites-table_wrapper .dataTables_paginate a.paginate_button.current,
#test-suites-table_wrapper .dataTables_paginate a.paginate_button:hover:not(.disabled):not(.current) {
    color: var(--bg-color) !important;
}

/* Row highlighting for multiple failures */
#test-suites-table tbody tr.row-multiple-failures,
#test-suites-table tbody tr.row-multiple-failures td {
    background-color: #ffaeae !important;
    color: #860000;
}

#test-suites-table tbody tr.row-multiple-failures:hover {
    background-color: #ff7272 !important;
}

/* =========================
   Report Viewer Styles
   ========================= */

/* Full-screen layout for report page */
.fullscreen-layout {
    margin: 0;
    padding: 0;
    padding-top: 50px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.fullscreen-layout .content {
    flex: 1;
    padding: 20px 10px 0 10px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* Insights section */
.insights-section {
    margin: 0 0 0.5rem 0;
    padding: 1rem;
    border-bottom: 2px solid var(--text-color);
    background-color: rgba(0, 0, 0, 0.02);
}

.insights-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.insight-column {
    text-align: left;
}

.insight-column h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.insight-content {
    min-height: 60px;
    text-align: left;
}

.insight-loading {
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
}

.insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.insight-list li {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.insight-list li strong {
    color: var(--error-color);
    margin-right: 0.5rem;
}

.insight-list li code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9em;
    word-break: break-word;
}

.insight-empty {
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
}

/* Report date styling */
.report-date {
    font-size: 0.85em;
    opacity: 0.75;
    font-weight: normal;
    color: var(--text-color-secondary);
    margin-left: 0.5rem;
    font-style: italic;
}

/* Report container */
#report-iframe {
    width: 100%;
    height: 80vh;
    border: none;
    display: block;
}