/* ==========================================================================
   DRCC Database Comparison Tool - CSS Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE STYLES ONLY FOR DEVELOPMENT
   ========================================================================== */

body {
    font-family: 'Roboto Condensed', sans-serif;
    line-height: 1.6;
    color: var(--base-dark-charcoal);
    font-weight: 400;
    background-color: var(--base-white);
}

/* Typography headings - now using base classes */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--base-black);
    margin-top: 0;
}

/* Body text elements */
p, ul, ol, blockquote {
    color: var(--base-light-charcoal);
    font-weight: 400;
    line-height: 1.5;
}

/* Links */
a {
    color: var(--base-monash-blue);
    text-decoration: underline;
}

a:hover,
a:focus {
    text-decoration: none;
}

a:active {
    color: var(--base-cerise);
}
/* end of reset & base styles */

.drcc-container {
    font-family: 'Roboto', sans-serif;
    
    /* Monash Brand Colors */
    --base-monash-blue: #006dae;
    --base-hover-blue: #0289d4;
    --base-black: #000;
    --base-white: #fff;
    
    /* Text Colors */
    --base-dark-charcoal: #3c3c3c;
    --base-light-charcoal: #505050;
    --base-cerise: #c8008f;
    
    /* UI Colors */
    --graphite-grey-05: #f6f6f6;
    --graphite-grey-06: #f8f8f8;
    --graphite-functional-disabled: #969696;
    
    /* Border Colors */
    --border-light: #e8ecef;
    --border-medium: #d1d5db;
    --border-section: #f3f4f6;
    --table-border: #d6d6d6;
    --table-first-column-bg: #dbdbdb;
    
    /* Selection Colors */
    --selection-teal-bg: #0d6554;
    --selection-purple-bg: #7463d7;
    --selection-organge-bg: #C33603;
    --selection-red-bg: #710044;

    /* Icon URLs - Change these for deployment */
    /* LOCAL DEVELOPMENT
    --icon-aws: url('../icons/aws.svg');
    --icon-azurecloud: url('../icons/azurecloud.svg');
    --icon-cloudstor: url('../icons/cloudstor.svg');
    --icon-eresearch: url('../icons/eresearch.svg');
    --icon-gitlab: url('../icons/gitlab.svg');
    --icon-gshareddrive: url('../icons/gshareddrive.svg');
    --icon-gsites: url('../icons/gsites.svg');
    --icon-labarchives: url('../icons/labarchives.svg');
    --icon-laptop: url('../icons/laptop.svg');
    --icon-m3: url('../icons/m3.svg');
    --icon-mdrive: url('../icons/mdrive.svg');
    --icon-mosarc: url('../icons/mosarc.svg');
    --icon-mprivatecloud: url('../icons/mprivatecloud.svg');
    --icon-murda: url('../icons/murda.svg');
    --icon-mydrive: url('../icons/mydrive.svg');
    --icon-pawsey: url('../icons/pawsey.svg');
    --icon-pdrive: url('../icons/pdrive.svg');
    --icon-qualtrics: url('../icons/qualtrics.svg');
    --icon-qualtricsplus: url('../icons/qualtricsplus.svg');
    --icon-rdscomputational: url('../icons/rdscomputational.svg');
    --icon-rdsmarket: url('../icons/rdsmarket.svg');
    --icon-rdsobject: url('../icons/rdsobject.svg');
    --icon-rdsvault: url('../icons/rdsvault.svg');
    --icon-redcap: url('../icons/redcap.svg');
    --icon-sdrive: url('../icons/sdrive.svg');
    --icon-serp: url('../icons/serp.svg');
    --icon-zoom: url('../icons/zoom.svg');
    --icon-book: url('../icons/book.svg');
    --icon-globe: url('../icons/globe.svg');
    --icon-mail: url('../icons/mail.svg');
    --icon-note: url('../icons/note.svg');
    */

     /* SQUIZ MATRIX PRODUCTION - use these for deployment */
    --icon-book: url('https://www.monash.edu/__data/assets/file/0003/4132929/book.svg');
    --icon-globe: url('https://www.monash.edu/__data/assets/file/0004/4132930/globe.svg');
    --icon-mail: url('https://www.monash.edu/__data/assets/file/0005/4132931/mail.svg');
    --icon-note: url('https://www.monash.edu/__data/assets/file/0006/4132932/note.svg');
    --icon-aws: url('https://www.monash.edu/__data/assets/file/0007/4132933/aws.svg');
    --icon-azurecloud: url('https://www.monash.edu/__data/assets/file/0008/4132934/azurecloud.svg');
    --icon-cloudstor: url('https://www.monash.edu/__data/assets/file/0009/4132935/cloudstor.svg');
    --icon-eresearch: url('https://www.monash.edu/__data/assets/file/0010/4132936/eresearch.svg');
    --icon-gitlab:  url('https://www.monash.edu/__data/assets/file/0011/4132937/gitlab.svg');
    --icon-gshareddrive:  url('https://www.monash.edu/__data/assets/file/0003/4132938/gshareddrive.svg');
    --icon-gsites:  url('https://www.monash.edu/__data/assets/file/0004/4132939/gsites.svg');
    --icon-labarchives:  url('https://www.monash.edu/__data/assets/file/0005/4132940/labarchives.svg');
    --icon-laptop: url('https://www.monash.edu/__data/assets/file/0006/4132941/laptop.svg');
    --icon-m3: url('https://www.monash.edu/__data/assets/file/0007/4132942/m3.svg');
    --icon-mdrive: url('https://www.monash.edu/__data/assets/file/0008/4132943/mdrive.svg');
    --icon-mosarc: url('https://www.monash.edu/__data/assets/file/0009/4132944/mosarc.svg');
    --icon-mprivatecloud: url('https://www.monash.edu/__data/assets/file/0010/4132945/mprivatecloud.svg');
    --icon-murda: url('https://www.monash.edu/__data/assets/file/0011/4132946/murda.svg');
    --icon-mydrive: url('https://www.monash.edu/__data/assets/file/0003/4132947/mydrive.svg');
    --icon-pawsey: url('https://www.monash.edu/__data/assets/file/0005/4132949/pawsey.svg');
    --icon-pdrive: url('https://www.monash.edu/__data/assets/file/0006/4132950/pdrive.svg');
    --icon-qualtrics: url('https://www.monash.edu/__data/assets/file/0007/4132951/qualtrics.svg');
    --icon-qualtricsplus:url('https://www.monash.edu/__data/assets/file/0003/4132956/qualtricsplus.svg');
    --icon-rdscomputational: url('https://www.monash.edu/__data/assets/file/0004/4132957/rdscomputational.svg');
    --icon-rdsmarket: url('https://www.monash.edu/__data/assets/file/0005/4132958/rdsmarket.svg');
    --icon-rdsobject: url('https://www.monash.edu/__data/assets/file/0006/4132959/rdsobject.svg');
    --icon-rdsvault: url('https://www.monash.edu/__data/assets/file/0007/4132960/rdsvault.svg');
    --icon-redcap: url('https://www.monash.edu/__data/assets/file/0008/4132961/redcap.svg');
    --icon-sdrive: url('https://www.monash.edu/__data/assets/file/0009/4132962/sdrive.svg');
    --icon-serp: url('https://www.monash.edu/__data/assets/file/0010/4132963/serp.svg');
    --icon-zoom: url('https://www.monash.edu/__data/assets/file/0011/4132964/zoom.svg');
}

