/* =====================================================================
   site.css — RaceTiming.gr
   ===================================================================== */

/* ── Custom properties ─────────────────────────────────────────────── */
:root {
    --neon:        #39ff14;
    --neon-dim:    #88ffcc;
    --neon-dark:   #0b8000;
    --bg:          #0a0a0a;
    --card-bg:     rgba(0, 0, 0, 0.65);
    --text:        #c8c8c8;
    --text-bright: #f2f2f2;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ──────────────────────────────────────────────────────────── */
body {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #111 0%, #050505 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* ── Background layer 1: photo ─────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('./assets/fl.jpg') center / cover no-repeat;
    opacity: 0.07;
    z-index: 0;
    pointer-events: none;
}

/* ── Background layer 2: animated speed lines ──────────────────────── */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: -200px;
    width: calc(100% + 400px);
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        97deg,
        transparent 0,
        transparent 58px,
        rgba(57, 255, 20, 0.016) 58px,
        rgba(57, 255, 20, 0.016) 60px
    );
    animation: speedLines 12s linear infinite;
}

/* ── Checkered top bar ─────────────────────────────────────────────── */
body > .site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.7) 0,
        rgba(255,255,255,0.7) 10px,
        rgba(0,0,0,0.9) 10px,
        rgba(0,0,0,0.9) 20px
    );
    opacity: 0.5;
}

/* All direct body children above background layers */
body > * { position: relative; z-index: 1; }

/* ── Site header ───────────────────────────────────────────────────── */
.site-header {
    position: relative;
    width: 100%;
    max-width: 1100px;
    padding: 28px 32px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ── Logo ──────────────────────────────────────────────────────────── */
.logo { flex-shrink: 0; }

.logo a { display: inline-block; }

.logo img {
    max-width: 260px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.25));
    transition: filter 0.3s;
}

.logo img:hover {
    filter: drop-shadow(0 0 20px rgba(57, 255, 20, 0.55));
}

/* ── Company link ──────────────────────────────────────────────────── */
.company-link a {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #000;
    padding: 12px 22px;
    text-decoration: none;
    background: linear-gradient(45deg, var(--neon), var(--neon-dim), var(--neon));
    background-size: 300% 300%;
    border-radius: 8px;
    box-shadow: 0 0 20px var(--neon), 0 0 8px var(--neon);
    animation: flow 3s ease infinite, pulse 2.2s ease-in-out infinite;
    transition: transform 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}

.company-link a:hover {
    transform: scale(1.08) rotate(-1.5deg);
    box-shadow: 0 0 32px var(--neon-dim), 0 0 55px var(--neon);
    color: #000;
}

/* ── Main content wrapper ──────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 16px 80px;
}

/* ── Button container (index.php) ──────────────────────────────────── */
.button-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin-top: 52px;
    width: 100%;
    max-width: 500px;
    animation: fadeUp 0.5s ease both;
}

.button-container form { width: 100%; }

/* ── Racing buttons ────────────────────────────────────────────────── */
.racing-button {
    display: block;
    width: 100%;
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1.5;
    color: #000;
    padding: 20px 32px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(45deg, var(--neon), var(--neon-dim), var(--neon));
    background-size: 300% 300%;
    animation: flow 3s ease infinite;
    box-shadow: 0 0 16px var(--neon), 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer sweep on hover */
.racing-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.4s ease;
}

.racing-button:hover::after { left: 130%; }

.racing-button:hover {
    transform: scale(1.04) translateY(-3px);
    box-shadow: 0 0 30px var(--neon), 0 10px 28px rgba(0, 0, 0, 0.6);
}

.racing-button:active { transform: scale(0.97); }

/* ── Shared card container ─────────────────────────────────────────── */
.past-races-container,
.race-container {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 40px 48px;
    border-radius: 14px;
    max-width: 860px;
    width: 100%;
    box-shadow:
        0 0 24px rgba(57, 255, 20, 0.14),
        0 0 80px rgba(57, 255, 20, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(57, 255, 20, 0.14);
    margin: 32px 0 80px;
    color: var(--text);
    line-height: 1.75;
    animation: fadeUp 0.55s ease both;
}

.past-races-container h1,
.race-container h1 {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-shadow: 0 0 14px rgba(57, 255, 20, 0.45);
}

.race-container p {
    white-space: pre-line;
    font-size: 16px;
    color: var(--text);
}

.race-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 32px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.12);
}

