/* RaceDays Pro - Stylesheet */
:root {
    --primary-color: #d32f2f;
    --primary-dark: #b71c1c;
    --primary-light: #ff6659;
    --secondary-color: #757575;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --gray-dark: #424242;
    --bahn-a: #2196F3;
    --bahn-b: #f44336;
    --bahn-c: #4CAF50;
    --bahn-d: #FFC107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-light);
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-medium);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Navigation */
.navbar {
    background: var(--primary-color);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand h2 {
    margin: 0;
    padding: 15px 0;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 15px 10px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: var(--primary-dark);
}

.nav-link.logout {
    background-color: var(--error-color);
}

.nav-user {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.current-time {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.quick-actions {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Tables */
.data-table, .participants-grid, .kasse-grid, .bestenliste-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table th, .participants-grid th, .kasse-grid th, .bestenliste-table th {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

.data-table td, .participants-grid td, .kasse-grid td, .bestenliste-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-medium);
}

/* Bahn-Farben */
.bahn-A { color: var(--bahn-a); font-weight: bold; }
.bahn-B { color: var(--bahn-b); font-weight: bold; }
.bahn-C { color: var(--bahn-c); font-weight: bold; }
.bahn-D { color: var(--bahn-d); font-weight: bold; }

/* Status */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-badge.sold {
    background: var(--success-color);
    color: white;
}

.status-badge.available {
    background: var(--gray-medium);
    color: var(--gray-dark);
}

/* Rennleitung */
.participants-grid-container, .kasse-grid-container {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
}

.participant-row.available {
    background-color: #f9f9f9;
}

.participant-row.sold {
    background-color: white;
}

.editable input, .editable select {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--gray-medium);
    border-radius: 3px;
    background: white;
}

.editable input:focus, .editable select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.plan-start {
    font-family: monospace;
    color: var(--secondary-color);
}

/* Next Racers Widget */
.next-racers-widget {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.next-racers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.next-racer-widget {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--gray-light);
    border-radius: 5px;
    border-left: 4px solid;
}

.next-racer-widget.bahn-A { border-left-color: var(--bahn-a); }
.next-racer-widget.bahn-B { border-left-color: var(--bahn-b); }
.next-racer-widget.bahn-C { border-left-color: var(--bahn-c); }
.next-racer-widget.bahn-D { border-left-color: var(--bahn-d); }

/* Bestenliste */
.bestenliste-ak {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.bestenliste-ak h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--gray-medium);
    padding-bottom: 10px;
}

.platz {
    font-weight: bold;
    color: var(--primary-color);
}

.bestzeit {
    font-family: monospace;
    font-weight: bold;
}

/* Kasse */
.kasse-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

/* Forms */
.settings-form, .login-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-medium);
    border-radius: 5px;
    font-size: 16px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--secondary-color);
    font-size: 0.8em;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: end;
}

.form-row input, .form-row select {
    flex: 1;
}

/* Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--error-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .kasse-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
}