/* styles.css */

/* Basic Reset and Layout */
.duty-hours {
    font-weight: bold;
}

.table-container {
    margin-top: 20px;
}

.trip-summary-card {
    margin-top: 20px;
}

.card-body textarea {
    resize: vertical;
}

.trip-entry-input {
    width: 50%;
}

/* Increase width of Round Trip Totals column and allow text wrapping */
#trips_table th:nth-child(10),
#trips_table td:nth-child(10),
#user_trips_table th:nth-child(10),
#user_trips_table td:nth-child(10) {
    width: 200px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    min-height: 50px;
}

/* Base Styles (Single Style, formerly Daylight) */
body {
    background-color: #f8f9fa;
    color: #333333;
}

.card {
    background-color: #ffffff;
    color: #333333;
}

.card-header {
    background-color: #e9ecef;
    color: #333333;
    position: relative;
}

.form-control,
.form-control:focus {
    background-color: #ffffff;
    color: #333333;
    border-color: #ced4da;
}

.form-control::placeholder {
    color: #6c757d;
}

.table thead th {
    background-color: #e9ecef;
    color: #333333;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #333333 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #ced4da !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: #333333;
}

/* Table Background and Stripes */
.table {
    background-color: transparent !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: transparent !important;
}

/* Remove border between outbound and inbound rows in paired round trips */
#trips_table tbody tr.trip-pair-1[data-trip-type="home_away"] + tr.trip-pair-1[data-trip-type="away_home"],
#trips_table tbody tr.trip-pair-2[data-trip-type="home_away"] + tr.trip-pair-2[data-trip-type="away_home"],
#user_trips_table tbody tr.trip-pair-1[data-trip-type="home_away"] + tr.trip-pair-1[data-trip-type="away_home"],
#user_trips_table tbody tr.trip-pair-2[data-trip-type="home_away"] + tr.trip-pair-2[data-trip-type="away_home"] {
    border-top: none !important;
}

#trips_table tbody tr.trip-pair-1[data-trip-type="home_away"],
#trips_table tbody tr.trip-pair-2[data-trip-type="home_away"],
#user_trips_table tbody tr.trip-pair-1[data-trip-type="home_away"],
#user_trips_table tbody tr.trip-pair-2[data-trip-type="home_away"] {
    border-bottom: none !important;
}

/* Trip Colors (Single Set) */
#trips_table tbody tr.trip-pair-1 td,
#user_trips_table tbody tr.trip-pair-1 td {
    background-color: #83938E !important; /* First color for complete round trips */
    color: #ffffff !important;
}

#trips_table tbody tr.trip-pair-2 td,
#user_trips_table tbody tr.trip-pair-2 td {
    background-color: #68757F !important; /* Second color for complete round trips */
    color: #ffffff !important;
}

#trips_table tbody tr.home-home td,
#user_trips_table tbody tr.home-home td {
    background-color: #83938E !important; /* Match trip-pair-1 for consistency */
    color: #ffffff !important;
}

/* Incomplete Trip Colors */
#trips_table tbody tr.unpaired-home-away td,
#user_trips_table tbody tr.unpaired-home-away td {
    background-color: #dfc27d !important; /* Light tan */
    color: #333333 !important;
}

#trips_table tbody tr.unpaired-away-home td,
#user_trips_table tbody tr.unpaired-away-home td {
    background-color: #e6d5a7 !important; /* Slightly lighter tan */
    color: #333333 !important;
}

#trips_table tbody tr.away-away td,
#user_trips_table tbody tr.away-away td {
    background-color: #ff1030 !important; 
    color: #ffffff !important;
}

/* Video Container Styling */
.video-container {
    width: 100%;
}

.video-container iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .video-container iframe {
        height: 200px;
    }
}

/* Input Group and Save Button Styling from index.php */
.input-group {
    position: relative;
}

.save-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    border: none;
    background: none;
    padding: 5px;
    cursor: pointer;
    color: red;
}

.saved-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.saved-item-btn {
    position: relative;
    padding: 2px 20px 2px 8px;
    font-size: 0.9em;
}

.saved-item-btn .remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0 4px;
    font-size: 0.8em;
    line-height: 1;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
}

/* Help Icon and Button Styling */
.help-icon {
    position: relative;
    z-index: 10;
    cursor: pointer;
    font-size: 1em;
    padding: 0.1rem 0.3rem;
    line-height: 1.1;
    min-width: unset;
    margin-left: 5px;
}

.help-icon:hover {
    color: #0056b3;
}

/* Use flexbox to align title on left and buttons on right in card header */
.card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.card-header > *:first-child:not(.help-icon) {
    flex: 1;
    text-align: left;
}

/* Group help buttons together on the right with a container effect */
.card-header .help-icon {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

/* Ensure buttons stay together on the right */
.card-header::after {
    content: "";
    flex: 0 0 auto;
    display: none; /* Fallback for older browsers */
}

.card-header {
    justify-content: flex-start;
}

.card-header .help-icon:first-of-type {
    margin-left: auto;
}

/* Admin Page Styling */
#user_trips_container {
    display: none;
}

#trip_parse_status {
    display: none;
}
