/* General Body and Page Layout */


/* Main Trip Details Container */
.trip-details {
    /* max-width: 900px;  Consistent width with vehicle details */
    /* margin: 30px auto; */
    padding: 30px;
    /* background-color: #ffffff; */
    /* border-radius: 12px; */
    /* box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); */
}

/* Page Title */
.trip-details__title {
    font-size: 2.2rem;
    color: #1e1e2d;
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 700;
    text-align: center;
}

/* Trip Details Table */
.trip-details__table,
.driver-details table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden; /* Ensures rounded corners */
    border: 1px solid #e0e0e0; /* Subtle border around the table */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.image{
    height: 80px;
}
.trip-details__table th,
.trip-details__table td,
.driver-details th,
.driver-details td {
    padding: 15px 20px;
    text-align: left; /* Align text left within cells */
    border-bottom: 1px solid #e9ecef; /* Light border between rows */
}

.trip-details__table tr:last-child th,
.trip-details__table tr:last-child td,
.driver-details tr:last-child th,
.driver-details tr:last-child td {
    border-bottom: none; /* No border for the last row */
}

.trip-details__table th,
.driver-details th {
    font-weight: 600;
    /* color: #495057; */
    background-color: #f8f9fa; /* Light background for headers */
    width: 35%; /* Allocate space for labels */
    vertical-align: top; /* Align labels to the top */
}

.trip-details__table td,
.driver-details td {
    font-weight: 400;
    color: #333;
    word-break: break-word; /* Ensure long text wraps */
}

/* Driver Info Section */
h3 {
    font-size: 1.8rem;
    color: #1e1e2d;
    margin-top: 40px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.driver-details {
    display: flex;
    flex-direction: column; /* Stack image and table on mobile first */
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 25px;
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #cfe2ff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.driver-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Circular photo */
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.driver-details table {
    flex-grow: 1; /* Allow table to take available space */
    margin-bottom: 0; /* Remove extra margin */
}

.no-driver-info {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #e9ecef;
    margin-top: 20px;
    font-style: italic;
}

/* Back Link */
.trip-details__back {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #e0e0e0;
}

.trip-details__back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.trip-details__back a:hover {
    color: #0056b3;
    transform: translateX(-5px); /* Subtle slide effect */
}

/* Responsive adjustments */
@media screen and (min-width: 769px) {
    .driver-details {
        flex-direction: row; /* Side-by-side on larger screens */
        align-items: flex-start; /* Align content to the top */
    }

    .driver-photo {
        flex-shrink: 0; /* Prevent photo from shrinking */
    }

    .driver-details table {
        margin-left: 20px; /* Space between photo and table */
    }
}

@media screen and (max-width: 768px) {
    .trip-details {
        margin: 20px;
        padding: 20px;
        border-radius: 8px;
    }

    .trip-details__title {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .trip-details__table th,
    .trip-details__table td,
    .driver-details th,
    .driver-details td {
        display: block; /* Stack table header and data */
        width: 100%;
        box-sizing: border-box;
        text-align: right;
        padding-left: 45%; /* Space for data-label */
        position: relative;
    }

    .trip-details__table th::before,
    .driver-details th::before {
        content: attr(data-label); /* Use data-label for pseudo-element */
        position: absolute;
        left: 15px;
        width: calc(45% - 30px);
        text-align: left;
        font-weight: 700;
        color: #555;
    }
     .trip-details__table thead,
     .driver-details thead {
        /* Hide the original table headers on small screens */
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
     }

    .trip-details__table tr,
    .driver-details tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        display: block; /* Ensure rows behave as blocks */
    }

    .trip-details__table td:last-child,
    .driver-details td:last-child {
        border-bottom: none;
        display: flex;
        
    }

    h3 {
        font-size: 1.6rem;
        margin-top: 30px;
        margin-bottom: 20px;
    }

    .driver-details {
        padding: 15px;
    }

    .driver-photo {
        margin-bottom: 20px;
        width: 120px;
        height: 120px;
    }

    .trip-details__back {
        margin-top: 30px;
        padding-top: 15px;
    }

    .trip-details__back a {
        font-size: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .trip-details {
        margin: 10px;
        padding: 15px;
    }

    .trip-details__title {
        font-size: 1.6rem;
        text-align: left;
    }

    .trip-details__table th,
    .trip-details__table td,
    .driver-details th,
    .driver-details td {
        font-size: 0.9rem;
        padding: 12px 10px;
        display: flex;
    }

    .trip-details__table th::before,
    .driver-details th::before {
        font-size: 0.85rem;
        left: 10px;
        width: calc(40% - 20px);
    }

    h3 {
        font-size: 1.4rem;
    }

    .driver-photo {
        width: 100px;
        height: 100px;
    }

    .trip-details__back a {
        font-size: 0.95rem;
    }
}
