/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #fff;
    padding: 20px;
    transition: transform 0.3s ease;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    height: 100vh; /* Full viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin: 15px 0;
}

.sidebar-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #3498db;
}

/* Sidebar Button */
.btn-sidebar {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px;
    margin: 0;
}

/* Submenu Styling */
.submenu {
    margin-left: 15px;
    display: none; /* Hidden by default */
}

.menu-item.expanded .submenu {
    display: block; /* Shown when parent has .expanded */
}

.menu-item.collapsed .submenu {
    display: none; /* Explicitly hidden when collapsed */
}

.submenu li {
    margin: 8px 0;
}

.submenu a {
    font-size: 0.95rem;
    padding: 8px;
}

/* Menu Toggle */
.menu-toggle {
    cursor: pointer;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    background-color: #121212;
}

/* Header */
.header {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.header h1 {
    font-size: 1.8rem;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* User Info */
.user-info {
    font-size: 1rem;
    white-space: nowrap;
}

/* Content */
.content {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    margin-top: 20px;
    text-align: center;
    color: #777;
}

/* Dashboard Content */
.dashboard-content {
    margin-bottom: 20px;
}

.dashboard-content h2 {
    margin-bottom: 15px;
    color: #fff;
}

/* Application Heading */
.app-heading {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #fff;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Error Message */
.error {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* User Table */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.user-table th,
.user-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #555;
}

.user-table th {
    background-color: #333;
    color: #fff;
}

.user-table tr:hover {
    background-color: #2c2c2c;
}

/* Buttons */
.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-small {
    padding: 3px 6px;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #7f8c8d;
}

.btn-secondary:hover {
    background-color: #95a5a6;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 15px;
        flex-wrap: nowrap;
    }

    .header h1 {
        font-size: 1.5rem;
        max-width: 50%;
    }

    .header-actions {
        flex-shrink: 0;
    }

    .user-info {
        font-size: 0.9rem;
    }

    .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .btn-small {
        padding: 2px 5px;
        font-size: 0.7rem;
    }

    .app-heading {
        font-size: 2rem;
    }

    .login-container {
        max-width: 100%;
        margin: 20px 10px;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #fff;
}

.form-group input,
.form-group select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #333;
    color: #fff;
}

/* Raceday Form */
.raceday-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Actions */
.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Delete Action */
.delete-action {
    margin-top: 20px;
}

.delete-racer-form {
    display: inline-block;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #1e1e1e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #555;
    color: #ccc;
}

.data-table th {
    background-color: #333;
    color: #fff;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #1e1e1e;
}

.data-table tr:hover {
    background-color: #2c2c2c;
}

.data-table td {
    vertical-align: middle;
}