/* =========================================
   Sports-DB — Custom Styles (Bootstrap 5 override)
   ========================================= */

/* ----- Layout ----- */
body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
}

/* ----- Navbar ----- */
.navbar-main {
    background-color: #1a3a5c !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.navbar-main .navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .5px;
}
.navbar-main .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-size: 0.875rem;
}
.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    color: #7ec8f5 !important;
}
.navbar-main .navbar-toggler {
    border-color: rgba(255,255,255,.3);
}
.navbar-main .navbar-toggler-icon {
    filter: invert(1);
}

/* ----- Page header ----- */
.page-header {
    position: relative;
    background-image: url('/static/core/img/hero.jpg');
    background-size: cover;
    background-position: center 35%;
    color: #fff;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 35, 60, 0.70);
}
.page-header .container {
    position: relative;
    z-index: 1;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.page-header .subtitle {
    opacity: .9;
    font-size: 0.875rem;
    margin-top: .25rem;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ----- Cards ----- */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    transition: box-shadow .2s;
}
.card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.15);
}

/* ----- Filter bar ----- */
.filter-bar {
    background: #fff;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.filter-bar .form-select,
.filter-bar .form-control {
    font-size: 0.875rem;
}

/* ----- Tables ----- */
.table-results {
    font-size: 0.85rem;
    margin-bottom: 0;
}
.table-results thead th {
    background-color: #1a3a5c;
    color: #fff;
    border: none;
    font-weight: 600;
    white-space: nowrap;
    padding: .5rem .75rem;
}
.table-results tbody td {
    vertical-align: middle;
    padding: .45rem .75rem;
    border-color: #e9ecef;
}
.table-results tbody tr:hover {
    background-color: #eef4fb;
}
.table-results .place-1  { font-weight: 700; color: #c69a00; }
.table-results .place-2  { font-weight: 700; color: #7a7a7a; }
.table-results .place-3  { font-weight: 700; color: #a0522d; }
.table-results .dnf-row  { color: #999; font-style: italic; }

/* Призёры в любых таблицах (командная гонка и т.д.) */
tr.place-1 td { font-weight: 700; }
tr.place-2 td { font-weight: 700; }
tr.place-3 td { font-weight: 700; }
tr.place-1 td a { font-weight: 700 !important; color: #c69a00 !important; }
tr.place-2 td a { font-weight: 700 !important; color: #7a7a7a !important; }
tr.place-3 td a { font-weight: 700 !important; color: #a0522d !important; }

/* ----- Status badges ----- */
.badge-PLANNED   { background-color: #ffc107; color: #000; }
.badge-ONGOING   { background-color: #28a745; color: #fff; }
.badge-FINISHED  { background-color: #6c757d; color: #fff; }
.badge-CANCELLED { background-color: #dc3545; color: #fff; }

/* ----- Competition card (calendar) ----- */
.comp-card {
    border-left: 4px solid #2c6fad;
    transition: border-color .2s, background-color .2s;
}
.comp-card .comp-dates {
    font-size: 0.8rem;
    color: #6c757d;
}
.comp-card .comp-city {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Статусные варианты карточки */
.comp-card-PLANNED  { border-left-color: #2c6fad; }
.comp-card-PLANNED:hover  { border-left-color: #1a3a5c; }

.comp-card-ONGOING  { border-left-color: #28a745; background-color: #f4fff6; }
.comp-card-ONGOING:hover  { border-left-color: #1a6930; }

.comp-card-FINISHED {
    border-left-color: #9aa5b1;
    background-color: #f8f9fa;
}
.comp-card-FINISHED:hover { border-left-color: #5a6470; }
.comp-card-FINISHED h5 a { color: #495057 !important; }

.comp-card-CANCELLED {
    border-left-color: #dc3545;
    background-color: #fff8f8;
    opacity: 0.75;
}
.comp-card-CANCELLED:hover { border-left-color: #b02a37; opacity: 1; }

/* ----- Cup card (calendar) ----- */
.cup-card {
    border-left: 4px solid #e8a020 !important;
    background-color: #fffdf7;
}
.cup-card:hover { border-left-color: #c47d00 !important; }

/* ----- Nav tabs (events) ----- */
.nav-tabs .nav-link {
    font-size: 0.82rem;
    color: #1a3a5c;
    padding: .4rem .9rem;
}
.nav-tabs .nav-link.active {
    font-weight: 700;
    border-bottom-color: transparent;
}

/* ----- Athlete card ----- */
.athlete-card .info-label {
    font-size: 0.78rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.athlete-card .info-value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ----- Footer ----- */
footer {
    background-color: #1a3a5c;
    color: rgba(255,255,255,.6);
    font-size: 0.8rem;
    padding: 1.25rem 0;
    margin-top: 3rem;
}
footer a { color: rgba(255,255,255,.75); }
footer a:hover { color: #fff; }

/* ----- Login form ----- */
.login-card {
    max-width: 420px;
    margin: 4rem auto;
}
.login-card .card-header {
    background: #1a3a5c;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ----- Upload portal ----- */
.upload-item {
    border-left: 4px solid #2c6fad;
    padding: .75rem 1rem;
    border-radius: 0 8px 8px 0;
    background: #fff;
    margin-bottom: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ----- Sport pictogram filter buttons ----- */
.sport-filter-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #6c757d;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    transition: border-color .15s, background .15s, color .15s;
    min-width: 78px;
}
.sport-filter-btn:hover {
    border-color: #adb5bd;
    color: #212529;
    background: #fff;
}
.sport-filter-btn.active {
    border-color: var(--sport-color, #2563eb);
    background: #fff;
    color: #212529;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sport-color, #2563eb) 15%, transparent);
}
.sport-filter-icon {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sport-filter-name {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

/* ----- Print styles (protocol) ----- */
@media print {
    .navbar-main, footer, .btn, .filter-bar, .no-print { display: none !important; }
    body { background: #fff; font-size: 10pt; }
    .page-header { background: none !important; color: #000 !important; padding: 0; }
    .table-results thead th { background-color: #ddd !important; color: #000 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    a[href]::after { content: none !important; }
}
