/* ========================================
   YABAAA — BREEDS TABLE PAGE
   breeds-table.css  |  companion to styles.css
   ======================================== */

/* -----------------------------------------------------------------------
   CSS CUSTOM PROPERTIES
   Extends the Yabaaa design system; does not override styles.css.
----------------------------------------------------------------------- */
:root {
    /* Yabaaa core — mirrors styles.css usage */
    --bt-navy:          #1A3A52;
    --bt-blue:          #2C5F8D;
    --bt-green:         #2A6B47;
    --bt-green-bg:      #D6EFE0;
    --bt-border:        #B8CFE6;
    --bt-border-lt:     #E5E7EB;
    --bt-bg-page:       #FAFAFA;
    --bt-bg-alt:        #F3F7FB;
    --bt-text:          #1F2937;
    --bt-text-muted:    #6B7280;

    /* Earthy warmth — complements without clashing */
    --bt-sand:          #C9A97A;
    --bt-sand-light:    #F0E4D0;
    --bt-sand-bg:       #F7F1E8;
    --bt-terra:         #B85C38;
    --bt-terra-light:   #D97B56;

    /* Semantic status */
    --bt-pos-bg:        #ECFDF5;
    --bt-pos-text:      #166534;
    --bt-pos-border:    #BBF7D0;

    --bt-mid-bg:        #FFFBEB;
    --bt-mid-text:      #92400E;
    --bt-mid-border:    #FDE68A;

    --bt-neg-bg:        #FEF2F2;
    --bt-neg-text:      #991B1B;
    --bt-neg-border:    #FECACA;

    --bt-neutral-bg:    #F1F5F9;
    --bt-neutral-text:  #475569;
    --bt-neutral-border:#CBD5E1;

    /* Layout */
    --bt-max-width:     1400px;
    --bt-nav-height:    50px;   /* matches nav li height in styles.css */
}

/* -----------------------------------------------------------------------
   PAGE INTRO SECTION
----------------------------------------------------------------------- */
.breeds-page-intro {
    padding: 2rem 2rem 1.5rem;
    background: white;
}

.breeds-page-intro p {
    max-width: 860px;
    color: var(--bt-text-muted);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 0;
    text-align: left;
}

.breeds-stats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bt-border-lt);
}

.breeds-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--bt-text-muted);
    font-family: 'Inter', sans-serif;
}

.breeds-stat strong {
    color: var(--bt-navy);
    font-weight: 700;
    font-size: 1.05rem;
}

.breeds-stat svg {
    width: 16px;
    height: 16px;
    stroke: var(--bt-green);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   GROUPS ACCORDION
----------------------------------------------------------------------- */
.breeds-groups-section {
    padding: 0 2rem 1rem;
    background: white;
    border-bottom: 1px solid var(--bt-border-lt);
}

.breeds-groups-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: 1px solid var(--bt-border);
    border-radius: 6px;
    padding: 0.55rem 1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bt-navy);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin-bottom: 0;
}

.breeds-groups-toggle:hover {
    background-color: var(--bt-bg-alt);
    color: var(--bt-blue);
}

.breeds-groups-toggle svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.breeds-groups-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.breeds-groups-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.breeds-groups-grid.is-open {
    display: grid;
}

.breeds-group-card {
    background: var(--bt-sand-bg);
    border: 1px solid var(--bt-sand-light);
    border-left: 4px solid var(--bt-sand);
    border-radius: 6px;
    padding: 0.875rem 1rem;
    transition: box-shadow 0.2s;
}

.breeds-group-card:hover {
    box-shadow: 0 2px 10px rgba(26, 58, 82, 0.1);
}

.breeds-group-card__name {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--bt-navy);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.breeds-group-card__desc {
    font-size: 0.82rem;
    color: var(--bt-text-muted);
    line-height: 1.5;
    font-style: italic;
}

/* -----------------------------------------------------------------------
   FILTER BAR — sticky, sits below nav (top = nav height)
----------------------------------------------------------------------- */
.breeds-filter-bar {
    position: sticky;
    top: var(--bt-nav-height);
    z-index: 900;
    background-color: var(--bt-navy);
    border-bottom: 3px solid var(--bt-sand);
    box-shadow: 0 4px 16px rgba(26, 58, 82, 0.25);
}

