/* SSv5 Webpage Enhancements v0.7.5 */
/* ── Meet Tools Styles ── */

/* Search box in sidebar */
.mt-search-wrap {
    padding: 0.5rem 0.75rem;
    position: relative;
}

.mt-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #535362;
    border-radius: 6px;
    background: #313143;
    color: inherit;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.mt-search-input::placeholder {
    color: #8d8d97;
    font-size: 0.85rem;
}

.mt-search-input:focus {
    border-color: #8d8d97;
    background: #3c3c4d;
}

/* Autocomplete dropdown */
.mt-autocomplete {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    top: 100%;
    background: var(--brand-primary, #1a1a2e);
    border: 1px solid #484858;
    border-radius: 0 0 6px 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.mt-autocomplete.active {
    display: block;
}

.mt-autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid #2c2c3f;
    transition: background 0.15s;
}

.mt-autocomplete-item:last-child {
    border-bottom: none;
}

.mt-autocomplete-item:hover,
.mt-autocomplete-item.active {
    background: #3c3c4d;
}

.mt-autocomplete-age {
    opacity: 0.6;
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

/* Sidebar nav buttons for tools */
.mt-sidebar-tools {
    padding: 0.25rem 0.75rem 0.5rem;
}

.mt-sidebar-tools .mt-overlay-toggle {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.mt-sidebar-btn {
    display: block;
    width: 100%;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.3rem;
    background: #2c2c3f;
    color: inherit;
    border: 1px solid #353547;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.mt-sidebar-btn:hover {
    background: #434354;
}

.mt-sidebar-btn-icon {
    margin-right: 0.4rem;
}

/* ── Swimmer Card ── */
.mt-swimmer-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.mt-swimmer-header-card {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.mt-swimmer-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    text-align: left;
}

.mt-swimmer-meta {
    font-size: 0.9rem;
    color: #666;
}

.mt-swimmer-meta span {
    margin-right: 1rem;
}

/* Schedule card (where am I swimming) */
.mt-schedule {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mt-schedule-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--brand-primary, #1a1a2e);
    font-size: 0.95rem;
}

.mt-schedule-event-num {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-primary, #1a1a2e);
    min-width: 2.5rem;
}

.mt-schedule-detail {
    flex: 1;
}

.mt-schedule-event-name {
    font-weight: 600;
}

.mt-schedule-heat-lane {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.15rem;
}

.mt-schedule-time {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
}

/* Tables generated by meet-tools use SPORTSYSTEMS t2/t1/t4 classes for branding */
.mt-swimmer-card table,
.mt-stats table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

/* Time difference badges */
.mt-diff {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.mt-diff-faster {
    background: #d4edda;
    color: #155724;
}

.mt-diff-slower {
    background: #f8d7da;
    color: #721c24;
}

.mt-diff-even {
    background: #e2e3e5;
    color: #383d41;
}

.mt-status-dnc,
.mt-status-dns,
.mt-status-dq {
    color: #999;
    font-style: italic;
}

/* Splits toggle */
.mt-splits-toggle {
    font-size: 0.75rem;
    color: var(--brand-primary, #1a1a2e);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}

.mt-splits-row td {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.75rem;
    color: #777;
    border-bottom: 1px solid #eee;
}

/* ── Statistics Dashboard ── */
.mt-stats {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.mt-stats h2 {
    margin: 0 0 1rem;
}

.mt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mt-stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.mt-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary, #1a1a2e);
    line-height: 1.1;
}

.mt-stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.mt-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: #333;
}

.mt-show-more {
    display: block;
    margin: 0.5rem auto 1.5rem;
    padding: 0.4rem 1.2rem;
    background: var(--brand-primary, #1a1a2e);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
}

.mt-show-more:hover {
    opacity: 0.85;
}

/* ── Entry vs Result overlay on results pages ── */
.mt-overlay-toggle {
    display: inline-block;
    margin: 0.5rem 0 1rem;
    padding: 0.4rem 0.8rem;
    background: var(--brand-primary, #1a1a2e);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
}

.mt-overlay-toggle:hover {
    opacity: 0.85;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .mt-swimmer-name {
        font-size: 1.25rem;
    }

    .mt-schedule-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .mt-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-stat-value {
        font-size: 1.5rem;
    }
}