/* ==========================================================================
   2. LAYOUT COMPONENTS
   ========================================================================== */

/* Main layout */
.main-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
    margin-top: 20px;
    min-height: calc(100vh - 60px);
}

/* ==========================================================================
   3. FILTERS SIDEBAR
   ========================================================================== */

.filters-sidebar {
    width: 350px;
    flex-shrink: 0;
    background: white;
    /* max-height: calc(100vh - 180px); */
    overflow-y: auto;
    position: sticky;
    top: 20px;
    border-left: none;
    border-top: none;
    border-bottom: none;
    align-self: flex-start;
}

.filters-container {
    padding: 20px;
}

.filters-container h2 {
    margin-bottom: 8px;
}

.filter-description,
.describe-data-section .description {
    color: var(--base-black);
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 20px;
}

.describe-data-section .description {
    font-weight: 400;
}

/* Filter sections */
.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Describe your data section */
.describe-data-section {
    margin-top: 20px;
    margin-bottom: 20px;
    transition: opacity 0.3s ease-in-out;
}

.describe-data-section h3 {
    margin-bottom: 1rem;
}

.filter-section h2,
.filter-section h3 {
    margin-top: 2rem;
}

.filter-section h2 {
    font-size: 1.5em;
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 1.185em;
    margin-bottom: 1rem;
}

