/*
 * Card database — table column widths, header filters, checkbox filter chrome.
 * Complements database-view.css. Deck editor Card View lives in deck-editor-card-view.css.
 * Roadmap: MOBILE_DESIGN.md (milestone M2a).
 */

/* Advanced Universe Search Input Styling - Direct override */
#advanced-universe-table .header-filter[data-column="card_effect"] {
    width: 480px !important;
    max-width: 480px !important;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

/* Advanced Universe Table Column Widths */
#advanced-universe-table {
    table-layout: fixed !important;
    width: 100% !important;
}

#advanced-universe-table th:nth-child(1), #advanced-universe-table td:nth-child(1) { width: 10% !important; } /* Image */
#advanced-universe-table th:nth-child(2), #advanced-universe-table td:nth-child(2) { width: 6% !important; }  /* Add to Deck */
#advanced-universe-table th:nth-child(3), #advanced-universe-table td:nth-child(3) { 
    width: 10% !important; 
    white-space: nowrap !important; 
    overflow: hidden !important; 
    text-overflow: ellipsis !important;
} /* Name - reduced to 10% */
#advanced-universe-table th:nth-child(4), #advanced-universe-table td:nth-child(4) { width: 10% !important; } /* Character */
#advanced-universe-table th:nth-child(5), #advanced-universe-table td:nth-child(5) { width: 25% !important; } /* Card Effect - increased to 25% */
#advanced-universe-table th:nth-child(6), #advanced-universe-table td:nth-child(6) { width: 7% !important; } /* One Per Deck */

/* Locations Search Input Styling - fluid within th (desktop; .layout-mobile also sets 100% in mobile-layout.css) */
#locations-table .header-filter[data-column="special_ability"],
#locations-table .header-filter[data-column="name"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

/*
 * Locations — DTV: column % parity with Characters DBV (image / actions / name / numeric / text).
 * Image + actions widened for large art + single-line +Deck/+Collection; scoped off .layout-mobile.
 */
html:not(.layout-mobile) #locations-table {
    table-layout: fixed !important;
    width: 100% !important;
}

html:not(.layout-mobile) #locations-table thead tr:first-child th:nth-child(1),
html:not(.layout-mobile) #locations-table tbody td:nth-child(1) {
    width: 24%;
} /* Image */

html:not(.layout-mobile) #locations-table thead tr:first-child th:nth-child(2),
html:not(.layout-mobile) #locations-table tbody td:nth-child(2) {
    width: 9%;
} /* Actions */

html:not(.layout-mobile) #locations-table thead tr:first-child th:nth-child(3),
html:not(.layout-mobile) #locations-table tbody td:nth-child(3) {
    width: 17%;
} /* Name */

html:not(.layout-mobile) #locations-table thead tr:first-child th:nth-child(4),
html:not(.layout-mobile) #locations-table tbody td:nth-child(4) {
    width: 6%;
} /* Threat */

html:not(.layout-mobile) #locations-table thead tr:first-child th:nth-child(5),
html:not(.layout-mobile) #locations-table tbody td:nth-child(5) {
    width: 44%;
} /* Special Ability */

/* Aspects Table Column Width Control */
#aspects-table {
    table-layout: fixed !important;
    width: 100% !important;
}

#aspects-table th:nth-child(1), #aspects-table td:nth-child(1) { width: 15%; } /* Image */
#aspects-table th:nth-child(2), #aspects-table td:nth-child(2) { width: 8%; }  /* Add to Deck */
#aspects-table th:nth-child(3), #aspects-table td:nth-child(3) { width: 18%; } /* Card Name */
#aspects-table th:nth-child(4), #aspects-table td:nth-child(4) { width: 12%; } /* Location */
#aspects-table th:nth-child(5), #aspects-table td:nth-child(5) { width: 25%; } /* Card Effect */
#aspects-table th:nth-child(6), #aspects-table td:nth-child(6) { width: 10%; } /* Fortifications */
#aspects-table th:nth-child(7), #aspects-table td:nth-child(7) { width: 12%; } /* One Per Deck */

