/* ===== Base Styles ===== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}

/* ===== Navigation Bar ===== */
.navbar {
    background: #333;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.navbar a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 3px;
}
.navbar a:hover {
    background: #555;
}
.navbar .current {
    background: #007bff;
}

/* ===== Month Navigation (Previous/Next) ===== */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.navigation a {
    text-decoration: none;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border-radius: 4px;
}
.navigation a:hover {
    background: #0056b3;
}

/* ===== Calendar Table ===== */
.calendar {
    border-collapse: collapse;
    width: 100%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.calendar th,
.calendar td {
    border: 1px solid #ddd;
    width: 14.28%;
    vertical-align: top;
    height: 120px;
    padding: 5px;
}
.calendar th {
    background: #f0f0f0;
}
.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}
.entry {
    font-size: 0.8em;
    margin-bottom: 3px;
    background: #e9f7fe;
    padding: 2px;
    border-radius: 3px;
}
.entry .time {
    font-weight: bold;
}
.entry .hours {
    color: #666;
}
.entry .boat {
    font-size: 0.9em;
    color: #0066cc;
    font-style: italic;
    margin-left: 3px;
}
.entry a {
    text-decoration: none;
    color: #333;
    margin-left: 3px;
}
.day-total {
    font-weight: bold;
    border-top: 1px dashed #aaa;
    margin-top: 5px;
    padding-top: 3px;
    text-align: right;
}
.add-link {
    display: block;
    margin-top: 5px;
    font-size: 0.8em;
    text-align: center;
    background: #f0f0f0;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}
.empty {
    background: #f9f9f9;
}
.month-total {
    margin-top: 20px;
    font-size: 1.2em;
    text-align: right;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===== Forms (Add/Edit) ===== */
form {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 500px;
    margin-top: 20px;
}
form label {
    display: inline-block;
    width: 120px;
    margin-bottom: 10px;
}
form input[type="text"],
form input[type="date"],
form input[type="time"],
form input[type="number"],
form textarea,
form select {
    padding: 5px;
    width: 250px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}
form textarea {
    vertical-align: top;
    min-height: 60px;
}
form input[type="submit"] {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 125px;
}
form input[type="submit"]:hover {
    background: #0056b3;
}
form a {
    margin-left: 10px;
    color: #666;
    text-decoration: none;
}
form a:hover {
    text-decoration: underline;
}

/* Checkbox group (lunch/continuato) */
.checkbox-group {
    margin-left: 125px;
    margin-bottom: 10px;
}
.checkbox-group label {
    display: inline-block;
    width: auto;
    margin-right: 20px;
}
.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

/* Rate display area (read-only) */
.rate-display {
    margin-left: 125px;
    margin-bottom: 10px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 3px;
    max-width: 300px;
}
.rate-display label {
    width: auto;
    display: inline-block;
    margin-right: 10px;
}
.rate-display span {
    font-weight: bold;
    color: #28a745;
}

/* Info box (hints) */
.info-box {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #007bff;
    border-radius: 5px;
    max-width: 500px;
}
.info-box strong {
    color: #007bff;
}

/* "Other" boat/repertoire fields (legacy, but kept for compatibility) */
#boat_other_div,
#repertoire_other_div {
    margin-left: 125px;
    margin-bottom: 10px;
}
#boat_other_div input,
#repertoire_other_div input {
    width: 300px;
}

/* ===== Management Tables (Boats & Repertoires) ===== */
.list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.list-table th,
.list-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}
.list-table th {
    background: #f0f0f0;
    font-weight: bold;
}

/* Inline edit form inside table cells */
.list-table td form {
    display: inline-block;
    margin: 0;
    white-space: nowrap;  /* keep input+button on same line */
}
.list-table td form input[type="text"],
.list-table td form input[type="number"] {
    width: 150px;
    padding: 5px;
    margin-right: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}
.list-table td form button {
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 0.9em;
}
.list-table td form button:hover {
    background: #0056b3;
}

/* Delete link in actions column */
.list-table td a {
    color: #dc3545;
    text-decoration: none;
    margin-left: 5px;
    white-space: nowrap;
    font-size: 0.9em;
}
.list-table td a:hover {
    text-decoration: underline;
}

/* Add new boat/repertoire form (above the table) */
.inline-form {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inline-form input[type="text"],
.inline-form input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 250px;
}
.inline-form button {
    padding: 8px 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
.inline-form button:hover {
    background: #218838;
}

/* ===== Print Styles (minimal) ===== */
@media print {
    .navbar,
    .navigation,
    .no-print,
    .add-link,
    .entry a {
        display: none;
    }
    body {
        background: white;
        padding: 0;
    }
    .calendar {
        box-shadow: none;
    }
    .month-total {
        box-shadow: none;
    }
}
