/* ── N3 Driver Pages – Shared Styles ────────────────────────────────────── */

/* ---- Page header + divider (same as ResultSeason/Results) ---- */
.page-header    { display: flex; align-items: center; margin-bottom: 20px; min-height: 36px; }
.page-title     { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; flex: 1; line-height: 1; }
.page-title .sep { color: var(--text-muted); font-weight: 400; margin: 0 6px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0 0 20px; }

/* ---- Main ---- */
.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    overflow-y: auto;
    height: 100vh;
    padding: 28px 32px 48px;
    transition: margin-left 0.25s ease;
}
body.compact .main { margin-left: var(--sidebar-compact); }

/* ---- Driver header ---- */
.driver-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 14px;
    margin-bottom: 0;
}
.header-flag  { height: 44px; width: auto; object-fit: contain; flex-shrink: 0; }
.header-info  { min-width: 0; }
.driver-name  { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; line-height: 1.2; }
.driver-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.driver-stats { text-align: right; flex-shrink: 0; margin-left: auto; align-self: center; }
.stat-wins    { font-size: 18px; font-weight: 700; color: var(--text-muted); line-height: 1.3; }
.stat-wm      { font-size: 18px; font-weight: 700; color: var(--accent);     line-height: 1.3; }
.stat-gp      { font-size: 18px; font-weight: 700; color: var(--text-muted); line-height: 1.3; }

