/* Temp/public/css/style.css */

/* 1. VARIABLEN & RESET */
:root {
    /* Farbpalette: Modern Dark Mode */
    --bg-body: #09090b;       /* Fast Schwarz */
    --bg-card: #18181b;       /* Dunkles Grau */
    --bg-card-hover: #27272a; /* Helleres Grau bei Hover */
    
    --text-main: #f4f4f5;     /* Weiß-Grau */
    --text-muted: #a1a1aa;    /* Mittelgrau */
    
    /* Akzentfarben */
    --primary: #6366f1;       /* Indigo/Lila - Modern & Seriös */
    --primary-hover: #818cf8;
    --accent-prize: #fbbf24;  /* Gold/Amber für Geld */
    
    /* Status Farben */
    --status-open: #10b981;   /* Smaragdgrün */
    --status-closed: #ef4444; /* Rot */
    --status-ended: #71717a;  /* Grau */

    --radius: 12px;           /* Rundung der Ecken */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 2. LAYOUT & CONTAINER */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--bg-card);
    border-bottom: 1px solid #27272a;
    padding: 20px 0;
    margin-bottom: 40px;
}

/* 3. TYPOGRAFIE */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em; /* Modernes "Tight" spacing */
    color: white;
}

.logo a {
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.race-list-header {
    text-align: center;
    margin-bottom: 40px;
}

.race-list-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Text-Gradient Effekt */
}

.race-list-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 4. CARDS (Die Renn-Boxen) */
.race-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.race-card {
    background-color: var(--bg-card);
    border: 1px solid #27272a;
    border-radius: var(--radius);
    padding: 24px;
    position: relative; /* Für absolute Positionierung des Status */
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.race-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-card-hover);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-color: #3f3f46;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-right: 20px; /* Platz für Status Badge */
}

.race-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.race-card strong {
    color: var(--text-main);
    font-weight: 600;
}

.race-card .prize {
    margin-top: 16px;
    margin-bottom: 24px;
    font-size: 1.1rem;
    color: var(--accent-prize);
    font-weight: 700;
}

/* Status Badge in der Karte */
.race-status {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 9999px; /* Pill Shape */
    background: #27272a;
    color: var(--text-muted);
}

/* Status Farben Logik */
.status-offen .race-status,
.detail-status.status-offen strong {
    color: var(--status-open);
    background: rgba(16, 185, 129, 0.1); /* Hauch von Grün im Hintergrund */
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-abgesagt .race-status,
.detail-status.status-abgesagt strong {
    color: var(--status-closed);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-beendet .race-status {
    opacity: 0.5;
}

/* 5. BUTTONS */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s;
    margin-top: auto; /* Drückt Button nach unten */
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.back-btn {
    background-color: transparent;
    border: 1px solid #3f3f46;
}
.back-btn:hover {
    background-color: #27272a;
    border-color: var(--text-main);
}

/* 6. DETAIL PAGE (race.php) */
.race-details-container {
    background: var(--bg-card);
    border: 1px solid #27272a;
    border-radius: var(--radius);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.detail-status {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Countdown Dashboard Style */
.countdown-wrapper {
    background: #000;
    border: 1px solid #27272a;
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    margin-bottom: 40px;
}

.countdown-wrapper h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 15px;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums; /* Verhindert Springen der Zahlen */
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    min-width: 1.5em;
}

.detail-meta p, 
.detail-contact p,
.detail-description p {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.detail-prize {
    background: rgba(251, 191, 36, 0.05); /* Sehr transparentes Gold */
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    margin: 30px 0;
}

.detail-prize h3 {
    color: var(--accent-prize);
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.prize-value {
    font-size: 2rem;
    font-weight: 800;
    color: white;
}

.warning {
    color: var(--status-closed) !important;
    margin-top: 10px;
    font-size: 0.9rem !important;
}

.detail-actions {
    margin-top: 40px;
    text-align: center;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 40px 0;
    text-align: center;
    color: #52525b;
    font-size: 0.9rem;
    border-top: 1px solid #27272a;
}

/* Mobile Optimierung */
@media (max-width: 600px) {
    .race-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 1.5rem;
    }
    
    .race-details-container {
        padding: 20px;
    }
}