/* Unicorn Tables Public Styles */

/* ===========================
   Base / Wrapper
   =========================== */

.unicorn-table {
    margin: 20px 0;
}

.unicorn-table-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* ===========================
   Table Element
   =========================== */

.unicorn-table-wrapper {
    overflow-x: auto;
}

.unicorn-table-element {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.unicorn-table-element th,
.unicorn-table-element td {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.unicorn-table-element thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
}

.unicorn-table-element tfoot td {
    background-color: #f8f9fa;
    font-weight: 500;
}

.unicorn-table-element tbody tr:hover {
    background-color: #f5f5f5;
}

.column-active {
    background-color: #e8f0fe !important;
    font-weight: 600;
}

/* ===========================
   Ratings
   =========================== */

.unicorn-table .rating {
    color: #ffa500;
    font-size: 1.2em;
    letter-spacing: 1px;
}

.unicorn-table .eric-rating {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.unicorn-table .eric-image {
    width: 24px;
    height: auto;
}

/* ===========================
   Boolean Values
   =========================== */

.unicorn-table .yes {
    color: #00a32a;
    font-weight: 600;
}

.unicorn-table .no {
    color: #d63638;
    font-weight: 600;
}

/* ===========================
   Card Components (tablet/mobile)
   =========================== */

.unicorn-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.unicorn-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.unicorn-card-full {
    height: 100%;
}

.unicorn-card-body {
    padding: 20px;
}

.unicorn-card-title {
    margin: 0 0 10px 0;
    font-size: 1.15em;
    font-weight: 600;
}

.unicorn-card-text {
    margin: 5px 0;
    line-height: 1.5;
}

/* ===========================
   Row Layout (tablet cards)
   =========================== */

.unicorn-table-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.unicorn-table-col {
    min-width: 0;
}

/* ===========================
   Pricing Table
   Matches theme's table.responsive styling:
     - Headers: #3f4860 (ny-blue-light) with white text
     - Strikethrough (del): ny-blue-light color
     - Border-radius, separate borders
   =========================== */

.unicorn-table-pricing .unicorn-table-element {
    border-radius: 1rem;
    border-collapse: separate !important;
    border-spacing: 0;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

/* Remove cell borders — outer border on table is sufficient */
.unicorn-table-pricing .unicorn-table-element th,
.unicorn-table-pricing .unicorn-table-element td {
    border: none;
}

.unicorn-table-pricing .unicorn-table-element thead th {
    background-color: #3f4860;
    color: #fff;
    font-weight: 600;
}

/* First row header cells: rounded top corners */
.unicorn-table-pricing .unicorn-table-element thead tr:first-child th:first-child {
    border-top-left-radius: 1rem;
}
.unicorn-table-pricing .unicorn-table-element thead tr:first-child th:last-child {
    border-top-right-radius: 1rem;
}

.unicorn-table-pricing .unicorn-table-element tbody td del {
    color: #3f4860;
}

/* Explicit striping — reset Bootstrap's --bs-table-bg-type variable */
.unicorn-table-pricing .unicorn-table-element tbody tr:nth-child(odd) td {
    --bs-table-bg-type: #f8f9fa;
    background-color: #f8f9fa;
}
.unicorn-table-pricing .unicorn-table-element tbody tr:nth-child(even) td {
    --bs-table-bg-type: #fff;
    background-color: #fff;
}

/* Last row: rounded bottom corners */
.unicorn-table-pricing .unicorn-table-element tbody tr:last-child td:first-child,
.unicorn-table-pricing .unicorn-table-element tfoot tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}
.unicorn-table-pricing .unicorn-table-element tbody tr:last-child td:last-child,
.unicorn-table-pricing .unicorn-table-element tfoot tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* ===========================
   Comparison Table
   Matches theme's .vo-comparison styling:
     - Headers: #cc081c (ny-red) with white text
     - First column header: transparent (label column)
     - Alternating column backgrounds
     - Fixed table layout, border-radius
   =========================== */

.unicorn-table-comparison .unicorn-table-element {
    table-layout: fixed;
    border-radius: 1rem;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
}

.unicorn-table-comparison .unicorn-table-element th,
.unicorn-table-comparison .unicorn-table-element td {
    text-align: center;
    vertical-align: middle;
}

/* First column (labels) left-aligned */
.unicorn-table-comparison .unicorn-table-element th:first-child,
.unicorn-table-comparison .unicorn-table-element td:first-child {
    text-align: left;
}

/* Header: red background for product columns */
.unicorn-table-comparison .unicorn-table-element thead th {
    background-color: #cc081c;
    color: #fff;
    font-weight: 600;
    padding: 12px;
}

/* First header cell (empty/label): transparent */
.unicorn-table-comparison .unicorn-table-element thead th:first-child {
    background-color: transparent;
    color: inherit;
}

/* White separator borders between header columns */
.unicorn-table-comparison .unicorn-table-element thead th:nth-child(odd) {
    border-left: #fff 3px solid;
    border-right: #fff 3px solid;
}

/* First row top corners */
.unicorn-table-comparison .unicorn-table-element thead tr:first-child th:first-child {
    border-top-left-radius: 1rem;
}
.unicorn-table-comparison .unicorn-table-element thead tr:first-child th:last-child {
    border-top-right-radius: 1rem;
}

/* Body: alternating column backgrounds */
.unicorn-table-comparison .unicorn-table-element tbody td:nth-child(even) {
    background-color: #f0f3f6;
}

.unicorn-table-comparison .unicorn-table-element tbody td:nth-child(odd) {
    background-color: #fff;
    padding-left: calc(.5rem + 3px);
    padding-right: calc(.5rem + 3px);
}

.unicorn-table-comparison .unicorn-table-element tbody td {
    border-bottom: 1px solid #d4d9e3;
    font-size: 0.875em;
}

/* Last body row: no bottom border, rounded corners */
.unicorn-table-comparison .unicorn-table-element tbody tr:last-child td {
    border-bottom: 0;
}
.unicorn-table-comparison .unicorn-table-element tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}
.unicorn-table-comparison .unicorn-table-element tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* Images in comparison table: rounded, max-width */
.unicorn-table-comparison .unicorn-table-element img {
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

/* Header images (compare-image class on th) */
.unicorn-table-comparison .unicorn-table-element thead th img {
    max-width: 100%;
    border-radius: 0;
}

/* ===========================
   Overview Table
   General-purpose info table with green header.
   Used for feature lists, summaries, informational content.
   =========================== */

.unicorn-table-overview .unicorn-table-element {
    border-radius: 1rem;
    border-collapse: separate !important;
    border-spacing: 0;
}

.unicorn-table-overview .unicorn-table-element thead th {
    background-color: #1a8931;
    color: #fff;
    font-weight: 600;
}

.unicorn-table-overview .unicorn-table-element thead tr:first-child th:first-child {
    border-top-left-radius: 1rem;
}
.unicorn-table-overview .unicorn-table-element thead tr:first-child th:last-child {
    border-top-right-radius: 1rem;
}

.unicorn-table-overview .unicorn-table-element tbody tr:nth-child(odd) td {
    background-color: #f8f9fa;
}
.unicorn-table-overview .unicorn-table-element tbody tr:nth-child(even) td {
    background-color: #fff;
}

.unicorn-table-overview .unicorn-table-element tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}
.unicorn-table-overview .unicorn-table-element tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* ===========================
   Schedule Table
   Compact table for timetables, routes, flights.
   Blue header matching theme's table.responsive style.
   =========================== */

.unicorn-table-schedule .unicorn-table-element {
    border-radius: 1rem;
    border-collapse: separate !important;
    border-spacing: 0;
}

.unicorn-table-schedule .unicorn-table-element thead th {
    background-color: #3f4860;
    color: #fff;
    font-weight: 600;
    padding: 8px 12px;
    font-size: 0.9em;
}

.unicorn-table-schedule .unicorn-table-element thead tr:first-child th:first-child {
    border-top-left-radius: 1rem;
}
.unicorn-table-schedule .unicorn-table-element thead tr:first-child th:last-child {
    border-top-right-radius: 1rem;
}

.unicorn-table-schedule .unicorn-table-element tbody td {
    padding: 8px 12px;
    font-size: 0.9em;
    border-bottom: 1px solid #e9ecef;
}

.unicorn-table-schedule .unicorn-table-element tbody td del {
    color: #3f4860;
}

.unicorn-table-schedule .unicorn-table-element tbody tr:nth-child(odd) td {
    background-color: #f8f9fa;
}
.unicorn-table-schedule .unicorn-table-element tbody tr:nth-child(even) td {
    background-color: #fff;
}

.unicorn-table-schedule .unicorn-table-element tbody tr:last-child td {
    border-bottom: none;
}
.unicorn-table-schedule .unicorn-table-element tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}
.unicorn-table-schedule .unicorn-table-element tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* ===========================
   Key-Value Table
   Two-column layout with bold key column.
   Clean, minimal look for specifications and details.
   =========================== */

