/* --- GLOBALE VARIABLEN --- */
:root {
    --f1-red: #e10600;
    --dark-bg: #15151e;
    --carbon: #2b2b3b;
    --card-bg: #1f1f2b;
    --white: #ffffff;
    --gray: #909090;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--dark-bg);
    background-image: linear-gradient(135deg, #15151e 25%, #1a1a24 100%);
    color: var(--white);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- TYPOGRAFIE --- */
.logo-font {
    font-style: italic;
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
    margin: 0;
}

.logo-font span {
    color: var(--f1-red);
}

/* --- LAYOUT --- */
.page-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

/* --- KOMPONENTEN --- */
.card {
    background: var(--carbon);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-top: 5px solid var(--f1-red);
}

.race-card {
    background: var(--carbon);
    border-left: 5px solid var(--f1-red);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.race-card:hover {
    transform: translateX(5px);
}

/* --- FORMULARE --- */
.form-group {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #ccc;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 5px;
    background: #1f1f2b;
    color: white;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--f1-red);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--f1-red);
    color: white;
    width: 100%;
}

.btn-primary:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
    border-color: #999999 !important;
    opacity: 0.6;
}

.btn-primary:hover {
    background: #ff0800;
}

.btn-wide {
    width: auto;
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--carbon);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 450px;
    border-top: 10px solid var(--f1-red);
}

/* --- DEKO --- */
.checkered {
    height: 10px;
    background-color: #fff;
    margin-top: 20px;
    background-image: linear-gradient(45deg, #000 25%, transparent 25%), linear-gradient(-45deg, #000 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #000 75%), linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 10px 10px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--gray);
    padding: 5px 12px;
    font-size: 0.75rem;
    margin-top: 5px;
}

.btn-logout:hover {
    border-color: var(--f1-red);
    color: var(--f1-red);
    background: rgba(225, 6, 0, 0.1);
}

/* --- USER MENU DROPDOWN --- */
.user-menu-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.dropdown-menu {
    display: none; 
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--carbon);
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 5px;
    border: 1px solid #444;
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-menu a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.2s;
    border-bottom: 1px solid #3d3d4d;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--card-bg);
    color: var(--f1-red);
}

.admin-link {
    border-left: 3px solid var(--f1-red);
}

/* --- NAV BAR OBEN --- */
.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.btn-leaderboard {
    background: gold;
    color: black !important;
    font-size: 0.85rem;
}

.btn-leaderboard:hover {
    background: #ffd700;
    transform: scale(1.05);
}

/* --- LEADERBOARD TABLE --- */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--dark-bg);
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table th {
    background-color: var(--f1-red);
    color: white;
    text-align: left;
    padding: 12px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #333;
    font-size: 0.95rem;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Markierung für den aktuellen User */
.leaderboard-table tr.current-user {
    background: rgba(225, 6, 0, 0.15);
    border-left: 3px solid var(--f1-red);
}

.rank {
    font-weight: 900;
    font-style: italic;
    width: 40px;
}

.points {
    text-align: right;
    font-weight: bold;
    color: var(--f1-red);
}

/* Modal-Größe für Leaderboard anpassen */
.modal-lg {
    max-width: 600px;
}

/* --- PASSWORT INFO BOX --- */
.password-requirements {
    background: rgba(225, 6, 0, 0.05);
    border: 1px dashed var(--f1-red);
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #ccc;
}

.password-requirements ul {
    margin: 8px 0 0 15px;
    padding: 0;
    list-style-type: square;
}

.password-requirements span {
    color: var(--f1-red);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* --- ADMIN USER MANAGEMENT --- */


.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-admin {
    background: #ffb700;
    color: #000;
}

.status-user {
    background: #444;
    color: #fff;
}

.btn-delete {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete:hover {
    background: #ff4444;
    color: white;
}

/* --- ALERTS & NOTIFICATIONS --- */
.alert-container {
    margin-top: 10px;
    width: 100%;
}

.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.4s ease-out;
    border-left: 5px solid transparent;
}

/* Fehler / Gefahr */
.alert-error,
.alert-danger {
    background: rgba(225, 6, 0, 0.15);
    border: 1px solid var(--f1-red);
    border-left: 5px solid var(--f1-red);
    color: #ff4444;
}

/* Erfolg / Zielflagge */
.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid #28a745;
    border-left: 5px solid #28a745;
    color: #44ff44;
}

.close-alert {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    opacity: 0.6;
}

.close-alert:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}