/* ---- Nav arrow (prev/next driver) ---- */
.nav-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border: 1px solid var(--border); border-radius: 50%;
    background: transparent; color: var(--text-muted);
    font-size: 13px; text-decoration: none; flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-arrow:hover { background: var(--accent); color: #111; border-color: var(--accent); }

/* ---- Driver tabs → now in n3.css ---- */

/* ---- Two-column layouts ---- */
.driver-cols      { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.driver-cols-half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- N3 Card ---- */
.n3-card   { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.n3-card-0 { background: transparent; border-radius: var(--radius); overflow: hidden; }

/* ---- Card caption ---- */
.card-caption { padding: 8px 12px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ---- Data table ---- */
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.data-table thead th {
    background: rgba(0,0,0,0.3);
    color: var(--text-muted); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 7px 12px; text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 7px 12px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle; font-size: 12px;
}
.data-table tbody td.label { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.data-table tbody td.center { text-align: center; }
.data-table thead th.center { text-align: center; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.data-table img { height: 1.3em; object-fit: contain; vertical-align: middle; }
.data-table a { color: var(--accent); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table td table td { border-bottom: none; padding: 0; }

/* ---- Details / Summary ---- */
details.n3-details summary {
    padding: 7px 12px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 600;
    transition: color 0.13s;
}
details.n3-details summary::-webkit-details-marker { display: none; }
details.n3-details summary:hover { color: var(--text); }
details.n3-details[open] summary { color: var(--accent); }

/* ---- Car nav (DriverCarResults: prev / current / next car) ---- */
.car-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0; margin-bottom: 0;
    background: var(--bg);
    padding: 10px 16px;
}
.car-nav-logo         { height: 20px; object-fit: contain; flex-shrink: 0; opacity: 0.45; }
.car-nav-logo-current { opacity: 0.7; }
.car-nav .footer-current span { font-weight: 700; font-size: 14px; color: var(--text); }

/* ---- Win badge (w3-badge replicated for N3 pages without w3.css) ---- */
.w3-badge {
    display: inline-block; min-width: 20px; line-height: 20px;
    padding: 0 6px; text-align: center; border-radius: 50%;
    font-size: 11px; font-weight: 700; color: #fff; vertical-align: middle;
}
.w3-red       { background: #f44336; }
.w3-orange    { background: #ff9800; }
.w3-indigo    { background: #3f51b5; }
.w3-yellow    { background: #ffeb3b; color: #222; }
.w3-teal      { background: #009688; }
.w3-blue      { background: #2196F3; }
.w3-dark-grey { background: #616161; }

/* ---- Car grid (DriverCars.jsp) ---- */
.car-grid { display: grid; gap: 16px; margin-top: 24px; background: #ffffff; padding: 16px; border-radius: var(--radius); }
.car-grid img { aspect-ratio: 9/4; object-fit: contain; background: #ffffff; width: 100%; display: block; }

/* ---- Per-card slideshow ---- */
.n3-slideshow { position: relative; }
.n3-slideshow .mySlides { display: none; }
.n3-slideshow .mySlides:first-child { display: block; }
.next-btn {
    color: var(--text-muted); cursor: pointer;
    font-size: 12px; padding: 0 2px;
    text-decoration: none; transition: color 0.13s;
}
.next-btn:hover { color: var(--accent); }
@keyframes fadeEffect { from { opacity: .4 } to { opacity: 1 } }
.fade { animation: fadeEffect 0.5s; }

/* ---- Year bar (DriverPhoto.jsp) ---- */
.year-bar {
    display: flex; align-items: center;
    background: var(--bg);
    margin-bottom: 0; overflow: hidden;
}
.year-bar-scroll {
    flex: 1; display: flex; overflow-x: auto;
    scrollbar-width: none; gap: 2px; padding: 4px 6px;
}
.year-bar-scroll::-webkit-scrollbar { display: none; }
.year-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 5px 10px; border-radius: 3px;
    color: var(--text-muted); font-size: 12px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    transition: color 0.13s, background 0.13s; flex-shrink: 0;
}
.year-btn:hover  { color: var(--text); background: rgba(255,255,255,0.07); }
.year-btn.active { color: var(--accent); background: var(--accent-dim); }
.year-bar .yb-scroll-btn {
    background: transparent; border: none;
    width: 28px; height: 36px;
    color: var(--text-muted); cursor: pointer; font-size: 12px;
    flex-shrink: 0; transition: color 0.13s;
}
.year-bar .yb-scroll-btn:hover { color: var(--text); }

/* ---- Driver footer ---- */
.driver-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 32px;
}
.footer-nav {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text-muted); font-size: 11px;
    line-height: 1; transition: color 0.13s;
}
.footer-nav:hover { color: var(--accent); }
.footer-nav:hover .nav-arrow { background: var(--accent); color: #111; border-color: var(--accent); }
.footer-nav-right { flex-direction: row; }
.footer-current {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-muted);
}
.footer-flag { height: 20px; width: auto; object-fit: contain; opacity: 0.45; flex-shrink: 0; }
.footer-flag-full { opacity: 0.7; }

/* ---- DriverSlideShow full-page ---- */
.ss-wrap {
    background: #ffffff; padding: 16px; border-radius: var(--radius);
    margin-top: 24px;
}
#slideImg { width: 100%; display: block; aspect-ratio: 9/4; object-fit: contain; background: #ffffff; animation: fadeEffect 0.5s; }
.ss-nav-row { display: flex; align-items: center; gap: 8px; }
.ss-center  { flex: 1; }
.ss-nav-vert { text-align: center; }
.ss-nav-btn {
    background: none; border: none;
    color: #aaaaaa; font-size: 28px;
    cursor: pointer; padding: 8px 16px; flex-shrink: 0;
    transition: color 0.15s;
}
.ss-nav-btn:hover { color: var(--accent); }
#caption { text-align: center; font-size: 13px; color: #333333; padding: 8px 0 2px; }
#counter { text-align: center; font-size: 12px; color: #888888; padding: 2px 0 4px; }

/* ---- Team page-header band with team color ---- */
.team-page-header { margin: -20px 0 0; padding: 8px 16px 12px; border-radius: var(--radius); }
.team-logos-center { display: flex; justify-content: center; align-items: center; gap: 16px; }
.team-logos-center img { max-height: 68px; width: auto; object-fit: contain; }

/* ---- Grey Mode ---- */
body.grey-mode .n3-card   { background: #ffffff; border-color: #cccccc; }
body.grey-mode .n3-card-0 { border: none; }
body.grey-mode .card-caption { border-color: #dddddd; }
body.grey-mode .data-table thead th { background: rgba(0,0,0,0.07); border-color: #cccccc; }
body.grey-mode .data-table tbody td { border-color: #dddddd; }
body.grey-mode .data-table tbody tr:hover td { background: rgba(0,0,0,0.025); }
body.grey-mode details.n3-details summary { background: rgba(0,0,0,0.05); border-color: #cccccc; }
body.grey-mode .driver-header  { border-color: #cccccc; }
body.grey-mode .driver-tabs    { border-color: #cccccc; }
body.grey-mode .driver-footer  { border-color: #cccccc; }
body.grey-mode .footer-btn     { background: #f5f5f5; border-color: #cccccc; }
body.grey-mode .year-bar        { background: var(--bg); }
body.grey-mode .year-btn:hover  { background: rgba(0,0,0,0.07); }
body.grey-mode .car-nav         { background: var(--bg); }
body.grey-mode .rnr-item:hover  { background: rgba(0,0,0,.07); }

/* Photo grid: padd=1 → Bilder bündig mit N3-Content-Rand (32px vom Fenster) */
.gallery.gallery-padded { margin-left: -15px; margin-right: -15px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) { .driver-cols { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .main             { margin-left: 0; padding: 68px 16px 40px; }
    .driver-cols-half { grid-template-columns: 1fr; }
    .car-grid         { grid-template-columns: 1fr !important; }
}