.unicorn-table-key-value .unicorn-table-element {
    border-radius: 1rem;
    border-collapse: separate !important;
    border-spacing: 0;
}

.unicorn-table-key-value .unicorn-table-element thead th {
    background-color: #2C354B;
    color: #fff;
    font-weight: 600;
}

.unicorn-table-key-value .unicorn-table-element thead tr:first-child th:first-child {
    border-top-left-radius: 1rem;
}
.unicorn-table-key-value .unicorn-table-element thead tr:first-child th:last-child {
    border-top-right-radius: 1rem;
}

/* First column (keys): bold, slightly tinted background */
.unicorn-table-key-value .unicorn-table-element tbody td:first-child {
    font-weight: 600;
    background-color: #f0f3f6;
    white-space: nowrap;
}

.unicorn-table-key-value .unicorn-table-element tbody td {
    border-bottom: 1px solid #e9ecef;
}

.unicorn-table-key-value .unicorn-table-element tbody tr:last-child td {
    border-bottom: none;
}
.unicorn-table-key-value .unicorn-table-element tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1rem;
}
.unicorn-table-key-value .unicorn-table-element tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1rem;
}

/* ===========================
   Mobile (Accordion)
   =========================== */

.unicorn-table-mobile .accordion-button {
    font-weight: 600;
}

.unicorn-table-mobile .accordion-body > div {
    padding: 5px 0;
}

/* ===========================
   Tablet (Cards)
   =========================== */

.unicorn-table-tablet .unicorn-card {
    height: 100%;
}

/* ===========================
   Lists
   =========================== */

.unicorn-list {
    padding-left: 20px;
    margin: 0;
}

.unicorn-list li {
    padding: 2px 0;
}

/* ===========================
   Images
   =========================== */

.unicorn-img-responsive {
    max-width: 100%;
    height: auto;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
    .unicorn-table .unicorn-table-wrapper {
        border: none;
    }

    .unicorn-table-row {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    .unicorn-table {
        page-break-inside: avoid;
    }

    .unicorn-table-mobile .accordion-button::after {
        display: none;
    }

    .unicorn-table-mobile .accordion-collapse {
        display: block !important;
    }

    .unicorn-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
