/**
 * F2F Store Tools - Display Tests for Digital Signage (Masonry Version)
 * css/display-tests.css
 * Optimized for 4K displays, using Masonry.js for layout.
 * Added backup table-based display styles for simplified presentation.
 *
 * Categories:
 * 1. Global & Page Structure
 * 2. Header Elements
 * 3. Content Area & Masonry Grid
 * 4. Masonry Helper Elements
 * 5. Aquarium Cards (General & Masonry Item)
 * 6. Card Size Adjustment (Column Based)
 * 7. Card Status & Animations
 * 8. Card Content (Header, Badges, Table, Notes)
 * 9. Notices & Indicators (Non-Header)
 * 10. Footer Elements
 * 11. Animations (General Keyframes)
 * 12. NEW: Table-Based Display Styles (Backup Mode)
 * 13. Media Queries
 */

/* ======================================== */
/* 1. Global & Page Structure             */
/* ======================================== */

/* Ensure full viewport height and base styling */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent body scrollbars */
}

/* Main container */
.f2f-td-display-container {
    width: 100%;
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent container scrollbars */
    background-color: #0a2a3c; /* Dark blue background */
    color: #fff;
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    position: relative; /* Context for absolutely positioned children */
    
    /* Column-based layout properties */
    --column-count: 1; /* Default to 1 column for best fit with few cards */
    --column-width: 48%;
    --gutter-size: 4%;
    --card-size-factor: 1;
    --font-size-factor: 1; /* New property for text scaling */
    
    /* NEW: Table scaling variables */
    --table-scale-factor: 1;
    --table-base-font-size: 1.2rem;
}

/* Apply error state styling */
.f2f-td-display-container.connection-error .f2f-td-display-header,
.f2f-td-display-container.connection-error .f2f-td-display-footer {
    opacity: 0.8; /* Slightly fade header/footer during connection errors */
}

/* Add class when size is adjusted for potential global adjustments */
.f2f-td-display-container.f2f-td-size-adjusted {
    /* Applied when card sizes are adjusted */
}

/* ======================================== */
/* 2. Header Elements                     */
/* ======================================== */

/* Header Container - Fixed 200px height */
.f2f-td-display-header {
    position: relative;
    width: 100%;
    height: 200px; /* Fixed height as requested */
    min-height: 200px; /* Ensure minimum height */
    max-height: 200px; /* Ensure maximum height */
    flex-shrink: 0;
    z-index: 10; /* Ensure header content is above grid */
    box-sizing: border-box; /* Include padding/border in height calculation */
}

/* Header Background Image */
.f2f-td-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1; /* Behind header content */
}
.f2f-td-display-container[data-display="left"] .f2f-td-header-image,
.f2f-td-display-container[data-display="specific"] .f2f-td-header-image { /* Specific uses left header? */
    background-image: url('../images/header-l.png');
}
.f2f-td-display-container[data-display="right"] .f2f-td-header-image {
    background-image: url('../images/header-r.png');
}

/* Combined Status Indicator */
.f2f-td-combined-status {
    position: absolute;
    top: 15%; /* Position relative to header height */
    left: 2%; /* Use percentage */
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between elements */
}

/* Status Text Styling */
.f2f-td-combined-status span.f2f-td-status-text {
    font-size: 1.3vw; /* Adjusted size */
    color: #add8e6;
    line-height: 1;
    white-space: nowrap;
    margin-right: 5px;
}

/* Shared styles for status dots */
.f2f-td-combined-status span.f2f-td-status-dot {
    display: inline-block;
    width: 1.0vw; /* Adjusted size */
    height: 1.0vw;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.5s ease;
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
}