/* ── Race external link ────────────────────────────────────────────── */
.race-link {
    display: inline-block;
    margin-top: 28px;
    font-size: 15px;
    font-weight: 600;
    color: var(--neon);
    text-decoration: none;
    border-bottom: 1px dashed var(--neon);
    transition: color 0.25s, border-color 0.25s;
    letter-spacing: 0.3px;
}

.race-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* ── Past races list ───────────────────────────────────────────────── */
.race-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.race-link-button {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ddd;
    text-decoration: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 4px solid var(--neon-dark);
    transition: background 0.2s, border-left-color 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
    position: relative;
    overflow: hidden;
}

.race-link-button::before {
    content: '▶';
    font-size: 10px;
    margin-right: 12px;
    color: var(--neon-dark);
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.race-link-button:hover {
    background: rgba(57, 255, 20, 0.07);
    border-left-color: var(--neon);
    transform: translateX(5px);
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.1);
    color: #fff;
}

.race-link-button:hover::before {
    color: var(--neon);
    transform: translateX(2px);
}

/* ── Race-type colour coding (CSS attribute selectors) ─────────────── */
/* Ανάβαση → red */
a.race-link-button[href*="anavasi"]                      { border-left-color: #c0392b; }
a.race-link-button[href*="anavasi"]::before              { color: #c0392b; }
a.race-link-button[href*="anavasi"]:hover                { border-left-color: #e74c3c; box-shadow: 0 0 14px rgba(192,57,43,0.2); }

/* Mega Four → amber */
a.race-link-button[href*="megafour"],
a.race-link-button[href*="mfioa"],
a.race-link-button[href*="4megafour"]                    { border-left-color: #d68910; }
a.race-link-button[href*="megafour"]::before,
a.race-link-button[href*="mfioa"]::before,
a.race-link-button[href*="4megafour"]::before            { color: #d68910; }
a.race-link-button[href*="megafour"]:hover,
a.race-link-button[href*="mfioa"]:hover,
a.race-link-button[href*="4megafour"]:hover              { border-left-color: #f39c12; box-shadow: 0 0 14px rgba(214,137,16,0.2); }

/* RallyCross → purple */
a.race-link-button[href*="allycross"]                    { border-left-color: #8e44ad; }
a.race-link-button[href*="allycross"]::before            { color: #8e44ad; }
a.race-link-button[href*="allycross"]:hover              { border-left-color: #9b59b6; box-shadow: 0 0 14px rgba(142,68,173,0.2); }

/* Rally (not rallycross) → blue */
a.race-link-button[href*="rally"]:not([href*="allycross"]),
a.race-link-button[href*="Rally"]:not([href*="allycross"]) { border-left-color: #1a6fa8; }
a.race-link-button[href*="rally"]:not([href*="allycross"])::before,
a.race-link-button[href*="Rally"]:not([href*="allycross"])::before { color: #1a6fa8; }
a.race-link-button[href*="rally"]:not([href*="allycross"]):hover,
a.race-link-button[href*="Rally"]:not([href*="allycross"]):hover   { border-left-color: #2980b9; box-shadow: 0 0 14px rgba(26,111,168,0.2); }

/* ── Back button ───────────────────────────────────────────────────── */
.back-button {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 1000;
}

.back-button a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--neon);
    padding: 9px 16px;
    border-radius: 7px;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(57, 255, 20, 0.4);
    backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
}

.back-button a::before { content: '←'; font-size: 14px; }

.back-button a:hover {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--neon);
    color: #fff;
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer-company-link {
    width: 100%;
    text-align: center;
    padding: 16px 0 26px;
    position: relative;
    z-index: 1;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-company-link a {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(57, 255, 20, 0.4);
    text-decoration: none;
    transition: color 0.25s;
}

.footer-company-link a:hover { color: var(--neon); }

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes flow {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

@keyframes pulse {
    0%,100% { box-shadow: 0 0 16px var(--neon),  0 0 6px  var(--neon); }
    50%      { box-shadow: 0 0 28px var(--neon-dim), 0 0 44px var(--neon); }
}

@keyframes speedLines {
    from { transform: translateX(0); }
    to   { transform: translateX(200px); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .site-header {
        padding: 20px 16px 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .logo img        { max-width: 180px; }
    .company-link a  { font-size: 11px; padding: 10px 16px; }

    .button-container         { margin-top: 36px; }
    .racing-button            { font-size: 14px; padding: 16px 20px; }

    .past-races-container,
    .race-container           { padding: 24px 20px; margin: 20px 0 60px; }

    .past-races-container h1,
    .race-container h1        { font-size: 17px; }

    .race-link-button         { font-size: 14px; padding: 11px 14px; }

    .back-button              { top: auto; bottom: 16px; left: 16px; }
}
