/* Cabin Viewer specific styles */

/* Table visibility control */
#wifi-summary-container.hidden,
#cabin-summary-container.hidden {
    display: none !important;
}

/* Cabin header container */
.cabin-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 15px 5px 0; /* Add right padding to account for button */
    position: relative; /* For absolute positioning of the button */
    min-height: 40px; /* Ensure consistent height */
}

/* Move the print button to the right side */
.cabin-offline {
    display: inline-block;
    margin: 0;
    padding-right: 120px; /* Make space for the button */
}

/* Position the print button absolutely on the right */
.print-dropdown-container {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Print button and dropdown styles */
.print-dropdown-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000; /* Ensure it's above other elements */
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 14px;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #000;
}

/* Show the dropdown menu on hover */
.print-dropdown-container:hover .dropdown-content {
    display: block;
}

/* Style the print button */

.print-button {
    background-color: #ff8c00; /* Orange color */
    color: white;
    padding: 5px 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.print-button:hover {
    background-color: #e67e00;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Status indicators for offline report */
.status-offline {
    color: #d81b00;
    font-weight: bold;
}

.status-online {
    color: #007e33;
    font-weight: bold;
}

/* Better styling for specific status messages */
td.status-offline {
    background-color: rgba(231, 76, 60, 0.15);
}

td.status-online {
    background-color: rgba(46, 204, 113, 0.15);
}

/* Offline report styles */
#offline-report-view {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 100%;
    margin: 0 auto;
    min-height: 100%;
    overflow-y: visible;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: Arial, sans-serif;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#report-title {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.return-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.return-button:hover {
    background-color: #45a049;
}

.report-table-container {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    width: 100%;
    padding-bottom: 20px; /* Add some space at the bottom */
}

/* Offline report table styles */
#offline-report-view table {
    width: 100%;
    min-width: 800px; /* Ensure minimum width to show all columns */
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: auto; /* Let the browser determine optimal column widths */
    border: 1px solid #ddd;
}

#offline-report-view th,
#offline-report-view td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    white-space: nowrap; /* Prevent text wrapping to ensure all content is visible */
    min-width: 100px; /* Minimum column width */
    color: #333; /* Dark text for good contrast */
    font-size: 14px;
}

#offline-report-view td:last-child,
#offline-report-view th:last-child {
    border-right: none;
}

#offline-report-view th {
    background-color: #e6eef5;
    font-weight: 700;
    color: #333333;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
    text-shadow: none;
    font-size: 15px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #b8c9db;
}

#offline-report-view tbody tr:nth-child(odd) {
    background-color: #f2f2f2;
}

#offline-report-view tbody tr:nth-child(even) {
    background-color: #ffffff;
}

#offline-report-view tbody tr:hover {
    background-color: #e1f0fa;
}

.print-button:hover {
    background-color: #e67e00; /* Darker orange on hover */
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 100px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* Show the dropdown menu on hover */
.print-dropdown-container:hover .dropdown-content {
    display: block;
}

/* Report view styles */
#cabin-summary-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: auto;
}

/* Sort toggle styles */
.sort-toggle {
    display: inline-block;
    margin-left: 5px;
    color: #3498db;
    font-size: 0.8em;
}



#offline-report-view table {
    width: 100%;
    border-collapse: collapse;
}

/* Offline report styles */
#offline-report-view {
    display: none;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

#offline-report-view table {
    width: 100%;
    border-collapse: collapse;
}

#offline-report-view th,
#offline-report-view td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
    font-size: 14px;
}

#offline-report-view th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

#offline-report-view tr:nth-child(even) {
    background-color: #f9f9f9;
}

#offline-report-view tr:hover {
    background-color: #f1f1f1;
}

/* Cabin offline heading */
.cabin-offline {
    color: red !important;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Style offline cabins in the popup */
.offline-cabin {
    background-color: rgba(255, 59, 48, 0.1);
}

/* Cabin popup table */
#cabin-popup-table {
    width: 100%;
    table-layout: fixed; /* Fixed layout to better control column widths */
    border-collapse: collapse;
}

#cabin-popup-table th,
#cabin-popup-table td {
    padding: 5px 8px;
    text-align: left;
    border: 1px solid #444;
}

#cabin-popup-table th {
    background-color: #2c3e50;
    color: white;
}

/* Ensure popup is visible and properly positioned */
#cabin-detail-popup {
    position: fixed;
    z-index: 1000;
    display: none;
    background-color: #1a2535;
    border: 1px solid #444;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 5px;
    color: white;
    border-radius: 4px;
}

/* Ensure popup shows all content without any scrollbars */
#cabin-detail-popup .popup-content {
    min-width: 1000px; /* Set minimum width to accommodate all columns */
    overflow: visible; /* No scrollbars at all - show everything */
}

/* Ensure the cabin summary table looks good */
#cabin-summary {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

#cabin-summary th,
#cabin-summary td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #444;
}

#cabin-summary th {
    color: #ccc;
    font-weight: normal;
}

.count-cell {
    text-align: right;
}

/* Selected deck highlighting */
.selected-deck {
    background-color: rgba(52, 152, 219, 0.3);
}

/* Totals row */
#cabin-summary tfoot td {
    border-top: 2px solid #555;
    font-weight: bold;
}

.total-label {
    text-align: left;
}

.total-value {
    text-align: right;
    color: #ff3b30;
}