/* Dot 1: Main Connection Status Colors */
.f2f-td-status-dot.main-connection { background-color: #FFC107; } /* Yellow (Connecting/Loading) */
.f2f-td-status-dot.main-connection.connected { background-color: #4CAF50; } /* Green */
.f2f-td-status-dot.main-connection.disconnected { background-color: #F44336; } /* Red */
.f2f-td-status-dot.main-connection.paused { background-color: #FFA500; } /* Orange */

/* Dot 2: Other Screen Status Colors & Default Visibility */
.f2f-td-status-dot.other-screen {
    background-color: #F44336; /* Default: Red */
    display: none; /* Hidden by default */
}
.f2f-td-status-dot.other-screen.connected { background-color: #4CAF50; } /* Green */

/* Date/Time Display */
.f2f-td-display-datetime {
    position: absolute;
    top: 15%; /* Align with status indicator */
    right: 2%; /* Use percentage */
    font-size: 1.8vw; /* Adjusted size */
    color: #add8e6;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    text-align: right;
    display: none; /* Hide by default */
}

/* Connection Error Notice Placeholder */
.f2f-td-connection-error-placeholder {
    position: absolute;
    top: calc(15% + 1.3vw + 8px); /* Below status text */
    left: 2%;
    z-index: 100;
}
/* Actual error message style */
.f2f-td-connection-error-placeholder div.f2f-td-connection-error {
    background-color: rgba(244, 67, 54, 0.8);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9vw; /* Adjusted size */
    display: inline-block;
}

/* Conditional Header Layout Rules */
.f2f-td-display-container.dual-screen-active[data-display="right"] .f2f-td-display-datetime,
.f2f-td-display-container.single-screen-active .f2f-td-display-datetime,
.f2f-td-display-container[data-display="specific"] .f2f-td-display-datetime { /* Show on specific too */
    display: block;
}
.f2f-td-display-container.dual-screen-active .f2f-td-status-dot.other-screen {
    display: inline-block; /* Show second dot in dual mode */
}

/* ======================================== */
/* 3. Content Area & Masonry Grid         */
/* ======================================== */

/* Results Container - Calculate exact height */
.f2f-td-display-results-container {
    flex-grow: 1; /* Take remaining vertical space */
    height: calc(100vh - 400px); /* Viewport height minus header and footer */
    min-height: calc(100vh - 400px); /* Ensure minimum height */
    max-height: calc(100vh - 400px); /* Ensure maximum height */
    overflow: hidden; /* IMPORTANT: Parent must hide overflow */
    padding: 1% 2% 1% 2%; /* Reduced padding */
    box-sizing: border-box;
    position: relative;
}

/* Ensure Masonry grid uses full height */
.f2f-td-aquariums-grid,
.masonry-grid {
    width: 100%;
    height: 100%; /* Fill the results container */
    max-height: 100%;
    overflow-y: auto; /* Allow vertical scrolling *within the grid* */
    position: relative; /* Needed for absolute positioning of items by Masonry */
    box-sizing: border-box;
    padding-bottom: 20px; /* Extra bottom padding to prevent cut-off */
    
    /* Hide scrollbars */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.f2f-td-aquariums-grid::-webkit-scrollbar,
.masonry-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Loading Indicator (Placed via JS outside grid or shown when grid empty) */
.f2f-td-loading {
    text-align: center;
    padding: 5%;
    font-size: 2.6vw;
    color: #add8e6;
    animation: pulse 1.5s infinite;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No Results / No Data Message (Shown when grid empty) */
.f2f-td-no-results,
.f2f-td-no-data {
    text-align: center;
    padding: 5%;
    font-size: 2.2vw;
    color: #add8e6;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======================================== */
/* 4. Masonry Helper Elements             */
/* ======================================== */
/* Override Masonry grid sizer classes - no longer needed with column-based approach */
.grid-sizer,
.gutter-sizer {
    display: none;
}

/* ======================================== */
/* 5. Aquarium Cards (General & Masonry)  */
/* ======================================== */

.f2f-td-aquarium-card {
    width: var(--column-width);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 2%;
    margin-bottom: 20px; /* Fixed bottom margin to prevent calculation issues */
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    min-height: 100px;
    overflow: hidden;
    position: relative;
    transition: opacity 0.5s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Special border for cards moved from the left display (overflow) */
.f2f-td-aquarium-card.overflow-card {
    border-left: 5px solid #f38221; /* Prominent orange left border */
}

/* ======================================== */
/* 6. Card Size Adjustment (Column Based) */
/* ======================================== */

/* Size adjustment styling (replaces transform scale) */
.f2f-td-size-adjusted .f2f-td-aquarium-card {
    /* Scale the card padding with the size factor */
    padding: calc(2% * var(--card-size-factor));
}

/* Text element scaling - use font-size-factor for better readability */
.f2f-td-size-adjusted .f2f-td-aquarium-header h3 {
    font-size: calc(1.6vw * var(--font-size-factor));
}

.f2f-td-size-adjusted .f2f-td-test-results-table table {
    font-size: calc(1.1vw * var(--font-size-factor));
}

.f2f-td-size-adjusted .f2f-td-last-tested {
    font-size: calc(1.1vw * var(--font-size-factor));
}

.f2f-td-size-adjusted .f2f-td-type-badge {
    font-size: calc(0.9vw * var(--font-size-factor));
}

.f2f-td-size-adjusted .f2f-td-issue-badge,
.f2f-td-size-adjusted .f2f-td-issue-badge-critical {
    font-size: calc(1.0vw * var(--font-size-factor));
}

/* ======================================== */
/* 7. Card Status & Animations            */
/* ======================================== */

/* Card status indicators based on issues */
.f2f-td-aquarium-card.has-issues {
    border-color: #FFC107; /* Yellow */
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
}
.f2f-td-aquarium-card.critical-issues {
    border-color: #F44336; /* Red */
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.7);
}

/* Card update/add/remove animations */
/* These might conflict slightly with Masonry's transitionDuration - adjust as needed */
.f2f-td-aquarium-card.updated {
    animation: card-highlight 2s ease-in-out;
}
.f2f-td-aquarium-card.new-card {
    animation: card-fade-in 0.5s ease-out; /* Faster fade-in */
}
.f2f-td-aquarium-card.removing {
    animation: card-fade-out 0.5s ease-in forwards;
    z-index: -1; /* Ensure it goes behind during removal */
}

/* ======================================== */
/* 8. Card Content                        */
/* ======================================== */
/* Styles for h3, badges, table, notes etc. remain largely the same */
/* Ensure font sizes scale reasonably or use vw units */

/* Card Header Section */
.f2f-td-aquarium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1.5%;
}
.f2f-td-aquarium-header h3 {
    font-size: 1.6vw; /* Adjusted relative size */
    margin: 0;
    color: #f38221;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75%; /* Allow more space for title */
}
.f2f-td-text-overflow .f2f-td-aquarium-header h3 {
    font-size: calc(1.6vw * 0.9); /* Reduce if overflowing */
}

/* Aquarium Type Badge */
.f2f-td-type-badge {
    font-size: 0.9vw; /* Adjusted relative size */
    padding: 0.8% 2%;
    border-radius: 20px;
    font-weight: bold;
    flex-shrink: 0;
}
.f2f-td-type-badge.saltwater { background-color: #00677f; color: #fff; }
.f2f-td-type-badge.freshwater { background-color: #27ae60; color: #fff; }

/* Last Tested Date Section */
.f2f-td-last-tested {
    font-size: 1.1vw; /* Adjusted relative size */
    margin-bottom: 2%;
    color: #add8e6;
}
.f2f-td-last-tested span { font-weight: bold; }

/* Issue Count Badge */
.f2f-td-issue-badge,
.f2f-td-issue-badge-critical {
    display: inline-block;
    padding: 0.8% 2%;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.0vw; /* Adjusted relative size */
    margin-bottom: 2%;
}
.f2f-td-issue-badge { background-color: #FFC107; color: #000; }
.f2f-td-issue-badge-critical { background-color: #F44336; color: #fff; }

/* Test Results Table Section */
.f2f-td-test-results-table { width: 100%; overflow: hidden; margin-bottom: 2%; }
.f2f-td-test-results-table table { width: 100%; border-collapse: collapse; font-size: 1.1vw; } /* Adjusted */
.f2f-td-text-overflow .f2f-td-test-results-table table { font-size: calc(1.1vw * 0.95); } /* Slight reduction */
.f2f-td-test-results-table th { text-align: left; padding: 1.5% 2%; background-color: rgba(0, 0, 0, 0.3); color: #f38221; font-weight: bold; }
.f2f-td-test-results-table td { padding: 1.5% 2%; border-bottom: 1px solid rgba(255, 255, 255, 0.1); vertical-align: middle; }
.f2f-td-test-results-table tr.out-of-range td { color: #f38221; font-weight: bold; }
.f2f-td-test-results-table tr:last-child td { border-bottom: none; }
.f2f-td-test-results-table td.status-cell { white-space: nowrap; } /* Prevent status text wrapping */
.f2f-td-test-results-table span.status-icon { margin-right: 4px; }

/* Parameter Trend Indicators */
.trend-good { color: #4CAF50; font-weight: bold; font-size: 1.2em; }
.trend-bad { color: #F44336; font-weight: bold; font-size: 1.2em; }
.trend-neutral { color: #FFC107; font-weight: bold; font-size: 1.2em; }

/* Test Notes Section */
.f2f-td-test-notes { margin-top: 2%; padding: 2%; background-color: rgba(0, 0, 0, 0.2); border-radius: 5px; }
.f2f-td-test-notes h4 { font-size: 1.0vw; margin: 0 0 1% 0; color: #f38221; font-weight: bold; }
.f2f-td-test-notes p { font-size: 0.9vw; margin: 0; color: #fff; line-height: 1.4; word-wrap: break-word; }

/* ======================================== */
/* 9. Notices & Indicators (Non-Header)   */
/* ======================================== */

/* General Aquarium Type Header (Above Grid) */
.f2f-td-display-type-header { padding: 1% 2%; text-align: center; margin-bottom: 1%; }
.f2f-td-aquarium-counts { display: flex; justify-content: center; gap: 1.5vw; margin-top: 0.5%; }
.f2f-td-count-badge { display: inline-block; padding: 0.5% 1.5%; border-radius: 20px; font-size: 1.1vw; font-weight: bold; background-color: rgba(255, 255, 255, 0.1); color: #fff; }
.f2f-td-count-badge.freshwater { background-color: rgba(39, 174, 96, 0.3); }
.f2f-td-count-badge.saltwater { background-color: rgba(0, 103, 127, 0.3); }
.f2f-td-count-badge.total { background-color: rgba(243, 130, 33, 0.3); }

/* Recovery Mode Notice (Optional) */
.f2f-td-recovery-notice { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background-color: rgba(243, 130, 33, 0.8); color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 1.2vw; z-index: 100; }

/* Balance Notice (Debugging) */
.f2f-td-balance-notice { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: rgba(0, 0, 0, 0.7); color: white; padding: 8px 16px; border-radius: 20px; font-size: 1.1vw; z-index: 100; animation: fade-in 0.5s ease-in-out; }

/* ======================================== */
/* 10. Footer Elements                    */
/* ======================================== */

/* Footer Container - Fixed 200px height */
.f2f-td-display-footer {
    position: relative;
    width: 100%;
    height: 200px; /* Fixed height as requested */
    min-height: 200px; /* Ensure minimum height */
    max-height: 200px; /* Ensure maximum height */
    flex-shrink: 0;
    z-index: 5;
    box-sizing: border-box; /* Include padding/border in height calculation */
}
.f2f-td-footer-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.f2f-td-display-container[data-display="left"] .f2f-td-footer-image,
.f2f-td-display-container[data-display="specific"] .f2f-td-footer-image { /* Specific uses left footer? */
    background-image: url('../images/footer-l.png');
}
.f2f-td-display-container[data-display="right"] .f2f-td-footer-image {
    background-image: url('../images/footer-r.png');
}

/* ======================================== */
/* 11. Animations (General Keyframes)     */
/* ======================================== */

/* Loading indicator pulse */
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* Card highlight on update */
@keyframes card-highlight { 0% { background-color: rgba(255, 255, 255, 0.1); } 25% { background-color: rgba(76, 175, 80, 0.3); } 100% { background-color: rgba(255, 255, 255, 0.1); } }

/* Card fade in - updated for column approach */
@keyframes card-fade-in { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

/* Card fade out - updated for column approach */
@keyframes card-fade-out { 0% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* Balance notice fade in */
@keyframes fade-in { 0% { opacity: 0; transform: translate(-50%, 20px); } 100% { opacity: 1; transform: translate(-50%, 0); } }

/* Table row fade in and highlight */
@keyframes table-row-highlight { 0% { background-color: transparent; } 50% { background-color: rgba(76, 175, 80, 0.2); } 100% { background-color: transparent; } }

/* ======================================== */
/* 12. Table-Based Display Styles (Backup Mode) */
/* ======================================== */

/* Table Wrapper Container */
.f2f-td-backup-mode .f2f-td-tables-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* Hide scrollbars */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.f2f-td-backup-mode .f2f-td-tables-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Table Container for each type */
.f2f-td-backup-mode .f2f-td-table-container {
    margin-bottom: 30px;
    /* Apply table scaling via CSS variables */
    font-size: calc(var(--table-base-font-size) * var(--table-scale-factor));
}

/* Type Header */
.f2f-td-backup-mode .f2f-td-table-type-header {
    color: #f38221;
    font-size: 60px;
    margin: 0 0 10px 0;
    padding: 5px 0;
    border-bottom: 2px solid rgba(243, 130, 33, 0.5);
    font-size: 30px;
}

/* Table styling */
.f2f-td-backup-mode .f2f-td-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    font-size: 72px;
}

/* Table headers */
.f2f-td-backup-mode .f2f-td-results-table thead th {
    background-color: rgba(0, 0, 0, 0.3);
    color: #add8e6;
    font-weight: bold;
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    font-size: 30px;
}

/* Fixed width columns */
.f2f-td-backup-mode .f2f-td-table-col-aquarium {
    width: 20%; /* Fixed width for aquarium names */
    min-width: 150px;
}

.f2f-td-backup-mode .f2f-td-table-col-tested {
    width: 10%; /* Fixed width for last tested */
    min-width: 100px;
}

.f2f-td-backup-mode .f2f-td-table-col-param {
    /* Parameter columns share remaining space evenly */
}

/* Table cells */
.f2f-td-backup-mode .f2f-td-results-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    font-size: 60px;
}

.f2f-td-backup-mode .f2f-td-results-table tr:last-child td {
    border-bottom: none; /* Remove border for last row */
}

.f2f-td-backup-mode .f2f-td-results-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect */
}

/* Aquarium name column */
.f2f-td-backup-mode .f2f-td-table-name {
    font-weight: bold;
    color: #f38221;
}

/* Table value styles */
.f2f-td-backup-mode .f2f-td-table-value {
    text-align: center;
    position: relative;
}

/* Missing value (empty cell) */
.f2f-td-backup-mode .f2f-td-table-value.f2f-td-missing {
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
}

/* Out of range value */
.f2f-td-backup-mode .f2f-td-table-value.f2f-td-out-of-range {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
    font-weight: bold;
}

/* Last tested column */
.f2f-td-backup-mode .f2f-td-table-tested {
    text-align: center;
    color: #add8e6;
}

/* Updated row highlight animation */
.f2f-td-backup-mode .f2f-td-table-row.updated {
    animation: table-row-highlight 2s ease-in-out;
}

/* Special styling based on aquarium type */
.f2f-td-backup-mode .f2f-td-type-saltwater .f2f-td-table-type-header {
    color: #00677f;
    border-bottom-color: rgba(0, 103, 127, 0.5);
}

.f2f-td-backup-mode .f2f-td-type-freshwater .f2f-td-table-type-header {
    color: #27ae60;
    border-bottom-color: rgba(39, 174, 96, 0.5);
}

/* ======================================== */
/* 13. Media Queries                      */
/* ======================================== */

/* Adjustments for very wide 4K screens (>= 3840px) */
@media screen and (min-width: 3840px) {
    /* Column count for 4K displays */
    .f2f-td-display-container {
        --column-count: 3; /* Default to 3 columns on very large screens */
    }
    
    /* Slightly reduce relative sizes for better scaling */
    .f2f-td-aquarium-header h3 { font-size: 1.2vw; }
    .f2f-td-test-results-table table { font-size: 1.0vw; }
    .f2f-td-last-tested { font-size: 1.0vw; }
    .f2f-td-type-badge { font-size: 0.8vw; }
    .f2f-td-issue-badge, .f2f-td-issue-badge-critical { font-size: 0.9vw; }
    .f2f-td-combined-status span.f2f-td-status-text { font-size: 1.1vw; }
    .f2f-td-combined-status span.f2f-td-status-dot { width: 0.8vw; height: 0.8vw; }
    .f2f-td-display-datetime { font-size: 1.6vw; }

    .f2f-td-test-results-table table { font-size: 0.9vw; }
    .f2f-td-last-tested { font-size: 0.9vw; }
    .f2f-td-type-badge { font-size: 0.7vw; }
    .f2f-td-issue-badge, .f2f-td-issue-badge-critical { font-size: 0.8vw; }
    
    /* Table mode adjustments for 4K */
    .f2f-td-backup-mode .f2f-td-table-container {
        --table-base-font-size: 1.0rem;
    }
}

/* Adjustments for smaller 4K screens or large QHD (~2560px) */
@media screen and (max-width: 2560px) {
    .f2f-td-display-container {
        --column-count: 2; /* Default to 2 columns on medium screens */
    }
    
    /* Slightly increase relative sizes */
    .f2f-td-aquarium-header h3 { font-size: 1.8vw; }
    .f2f-td-test-results-table table { font-size: 1.2vw; }
    .f2f-td-last-tested { font-size: 1.2vw; }
    .f2f-td-type-badge { font-size: 1.0vw; }
    .f2f-td-issue-badge, .f2f-td-issue-badge-critical { font-size: 1.1vw; }
    .f2f-td-combined-status span.f2f-td-status-text { font-size: 1.4vw; }
    .f2f-td-combined-status span.f2f-td-status-dot { width: 1.1vw; height: 1.1vw; }
    .f2f-td-display-datetime { font-size: 2.0vw; }
    
    /* Table mode adjustments for QHD */
    .f2f-td-backup-mode .f2f-td-table-container {
        --table-base-font-size: 1.1rem;
    }
}

/* Adjustments specifically for the 1080p display (max-width: 1920px) */
@media screen and (max-width: 1920px) {
    /* For 1080p, use 1 column by default */
    .f2f-td-display-container {
        --column-count: 1; /* Default to 1 column on smaller screens */
    }

    /* Increase relative font sizes for better readability on 1080p */
    .f2f-td-aquarium-header h3 { font-size: 2.0vw; }
    .f2f-td-test-results-table table { font-size: 1.6vw; }
    .f2f-td-last-tested { font-size: 1.6vw; }
    .f2f-td-type-badge { font-size: 1.3vw; }
    .f2f-td-issue-badge, .f2f-td-issue-badge-critical { font-size: 1.4vw; }
    .f2f-td-combined-status span.f2f-td-status-text { font-size: 2.0vw; }
    .f2f-td-combined-status span.f2f-td-status-dot { width: 1.8vw; height: 1.8vw; }
    .f2f-td-display-datetime { font-size: 2.5vw; }
    
    /* Table mode adjustments for 1080p */
    .f2f-td-backup-mode .f2f-td-table-container {
        --table-base-font-size: 1.2rem;
    }
}