/* Research phase dropdown */
.research-phase-section {
    margin-bottom: 20px;
}

.research-phase-dropdown {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border-medium);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    background: var(--base-white);
    color: var(--base-dark-charcoal);
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    opacity: 1;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23505050' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center; /* Position arrow 12px from right edge */
    background-size: 16px;
}

.research-phase-dropdown:focus {
    outline: none;
    border-color: var(--base-monash-blue);
    box-shadow: 0 0 0 3px rgba(0, 109, 174, 0.1);
}

.research-phase-dropdown:hover {
    border-color: var(--base-monash-blue);
}

/* Radio button groups */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 400;
    line-height: 1.2;
    padding: 8px 12px;
    color: var(--base-black);
    transition: all 0.25s ease;
    position: relative;
    border-radius: 4px;
}

.radio-label:hover {
    background-color: var(--graphite-grey-06);
    color: var(--base-monash-blue);
}

/* Custom radio button styling */
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    width: 0;
    height: 0;
}

.radio-label .radiomark {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 12px;
    border: 2px solid var(--border-medium);
    border-radius: 50%;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radiomark {
    border-color: var(--base-monash-blue);
    background-color: var(--base-monash-blue);
}

.radio-label input[type="radio"]:checked + .radiomark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

.radio-label:hover .radiomark {
    border-color: var(--base-monash-blue);
}

.radio-label:focus-within {
    color: var(--base-monash-blue);
    background-color: var(--graphite-grey-06);
}

.radio-label input[type="radio"]:focus + .radiomark {
    outline: 2px solid var(--base-monash-blue);
    outline-offset: 2px;
}

.radio-label input[type="radio"]:disabled + .radiomark {
    cursor: not-allowed;
    opacity: 0.5;
    border-color: var(--graphite-functional-disabled);
}

.radio-label input[type="radio"]:disabled + .radiomark + span {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-label input[type="radio"]:checked + .radiomark {
    border-color: var(--base-monash-blue);
    background-color: var(--base-monash-blue);
}

.radio-label input[type="radio"]:checked + .radiomark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

.radio-label:hover .radiomark {
    border-color: var(--base-monash-blue);
}

/* Filter actions */
.filter-actions {
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   4. CONTENT AREA & DATABASE SECTIONS
   ========================================================================== */

.content-area {
    flex: 1;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100vh - 80px);
}

.databases-section,
.selected-section,
.results-section {
    background: white;
    margin-bottom: 0;
    border: none;
}

.section-intro {
    padding: 30px 30px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 20px;
    border-bottom: none;
}

.section-header h2 {
    font-size: 1.5em;
    margin: 0;
    max-width: 50%;
}

.database-selection-info {
    color: var(--base-black);
    font-size: 0.9em;
    margin: -10px 30px 20px;
    font-weight: 400;
}

/* Card actions */
.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 30px 30px;
    margin-top: -10px;
}

/* Results count */
.results-count {
    color: var(--base-black);
    font-size: 0.9em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   5. DATABASE CARDS
   ========================================================================== */

.database-cards-container,
.selected-cards-container {
    padding: 0 30px 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.database-card {
    border: 0;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.25s ease-in-out;
    background: var(--base-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.database-card:hover {
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}

.database-card.selected {
    color: var(--base-white);
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}

.database-card.selected .database-name,
.database-card.selected .database-description {
    color: var(--base-white);
}

/* Make database icons white when selected */
.database-card.selected .database-icon {
    filter: brightness(0) invert(1);
}

/* Selected card colors - matches reference design */
.database-card.selected.color-0 {
    border-color: var(--selection-teal-bg);
    background-color: var(--selection-teal-bg);
}

.database-card.selected.color-1 {
    border-color: var(--selection-purple-bg);
    background-color: var(--selection-purple-bg);
}

.database-card.selected.color-2 {
    border-color: var(--selection-organge-bg);
    background-color: var(--selection-organge-bg);
}

.database-card.selected.color-3 {
    border-color: var(--selection-red-bg);
    background-color: var(--selection-red-bg);
}

.database-name {
    font-size: 1em;
    font-weight: 700;
    color: var(--base-monash-blue);
    margin-bottom: 6px;
    gap: 6px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.database-icon {
    width: 30px;
    height: 30px;
    margin-right: 8px;
    flex-shrink: 0;
    display: inline-block;
}

.database-description {
    color: var(--base-light-charcoal);
    font-size: 0.85em;
    line-height: 1.4;
    margin-bottom: 0;
    font-weight: 400;
    word-wrap: break-word;
}

.capabilities-preview {
    display: none;
}

/* Icon CSS Classes */

.icon-book {
    background-image: var(--icon-book);
}

.icon-globe {
    background-image: var(--icon-globe);
}

.icon-mail {
    background-image: var(--icon-mail);
}

.icon-note {
    background-image: var(--icon-note);
}

.icon-aws {
    background-image: var(--icon-aws);
}

.icon-azurecloud {
    background-image: var(--icon-azurecloud);
}

.icon-cloudstor {
    background-image: var(--icon-cloudstor);
}

.icon-eresearch {
    background-image: var(--icon-eresearch);
}

.icon-gitlab {
    background-image: var(--icon-gitlab);
}

.icon-gshareddrive {
    background-image: var(--icon-gshareddrive);
}

.icon-gsites {
    background-image: var(--icon-gsites);
}

.icon-labarchives {
    background-image: var(--icon-labarchives);
}

.icon-laptop {
    background-image: var(--icon-laptop);
}

.icon-m3 {
    background-image: var(--icon-m3);
}

.icon-mdrive {
    background-image: var(--icon-mdrive);
}

.icon-mosarc {
    background-image: var(--icon-mosarc);
}

.icon-mprivatecloud {
    background-image: var(--icon-mprivatecloud);
}

.icon-murda {
    background-image: var(--icon-murda);
}

.icon-mydrive {
    background-image: var(--icon-mydrive);
}

.icon-pawsey {
    background-image: var(--icon-pawsey);
}

.icon-pdrive {
    background-image: var(--icon-pdrive);
}

.icon-qualtrics {
    background-image: var(--icon-qualtrics);
}

.icon-qualtricsplus {
    background-image: var(--icon-qualtricsplus);
}

.icon-rdscomputational {
    background-image: var(--icon-rdscomputational);
}

.icon-rdsmarket {
    background-image: var(--icon-rdsmarket);
}

.icon-rdsobject {
    background-image: var(--icon-rdsobject);
}

.icon-rdsvault {
    background-image: var(--icon-rdsvault);
}

.icon-redcap {
    background-image: var(--icon-redcap);
}

.icon-sdrive {
    background-image: var(--icon-sdrive);
}

.icon-serp {
    background-image: var(--icon-serp);
}

.icon-zoom {
    background-image: var(--icon-zoom);
}

/* ==========================================================================
   6. BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

.clear-btn, 
.compare-btn, 
.export-btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.25s ease, opacity 0.25s ease;
    user-select: none;
    position: relative;
}

.clear-btn {
    background: transparent;
    color: var(--base-monash-blue);
    border: 1px solid var(--base-monash-blue);
}

.clear-btn:hover,
.clear-btn:focus {
    background-color: var(--base-monash-blue);
    color: white;
}

.compare-btn {
    background-color: var(--base-monash-blue);
    color: var(--base-white);
}

.compare-btn:hover:not(:disabled),
.compare-btn:focus:not(:disabled) {
    background-color: var(--base-hover-blue);
}

.compare-btn:disabled {
    background: var(--graphite-functional-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

.export-btn {
    background: var(--base-monash-blue);
    color: var(--base-white);
}

.export-btn:hover,
.export-btn:focus {
    background-color: var(--base-hover-blue);
}

/* ==========================================================================
   7. COMPARISON TABLE
   ========================================================================== */

.comparison-table {
    padding: 20px 30px 30px;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--table-border);
    font-size: 14px;
}

.comparison-table th {
    background-color: var(--graphite-grey-05);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Dynamic header colors matching selected cards */
.comparison-table th.color-0 {
    background-color: var(--selection-teal-bg) !important;
    color: white;
}

.comparison-table th.color-1 {
    background-color: var(--selection-purple-bg) !important;
    color: white;
}

.comparison-table th.color-2 {
    background-color: var(--selection-organge-bg) !important;
    color: white;
}

.comparison-table th.color-3 {
    background-color: var(--selection-red-bg) !important;
    color: white;
}

.comparison-table .database-icon {
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

/* Alternating column colors instead of rows */
.comparison-table td:nth-child(even),
.comparison-table th:nth-child(even):not([class*="color-"]) {
    background-color: var(--graphite-grey-06);
}

.comparison-table tr:hover td {
    background-color: #e3f2fd;
}

.comparison-table .desktop-table td:first-child,
.comparison-table .desktop-table th:first-child {
    background: var(--table-first-column-bg) !important;
}

.comparison-table .desktop-table .database-icon-wrapper {
    display: flex;
    align-items: center;
}

.external-monash-id-note {
    margin: 20px 0 0;
    font-size: 14px;
}

/* Hide mobile table on desktop */
.mobile-table {
    display: none;
}

/* ==========================================================================
   8. UTILITY CLASSES
   ========================================================================== */

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Typography utility classes */
.heading-font {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI Condensed', 'Arial Narrow', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--base-black);
}

.body-text {
    color: var(--base-light-charcoal);
    font-weight: 400;
    line-height: 1.5;
}

.description-text {
    color: var(--base-black);
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 20px;
}

.section-heading {
    font-size: 1.5em;
    margin-bottom: 1.5rem;
}

.subsection-heading {
    font-size: 1.185em;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #95a5a6;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Selected count indicator */
.selected-count {
    background: var(--base-monash-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN
   ========================================================================== */

/* Medium screens */
@media (max-width: 900px) {
    .database-cards-container,
    .selected-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small screens (mobile) */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        gap: 0;
    }
    
    .filters-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
    
    .database-cards-container,
    .selected-cards-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px 20px 20px;
    }
    
    .section-intro {
        padding: 0 20px 0 20px;
    }

    .section-header {
        padding: 20px 20px 0 20px;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .section-header h2 {
        max-width: 100%;
    }

    .card-actions {
        padding: 20px;
    }

    .database-selection-info {
        margin: 20px;
    }
    
    .filter-actions {
        flex-direction: row;
        gap: 10px;
    }
    
    .clear-btn, .compare-btn {
        flex: 1;
    }
    
    .container {
        padding: 10px;
    }

    .export-btn {
        width: 200px;
        margin-left: auto;
    }

    .filter-section {
        margin-bottom: 20px;
    }
    
    .comparison-table {
        font-size: 11px;
        padding: 15px 20px 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide desktop table on mobile */
    .desktop-table {
        display: none;
    }
    
    /* Show mobile table */
    .mobile-table {
        display: table !important;
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }
    
    .mobile-table th,
    .mobile-table td {
        padding: 6px 4px;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-table .database-icon {
        display: block;
        margin: 0 auto;
    }

    /* all classes with color (1, 2, 3, 4) in mobile table */
    .mobile-table th.color-0,
    .mobile-table th.color-1,
    .mobile-table th.color-2,
    .mobile-table th.color-3,
    .mobile-table th.color-4 {
        text-align: center;
    }

    
    .mobile-row-header {
        background: var(--table-first-column-bg) !important;
        font-weight: 600;
        text-align: center;
        white-space: normal;
        word-wrap: break-word;
        font-size: 11px !important;
        padding: 8px 4px !important;
    }

    h2 {
        font-size: 1.9em;
    }

    h3 {
        font-size: 1.5em;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    
    header h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.25em;
    }

    .filters-container {
        padding: 20px 0;
    }

    .database-selection-info {
        margin: 20px 0;
    }
    
    .section-intro {
        padding: 0;
    }

    .section-header {
        padding: 20px 0 0 0;
    }

    .card-actions {
        padding: 20px 0;
    }

    .database-cards-container,
    .selected-cards-container {
        grid-template-columns: repeat(1, 1fr);
        padding: 15px 0 20px;
    }

    .comparison-table {
        padding: 15px 0 20px;
    }
}

/* ==========================================================================
   10. PRINT STYLES FOR PDF EXPORT
   ========================================================================== */

@media print {
    /* Hide everything except comparison table */
    .main-layout,
    .export-btn {
        display: none;
    }
    
    /* Show only the comparison table and its contents */
    .results-section,
    .results-section *,
    .comparison-table,
    .comparison-table * {
        visibility: visible;
    }
    
    /* Position the comparison table to fill the page */
    .results-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
    }
    
    .comparison-table {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    /* Ensure table fits on page */
    .comparison-table table {
        width: 100%;
        font-size: 10px;
        border-collapse: collapse;
        page-break-inside: auto;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 6px 4px;
        font-size: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Maintain header colors in print */
    .comparison-table th.color-0 {
        background-color: var(--selection-teal-bg) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table th.color-1 {
        background-color: var(--selection-purple-bg) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table th.color-2 {
        background-color: var(--selection-organge-bg) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table th.color-3 {
        background-color: var(--selection-red-bg) !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* First column styling for print */
    .comparison-table .desktop-table td:first-child,
    .comparison-table .desktop-table th:first-child {
        background: #e5e5e5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Icons in print - hide them since background images don't print reliably */
    .comparison-table .database-icon {
        display: none !important;
    }
    
    /* Ensure proper spacing for database names without icons */
    .comparison-table .database-icon-wrapper {
        color: white !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
    }
    
    /* Alternating column colors for readability */
    .comparison-table td:nth-child(even),
    .comparison-table th:nth-child(even):not([class*="color-"]) {
        background-color: #f8f8f8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Hide mobile table in print */
    .mobile-table {
        display: none !important;
    }
    
    /* Ensure desktop table is shown */
    .desktop-table {
        display: table !important;
    }
    
    /* Page settings */
    @page {
        margin: 0.5in;
        size: A4 landscape;
    }
    
    /* Add a title for the printed document */
    .results-section::before {
        content: "Data Solutions Comparison Table";
        display: block;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 15px;
        text-align: center;
        color: #333;
    }
    
    /* Prevent page breaks inside table rows */
    .comparison-table tr {
        page-break-inside: avoid;
    }
    
    /* Allow page breaks after every few rows */
    .comparison-table tr:nth-child(10n) {
        page-break-after: auto;
    }
}
