:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #f4f6f9;
    --text-color: #333;
    --card-bg: #fff;
    --border-color: #ddd;
    --nav-bg: #fff;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

[data-theme="dark"] {
    --primary-color: #375a7f;
    --primary-hover: #2b4764;
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #444;
    --nav-bg: #222;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: var(--nav-bg);
    color: var(--text-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

nav {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border-radius: 0 0 8px 8px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

main {
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--text-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: translateY(1px);
}

input:not([type="checkbox"]),
select {
    padding: 0.7rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.card {
    background-color: var(--card-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

label {
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: block;
    /* Stacked by default for text inputs */
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
}

/* Authentication styles */
#auth-section {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

/* Lists */
ul {
    padding-left: 0;
    list-style: none;
}

li {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

li strong {
    font-size: 1.1em;
}

/* Execution Inputs */
.shot-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.shot-row input[type="text"],
.shot-row input[type="number"] {
    width: auto;
    flex: 1;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .shot-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .shot-row input {
        width: 100%;
    }
}

/* Global Navigation (FR-009) */
.main-header {
    background: var(--background-color);
    /* Match page background instead of black */
    color: var(--text-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

#menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    /* Dark color for light background */
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    z-index: 1100;
}

body.menu-open #menu-toggle {
    display: none;
    /* Hide button to avoid overlapping with sidebar header */
}

#page-title {
    margin: 0;
    font-size: 1.25rem;
}

/* Sidebar Flyout */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    /* Hidden by default */
    width: 250px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    background: #eee;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar ul {
    list-style: none;
    /* Reset again inside sidebar just in case */
    padding: 0;
    margin: 0;
    display: block;
    /* Stack vertically */
    gap: 0;
}

.sidebar li {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: block;
}

.sidebar li a {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.sidebar li a:hover {
    background: #f9f9f9;
    color: var(--primary-color);
}

#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 900;
}

#menu-overlay.show {
    display: block;
}