/* Aspects Search Input Styling - Direct override */
#aspects-table .header-filter[data-column="card_name"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

#aspects-table .header-filter[data-column="location"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

#aspects-table .header-filter[data-column="card_effect"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}

/* Missions Table Two-Column Checkbox Layout — scope min-width to mission-set cell only;
   Card Name header uses .column-filters without .missions-column-filters; 400px there overflows column 3. */
/* Mission Set column: stacked label + select (checkbox grid removed) */
#missions-table .missions-column-filters {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    box-sizing: border-box;
}

#missions-table .missions-filter-card-name-th .column-filters {
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    /* Breathing room below thead “Card Name” label (DTV; MV hides this th) */
    padding-top: 6px;
}

/* Fix Card Name column width to prevent resizing when content changes */
#missions-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Use thead tr:first-child for th — missions-filter-row has colspan + set + name + empty Set; nth-child on filter row would mis-apply column widths. */
/* DTV parity with Characters/Locations DBV (card-tables loads after database-view.css) */
#missions-table thead tr:first-child th:nth-child(1), #missions-table td:nth-child(1) { width: 22%; } /* Image */
#missions-table thead tr:first-child th:nth-child(2), #missions-table td:nth-child(2) { width: 8%; } /* Actions */
#missions-table thead tr:first-child th:nth-child(3), #missions-table td:nth-child(3) { width: 20%; } /* Mission Set */
#missions-table thead tr:first-child th:nth-child(4), #missions-table td:nth-child(4) { width: 33%; } /* Card Name */
#missions-table thead tr:first-child th:nth-child(5), #missions-table td:nth-child(5) { width: 17%; } /* Product set */

/* Special Cards Table Column Width Control */
#special-cards-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Special cards — column % widths (override database-view.css where needed; totals 100%) */
#special-cards-table th:nth-child(1), #special-cards-table td:nth-child(1) { 
    width: 15% !important; 
}
#special-cards-table th:nth-child(2), #special-cards-table td:nth-child(2) { 
    width: 10% !important; 
    min-width: 100px !important;
}
#special-cards-table th:nth-child(3), #special-cards-table td:nth-child(3) { 
    width: 16% !important; 
}
#special-cards-table th:nth-child(4), #special-cards-table td:nth-child(4) { 
    width: 14% !important; 
}
#special-cards-table th:nth-child(5), #special-cards-table td:nth-child(5) { 
    width: 24% !important; 
}
#special-cards-table th:nth-child(6), #special-cards-table td:nth-child(6) {
    width: 9% !important;
}
#special-cards-table th:nth-child(7), #special-cards-table td:nth-child(7) {
    width: 12% !important;
}


/* Center and resize Special Cards search inputs */
#special-cards-table .header-filter[data-column="name"] {
    width: 85% !important; /* Reduced by 15% from 100% */
    max-width: 85% !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

#special-cards-table .header-filter[data-column="character"] {
    width: 85% !important; /* Reduced by 15% from 100% */
    max-width: 85% !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

#special-cards-table .header-filter[data-column="card_effect"] {
    width: 85% !important; /* Reduced by 15% from 100% */
    max-width: 85% !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Universe: Basic tab - Type filters in 2x2 grid layout */
#basic-universe-table .checkbox-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 16px !important;
    align-items: start !important;
    text-align: left !important;
}

#basic-universe-table .checkbox-group label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.85rem !important;
    font-weight: normal !important;
    white-space: nowrap !important;
    text-align: left !important;
    min-width: 0 !important;
    overflow: hidden !important;
}



/* Events Table Game Effect Search Input Styling */
#events-table .header-filter[data-column="game_effect"] {
    width: 320px !important;
    max-width: 320px !important;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
}
