/* =====================================================================
   IRON PAW CHALLENGE — Events page styles
   Loads alongside ironpaw.css for the design tokens.
   ===================================================================== */

/* ===== Two-column layout: main list + sidebar ===== */
.ip-events-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 14px;
    margin-top: 4px;
}
.ip-events-main { min-width: 0; }
.ip-events-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===== Filters / view-toggle bar ===== */
.ip-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ip-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 4px;
    border: 1px solid var(--ip-border-strong);
    background: rgba(255,255,255,.02);
    color: var(--ip-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s ease;
}
.ip-filter-btn:hover { border-color: var(--ip-gold); color: var(--ip-gold); }
.ip-filter-btn svg { width: 13px; height: 13px; }

.ip-filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,.02) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a839a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 10px center / 14px;
    padding: 9px 32px 9px 14px;
    border-radius: 4px;
    border: 1px solid var(--ip-border-strong);
    color: var(--ip-text-dim);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s ease;
    min-width: 140px;
}
.ip-filter-select:hover { border-color: var(--ip-gold); color: var(--ip-text); }

.ip-view-toggle {
    margin-left: auto;
    display: inline-flex;
    border: 1px solid var(--ip-border-strong);
    border-radius: 4px;
    overflow: hidden;
}
.ip-view-toggle button {
    background: none;
    border: 0;
    padding: 9px 16px;
    color: var(--ip-text-mute);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .2s ease;
}
.ip-view-toggle button svg { width: 13px; height: 13px; }
.ip-view-toggle button.is-active { background: var(--ip-gold); color: #1a1300; }
.ip-view-toggle button:not(.is-active):hover { color: var(--ip-text); }

/* ===== Events list card ===== */
.ip-events-list {
    background: linear-gradient(180deg, var(--ip-surface) 0%, var(--ip-bg-2) 100%);
    border: 1px solid var(--ip-border);
    border-radius: var(--ip-radius-lg);
    overflow: hidden;
    box-shadow: var(--ip-shadow);
}

/* Column header strip */
.ip-events-list__head {
    display: grid;
    grid-template-columns: 100px 1.7fr 100px 1.5fr 70px 90px 1.4fr 18px;
    gap: 12px;
    padding: 10px 14px;
    font-family: var(--ip-mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ip-text-faint);
    border-bottom: 1px solid var(--ip-border);
    align-items: center;
    background: rgba(255,255,255,.012);
}
.ip-events-list__head .sort {
    color: var(--ip-gold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.ip-events-list__head .sort svg { width: 11px; height: 11px; }
.ip-events-list__head .num { text-align: center; }

/* Each event row */
.ip-event-row {
    display: grid;
    grid-template-columns: 100px 1.7fr 100px 1.5fr 70px 90px 1.4fr 18px;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ip-border);
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
    opacity: 0;
    transform: translateY(8px);
    animation: ip-row-in .45s ease forwards;
}
.ip-event-row:nth-child(1) { animation-delay: .02s; }
.ip-event-row:nth-child(2) { animation-delay: .05s; }
.ip-event-row:nth-child(3) { animation-delay: .08s; }
.ip-event-row:nth-child(4) { animation-delay: .11s; }
.ip-event-row:nth-child(5) { animation-delay: .14s; }
.ip-event-row:nth-child(6) { animation-delay: .17s; }
.ip-event-row:nth-child(7) { animation-delay: .20s; }
.ip-event-row:nth-child(8) { animation-delay: .23s; }
.ip-event-row:last-child { border-bottom: 0; }
.ip-event-row:hover {
    background: rgba(255,255,255,.025);
}
.ip-event-row:hover .ip-arrow {
    color: var(--ip-gold);
    transform: translateX(3px);
}

/* Event image cell + type badge */
.ip-event-row__img {
    position: relative;
    width: 100px;
    height: 56px;
    border-radius: var(--ip-radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #2a3552 0%, #14192a 100%);
}
.ip-event-row__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.ip-event-row__img-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ip-text-mute);
    opacity: .35;
}
.ip-event-row__img-icon svg { width: 36px; height: 36px; }

.ip-event-type {
    position: absolute;
    top: 7px; left: 7px;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ip-event-type--major { background: rgba(167, 109, 250, 0.7); }
.ip-event-type--open  { background: rgba(74, 144, 226, 0.7); }
.ip-event-type--cup   { background: rgba(91, 192, 222, 0.7); }
.ip-event-type--local { background: rgba(244, 181, 60, 0.7); color: #1a1300; }

/* Event name + subtype */
.ip-event-row__name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.25;
}
.ip-event-row__sub {
    font-family: var(--ip-mono);
    font-size: 10px;
    color: var(--ip-text-faint);
    letter-spacing: 0.06em;
    margin-top: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Date / location cells */
.ip-event-row__date {
    font-size: 13px;
    font-weight: 700;
    color: var(--ip-text);
}

.ip-event-row__loc {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ip-text-dim);
    line-height: 1.25;
}

/* Discipline / participant number cells */
.ip-event-row__num {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--ip-text);
    font-variant-numeric: tabular-nums;
}

/* Winner cell */
.ip-event-row__winner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.ip-event-row__winner .ip-dog-avatar {
    width: 40px; height: 40px;
    flex: 0 0 40px;
}
.ip-event-row__winner-text { min-width: 0; }
.ip-event-row__winner-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}
.ip-event-row__winner-score {
    color: var(--ip-gold);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.ip-event-row__winner-label {
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ip-text-mute);
    font-weight: 700;
    margin-top: 2px;
}

/* Load more footer */
.ip-events-list__footer {
    padding: 16px;
    display: grid;
    place-items: center;
}