.filter-bar__inner {
    max-width: var(--bt-max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

/* Search */
.filter-bar__search {
    position: relative;
    flex: 0 1 220px;
    min-width: 160px;
}

.filter-bar__search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    stroke: rgba(255, 255, 255, 0.5);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
    flex-shrink: 0;
}

.filter-bar__input {
    width: 100%;
    padding: 0.48rem 0.65rem 0.48rem 2.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    transition: background-color 0.2s, border-color 0.2s;
}

.filter-bar__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.filter-bar__input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--bt-sand);
}

/* Selects */
.filter-bar__select {
    padding: 0.48rem 2rem 0.48rem 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    min-width: 120px;
    transition: background-color 0.2s, border-color 0.2s;
}

.filter-bar__select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.18);
    border-color: var(--bt-sand);
}

.filter-bar__select option {
    background-color: var(--bt-navy);
    color: white;
}

/* Divider */
.filter-bar__divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* Results count */
.filter-bar__count {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    margin-left: auto;
}

.filter-bar__count strong {
    color: var(--bt-sand);
    font-weight: 700;
}

/* Reset button */
.filter-bar__reset {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: var(--bt-terra);
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.filter-bar__reset:hover {
    background: var(--bt-terra-light);
}

.filter-bar__reset svg {
    width: 12px;
    height: 12px;
    stroke: white;
    fill: none;
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   TABLE SECTION WRAPPER
----------------------------------------------------------------------- */
.breeds-table-section {
    padding: 1.25rem 1.5rem 3rem;
    background: var(--bt-bg-page);
}

.breeds-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(26, 58, 82, 0.1);
    border: 1px solid var(--bt-border);
    background: white;

    /* Smooth horizontal scroll on mobile */
    -webkit-overflow-scrolling: touch;

    /* Always show scrollbar so users know the table is scrollable */
    scrollbar-width: thin;               /* Firefox */
    scrollbar-color: var(--bt-blue) var(--bt-bg-alt);  /* Firefox */
}

/* Scrollbar styling — Webkit/Blink */
.breeds-table-scroll::-webkit-scrollbar {
    height: 8px;
}
.breeds-table-scroll::-webkit-scrollbar-track {
    background: var(--bt-bg-alt);
    border-radius: 4px;
}
.breeds-table-scroll::-webkit-scrollbar-thumb {
    background: var(--bt-blue);
    border-radius: 4px;
}
.breeds-table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--bt-blue-dark, #1a3a52);
}

/* -----------------------------------------------------------------------
   TABLE
----------------------------------------------------------------------- */
.breeds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--bt-text);
}

/* HEADER */
.breeds-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.breeds-table th {
    background-color: var(--bt-navy);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.85rem 0.9rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: color 0.15s, background-color 0.15s;
}

.breeds-table th:last-child {
    border-right: none;
}

.breeds-table th:hover {
    color: var(--bt-sand);
    background-color: #1e4462;
}

/* Sort indicator */
.bt-sort-icon {
    display: inline-block;
    margin-left: 0.3rem;
    opacity: 0.3;
    font-size: 0.7rem;
    vertical-align: middle;
    transition: opacity 0.15s;
}

.breeds-table th[data-sort="asc"] .bt-sort-icon,
.breeds-table th[data-sort="desc"] .bt-sort-icon {
    opacity: 1;
    color: var(--bt-sand);
}

/* BODY CELLS */
.breeds-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--bt-border-lt);
    border-right: 1px solid var(--bt-border-lt);
    vertical-align: middle;
    transition: background-color 0.1s;
}

.breeds-table td:last-child {
    border-right: none;
}

.breeds-table tbody tr:last-child td {
    border-bottom: none;
}

/* Alternating rows */
.breeds-table tbody tr:nth-child(even) td {
    background-color: var(--bt-bg-alt);
}

/* Row hover */
.breeds-table tbody tr:hover td {
    background-color: var(--bt-sand-bg);
    cursor: pointer;
}

/* BREED NAME LINK */
.breed-name-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--bt-navy);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.breed-name-link:hover {
    color: var(--bt-terra);
    text-decoration: underline;
}