/* ===== Host-an-event CTA card ===== */
.ip-host-cta {
    margin-top: 18px;
    background: linear-gradient(180deg, var(--ip-surface) 0%, var(--ip-bg-2) 100%);
    border: 1px solid var(--ip-border);
    border-radius: var(--ip-radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.ip-host-cta__icon {
    width: 44px; height: 44px;
    border-radius: var(--ip-radius-sm);
    background: var(--ip-gold-soft);
    color: var(--ip-gold);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.ip-host-cta__icon svg { width: 22px; height: 22px; }
.ip-host-cta__text {
    flex: 1;
    min-width: 0;
}
.ip-host-cta__title {
    font-weight: 800;
    font-size: 15px;
}
.ip-host-cta__sub {
    color: var(--ip-text-mute);
    font-size: 13px;
    margin-top: 2px;
}
.ip-host-cta__btn {
    background: none;
    border: 1px solid rgba(244,181,60,.55);
    color: var(--ip-gold);
    padding: 10px 18px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all .2s ease;
    white-space: nowrap;
}
.ip-host-cta__btn:hover { background: var(--ip-gold-soft); }
.ip-host-cta__btn svg { width: 13px; height: 13px; }

/* ===== Sidebar cards ===== */
.ip-stat-card {
    background: linear-gradient(180deg, var(--ip-surface) 0%, var(--ip-bg-2) 100%);
    border: 1px solid var(--ip-border);
    border-radius: var(--ip-radius);
    padding: 12px 14px;
}
.ip-stat-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.ip-stat-card__head svg { width: 16px; height: 16px; color: var(--ip-gold); }
.ip-stat-card__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Rows in stat card */
.ip-stat-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    color: var(--ip-text-dim);
    font-size: 13px;
}
.ip-stat-card__row .label {
    font-family: var(--ip-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ip-text-faint);
    font-weight: 500;
}
.ip-stat-card__row .value {
    font-weight: 800;
    font-size: 14px;
    color: var(--ip-text);
    font-variant-numeric: tabular-nums;
}

/* Event-type list (colored dots) */
.ip-stat-card__type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    color: var(--ip-text-dim);
    font-size: 13px;
}
.ip-stat-card__type-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.ip-stat-card__dot {
    width: 9px; height: 9px;
    border-radius: 50%;
}
.ip-stat-card__type .value {
    font-weight: 800;
    color: var(--ip-text);
    font-variant-numeric: tabular-nums;
}

/* Years list */
.ip-stat-card__year {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--ip-border);
    font-size: 13px;
    cursor: pointer;
    transition: color .2s ease;
}
.ip-stat-card__year:last-of-type { border-bottom: 0; }
.ip-stat-card__year:hover .year-label { color: var(--ip-gold); }
.ip-stat-card__year .year-label { color: var(--ip-text-dim); font-weight: 600; }
.ip-stat-card__year .year-count { color: var(--ip-text); font-weight: 800; font-variant-numeric: tabular-nums; }

.ip-stat-card__viewall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--ip-text-mute);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s ease;
}
.ip-stat-card__viewall:hover { color: var(--ip-gold); }
.ip-stat-card__viewall svg { width: 12px; height: 12px; }

/* Upcoming highlight card */
.ip-highlight-card {
    background: linear-gradient(180deg, var(--ip-surface) 0%, var(--ip-bg-2) 100%);
    border: 1px solid var(--ip-border);
    border-radius: var(--ip-radius);
    overflow: hidden;
}
.ip-highlight-card__head {
    padding: 14px 16px 0;
}
.ip-highlight-card__title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.ip-highlight-card__body {
    display: flex;
    align-items: stretch;
    padding: 14px 16px 16px;
    gap: 12px;
}
.ip-highlight-card__img {
    width: 90px; height: 100px;
    border-radius: var(--ip-radius-sm);
    background: linear-gradient(135deg, #2a3552 0%, #14192a 100%);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: var(--ip-text-mute);
    overflow: hidden;
}
.ip-highlight-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ip-highlight-card__img svg { width: 36px; height: 36px; opacity: .4; }
.ip-highlight-card__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.ip-highlight-card__name {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.15;
    text-transform: uppercase;
}
.ip-highlight-card__meta {
    font-size: 11.5px;
    color: var(--ip-text-dim);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ip-highlight-card__meta svg { width: 11px; height: 11px; color: var(--ip-gold); }
.ip-highlight-card__btn {
    margin: 0 16px 16px;
    width: calc(100% - 32px);
    background: none;
    border: 1px solid rgba(244,181,60,.55);
    color: var(--ip-gold);
    padding: 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all .2s ease;
}
.ip-highlight-card__btn:hover { background: var(--ip-gold-soft); }
.ip-highlight-card__btn svg { width: 12px; height: 12px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .ip-events-layout { grid-template-columns: 1fr; }
    .ip-events-list__head,
    .ip-event-row {
        grid-template-columns: 80px 1fr 90px 100px 60px 60px 130px 18px;
        gap: 8px;
        padding: 12px 14px;
    }
    .ip-event-row__img { width: 80px; height: 50px; }
}
@media (max-width: 760px) {
    .ip-events-list__head { display: none; }
    .ip-event-row {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "img name"
            "img meta"
            "winner winner";
        gap: 8px;
        padding: 12px;
    }
    .ip-event-row__img { grid-area: img; }
    .ip-event-row__name-cell { grid-area: name; }
    .ip-event-row__date,
    .ip-event-row__loc,
    .ip-event-row__num { display: none; }
    .ip-event-row__winner { grid-area: winner; border-top: 1px solid var(--ip-border); padding-top: 10px; }
    .ip-host-cta { flex-direction: column; text-align: center; }
    .ip-host-cta__btn { width: 100%; justify-content: center; }
}