/* Origin & other text cells */
.bt-origin {
    color: var(--bt-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.bt-text-sm {
    font-size: 0.79rem;
    color: var(--bt-text-muted);
    line-height: 1.4;
}

/* Empty value */
.bt-empty {
    color: var(--bt-border);
    font-style: italic;
    font-size: 0.8rem;
}

/* -----------------------------------------------------------------------
   TAGS / BADGES
   BEM: .bt-tag  +  modifier
----------------------------------------------------------------------- */
.bt-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.71rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.6;
    border: 1px solid transparent;
}

/* Size */
.bt-tag--size-small   { background: var(--bt-pos-bg);     color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--size-medium  { background: var(--bt-mid-bg);     color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--size-large   { background: #EFF6FF;              color: #1D4ED8;                border-color: #BFDBFE; }
.bt-tag--size-giant   { background: #F5F3FF;              color: #5B21B6;                border-color: #DDD6FE; }

/* Energy */
.bt-tag--energy-low    { background: var(--bt-pos-bg);    color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--energy-medium { background: var(--bt-mid-bg);    color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--energy-high   { background: var(--bt-neg-bg);    color: var(--bt-neg-text);     border-color: var(--bt-neg-border); }

/* Trainability */
.bt-tag--train-easy     { background: var(--bt-pos-bg);   color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--train-moderate { background: var(--bt-mid-bg);   color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--train-difficult{ background: var(--bt-neg-bg);   color: var(--bt-neg-text);     border-color: var(--bt-neg-border); }

/* Yes / Sometimes / No */
.bt-tag--yes       { background: var(--bt-pos-bg);        color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--sometimes { background: var(--bt-mid-bg);        color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--no        { background: var(--bt-neg-bg);        color: var(--bt-neg-text);     border-color: var(--bt-neg-border); }

/* Grooming / Shedding */
.bt-tag--level-low  { background: var(--bt-pos-bg);       color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--level-med  { background: var(--bt-mid-bg);       color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--level-high { background: var(--bt-neg-bg);       color: var(--bt-neg-text);     border-color: var(--bt-neg-border); }

/* Confidence */
.bt-tag--conf-high   { background: var(--bt-pos-bg);      color: var(--bt-pos-text);     border-color: var(--bt-pos-border); }
.bt-tag--conf-medium { background: var(--bt-mid-bg);      color: var(--bt-mid-text);     border-color: var(--bt-mid-border); }
.bt-tag--conf-low    { background: var(--bt-neg-bg);      color: var(--bt-neg-text);     border-color: var(--bt-neg-border); }

/* Neutral tag — for breed_type, recognition_status */
.bt-tag--neutral {
    background: var(--bt-neutral-bg);
    color: var(--bt-neutral-text);
    border-color: var(--bt-neutral-border);
}

/* -----------------------------------------------------------------------
   NO RESULTS MESSAGE
----------------------------------------------------------------------- */
.breeds-no-results {
    display: none;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--bt-text-muted);
    font-style: italic;
    font-size: 1rem;
    background: white;
    border-top: 1px solid var(--bt-border-lt);
}

.breeds-no-results svg {
    display: block;
    margin: 0 auto 1rem;
    width: 40px;
    height: 40px;
    stroke: var(--bt-border);
    fill: none;
    stroke-width: 1.5;
}

/* -----------------------------------------------------------------------
   LIFE EXPECTANCY — subtle formatting
----------------------------------------------------------------------- */
.bt-lifespan {
    font-size: 0.8rem;
    color: var(--bt-text);
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
   TABLE COLUMN WIDTH HINTS
   Prevents columns from collapsing too narrow
----------------------------------------------------------------------- */
.bt-col-breed    { min-width: 150px; }
.bt-col-type     { min-width: 130px; }
.bt-col-group    { min-width: 180px; }
.bt-col-status   { min-width: 160px; }
.bt-col-origin   { min-width: 110px; }
.bt-col-size     { min-width: 80px;  }
.bt-col-energy   { min-width: 85px;  }
.bt-col-train    { min-width: 100px; }
.bt-col-children { min-width: 80px;  }
.bt-col-apart    { min-width: 90px;  }
.bt-col-groom    { min-width: 90px;  }
.bt-col-shed     { min-width: 90px;  }
.bt-col-life     { min-width: 120px; }
.bt-col-conf     { min-width: 90px;  }

/* -----------------------------------------------------------------------
   RESPONSIVE
----------------------------------------------------------------------- */

/* Large screens: give group text room to breathe */
@media (min-width: 1200px) {
    .breeds-table {
        font-size: 0.85rem;
    }
}

/* Tablet: wrap filter bar */
@media (max-width: 1024px) {
    .filter-bar__inner {
        gap: 0.5rem;
    }
    .filter-bar__search {
        flex: 0 1 180px;
    }
    .filter-bar__select {
        min-width: 100px;
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .breeds-page-intro {
        padding: 1.5rem 1rem 1rem;
    }

    .breeds-groups-section {
        padding: 0 1rem 1rem;
    }

    .breeds-groups-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar__inner {
        padding: 0.6rem 1rem;
        gap: 0.45rem;
    }

    .filter-bar__search {
        flex: 1 1 100%;
    }

    .filter-bar__select {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .filter-bar__divider {
        display: none;
    }

    .filter-bar__count {
        margin-left: 0;
        flex: 1 1 100%;
        order: -1;
        text-align: right;
    }

    .filter-bar__reset {
        flex: 0 0 auto;
    }

    .breeds-table-section {
        padding: 1rem 0.75rem 2.5rem;
    }

    .breeds-stats-strip {
        gap: 0.85rem;
    }
}

@media (max-width: 480px) {
    .filter-bar__select {
        flex: 1 1 100%;
    }
}

/* -----------------------------------------------------------------------
   STICKY HORIZONTAL SCROLLBAR MIRROR
   Fixed at viewport bottom — always visible when table is on screen.
   Synced bidirectionally with .breeds-table-scroll via JS.
----------------------------------------------------------------------- */
.breeds-scroll-mirror {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background-color: var(--bt-navy);
    border-top: 3px solid var(--bt-sand);
    box-shadow: 0 -6px 24px rgba(26, 58, 82, 0.45);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.breeds-scroll-mirror--hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}

/* Label strip: arrows + instructional text */
.breeds-scroll-mirror__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem 0.2rem;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Inter', sans-serif;
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

.breeds-scroll-mirror__hint svg {
    width: 13px;
    height: 13px;
    stroke: var(--bt-sand);
    fill: none;
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* The actual scrollable track — tall enough to grab on touch */
.breeds-scroll-mirror__track {
    overflow-x: auto;
    overflow-y: hidden;
    height: 22px;
    scrollbar-width: auto;
    scrollbar-color: var(--bt-sand) rgba(255, 255, 255, 0.1);
    cursor: grab;
}

.breeds-scroll-mirror__track:active {
    cursor: grabbing;
}

/* Webkit scrollbar — chunky, coloured thumb */
.breeds-scroll-mirror__track::-webkit-scrollbar {
    height: 22px;
}

.breeds-scroll-mirror__track::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0;
}

.breeds-scroll-mirror__track::-webkit-scrollbar-thumb {
    background: var(--bt-sand);
    border-radius: 11px;
    border: 5px solid var(--bt-navy);
    min-width: 60px;
}

.breeds-scroll-mirror__track::-webkit-scrollbar-thumb:hover {
    background: var(--bt-terra-light);
}

/* Inner spacer — width set by JS to match table scrollWidth */
.breeds-scroll-mirror__inner {
    height: 1px;
    /* width applied via JS */
}

/* Progress indicator — thin accent line showing scroll position */
.breeds-scroll-mirror__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--bt-terra);
    width: 0%;
    pointer-events: none;
    transition: width 0.05s linear;
}

/* -----------------------------------------------------------------------
   PRINT — hide interactive chrome
----------------------------------------------------------------------- */
@media print {
    .breeds-filter-bar,
    .breeds-groups-toggle,
    .breeds-table th .bt-sort-icon,
    .breeds-scroll-mirror {
        display: none !important;
    }

    .breeds-table-scroll {
        overflow: visible;
        box-shadow: none;
        border: none;
    }

    .breeds-table td,
    .breeds-table th {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
}

/* -----------------------------------------------------------------------
   seo-intro  , table-intro
----------------------------------------------------------------------- */

.seo-intro{
max-width:720px;
font-size:1.05rem;
line-height:1.6;
margin:10px auto 18px;
color:#f5f5f5;
}

.table-intro{
max-width:800px;
margin:20px auto 30px;
font-size:1rem;
line-height:1.6;
color:#444;
}

.breed-link {
  color: #1A3A52;
  text-decoration: none;
  font-weight: 600;
}

.breed-link:hover {
  text-decoration: underline;
}
