/**
 * Public-facing styles for WP Car Rental.
 *
 * @since      1.0.0
 * @package    WP_Car_Rental
 * @subpackage WP_Car_Rental/public/css
 */

/* General Styles */
.wpcr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wpcr-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.wpcr-col {
    flex: 1;
    padding: 0 15px;
    min-width: 250px;
}

.wpcr-section {
    margin-bottom: 30px;
}

.wpcr-section-title {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Alerts and Notices */
.wpcr-notice {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wpcr-notice.wpcr-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpcr-notice.wpcr-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wpcr-notice.wpcr-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.wpcr-notice.wpcr-info {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* Login Notice */
.wpcr-login-notice {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Status Badges */
.wpcr-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 600;
}

.wpcr-status-badge.booked {
    background-color: #e2e3e5;
    color: #383d41;
}

.wpcr-status-badge.active {
    background-color: #cce5ff;
    color: #004085;
}

.wpcr-status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

.wpcr-status-badge.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Vehicle Listing */
.wpcr-vehicle-listing {
    margin-bottom: 30px;
}

.wpcr-vehicle-filters {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.wpcr-vehicle-filter-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    align-items: center;
}

.wpcr-vehicle-filter-item {
    flex: 1;
    padding: 0 10px;
    margin-bottom: 10px;
    min-width: 150px;
}

.wpcr-vehicle-filter-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.wpcr-vehicle-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.wpcr-vehicle-item {
    flex: 0 0 calc(33.333% - 30px);
    margin: 0 15px 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 992px) {
    .wpcr-vehicle-item {
        flex: 0 0 calc(50% - 30px);
    }
}

@media (max-width: 576px) {
    .wpcr-vehicle-item {
        flex: 0 0 calc(100% - 30px);
    }
}

.wpcr-vehicle-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wpcr-vehicle-image {
    height: 200px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wpcr-vehicle-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.wpcr-vehicle-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0073aa;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.wpcr-vehicle-details {
    padding: 15px;
}

.wpcr-vehicle-title {
    font-size: 1.25em;
    margin: 0 0 10px;
    font-weight: 600;
}

.wpcr-vehicle-meta {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #6c757d;
}

.wpcr-vehicle-meta span {
    display: inline-block;
    margin-right: 10px;
}

.wpcr-vehicle-price {
    font-size: 1.2em;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 15px;
}

.wpcr-vehicle-actions {
    display: flex;
    justify-content: space-between;
}

.wpcr-vehicle-actions .button {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-weight: 600;
}

.wpcr-vehicle-actions .button-primary {
    background-color: #0073aa;
    color: white;
    border: 1px solid #0073aa;
}

.wpcr-vehicle-actions .button-primary:hover {
    background-color: #005177;
}

.wpcr-vehicle-actions .button-secondary {
    background-color: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
    margin-left: 10px;
}

.wpcr-vehicle-actions .button-secondary:hover {
    background-color: #f2f2f2;
}

/* Booking Form */
.wpcr-booking-form {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-bottom: 30px;
}

.wpcr-booking-form-title {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.wpcr-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
}

.wpcr-form-field {
    flex: 1;
    padding: 0 10px;
    margin-bottom: 15px;
    min-width: 200px;
}

.wpcr-form-field-full {
    flex: 0 0 100%;
}

.wpcr-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.wpcr-form-field input[type="text"],
.wpcr-form-field input[type="number"],
.wpcr-form-field input[type="date"],
.wpcr-form-field select,
.wpcr-form-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.wpcr-form-field input:focus,
.wpcr-form-field select:focus,
.wpcr-form-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

.wpcr-form-field .required {
    color: #dc3232;
}

.wpcr-form-note {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 5px;
}

.wpcr-form-actions {
    margin-top: 20px;
}

.wpcr-form-actions button {
    padding: 10px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.wpcr-form-actions button:hover {
    background-color: #005177;
}

.wpcr-booking-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.wpcr-booking-summary-title {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2em;
}

.wpcr-booking-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #eee;
}

.wpcr-booking-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.wpcr-booking-label {
    font-weight: 600;
}

.wpcr-booking-cost {
    font-size: 1.2em;
    font-weight: 600;
    color: #0073aa;
}

/* User Bookings */
.wpcr-user-bookings {
    margin-bottom: 30px;
}

.wpcr-booking-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.wpcr-booking-table th,
.wpcr-booking-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wpcr-booking-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.wpcr-booking-table tr:hover {
    background-color: #f8f9fa;
}

.wpcr-booking-table .button {
    padding: 5px 10px;
    background-color: #dc3232;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.wpcr-booking-table .button:hover {
    background-color: #a82424;
}

.wpcr-no-bookings {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .wpcr-booking-table,
    .wpcr-booking-table thead,
    .wpcr-booking-table tbody,
    .wpcr-booking-table th,
    .wpcr-booking-table td,
    .wpcr-booking-table tr {
        display: block;
    }
    
    .wpcr-booking-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .wpcr-booking-table tr {
        border: 1px solid #ddd;
        margin-bottom: 15px;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .wpcr-booking-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }
    
    .wpcr-booking-table td:before {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
    }
    
    /* Add labels for each td */
    .wpcr-booking-table td:nth-of-type(1):before { content: "ID"; }
    .wpcr-booking-table td:nth-of-type(2):before { content: "Vehicle"; }
    .wpcr-booking-table td:nth-of-type(3):before { content: "Dates"; }
    .wpcr-booking-table td:nth-of-type(4):before { content: "Status"; }
    .wpcr-booking-table td:nth-of-type(5):before { content: "Total"; }
    .wpcr-booking-table td:nth-of-type(6):before { content: "Actions"; }
}

/* Success Page */
.wpcr-booking-success {
    text-align: center;
    padding: 30px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 4px;
    margin-bottom: 30px;
}

.wpcr-booking-success h2 {
    color: #155724;
}

.wpcr-booking-success p {
    margin-bottom: 20px;
}

.wpcr-booking-success .button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #155724;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.wpcr-booking-success .button:hover {
    background-color: #0f3d17;
}

/* Vehicle Single View */
.wpcr-vehicle-single {
    margin-bottom: 30px;
}

.wpcr-vehicle-gallery {
    margin-bottom: 20px;
}

.wpcr-vehicle-main-image {
    height: 400px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
}

.wpcr-vehicle-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.wpcr-vehicle-thumbnails {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.wpcr-vehicle-thumbnail {
    width: 80px;
    height: 60px;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.wpcr-vehicle-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpcr-vehicle-info {
    margin-bottom: 20px;
}

.wpcr-vehicle-info-title {
    font-size: 1.8em;
    margin: 0 0 15px;
}

.wpcr-vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.wpcr-vehicle-spec {
    flex: 0 0 25%;
    padding: 0 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .wpcr-vehicle-spec {
        flex: 0 0 50%;
    }
}

.wpcr-vehicle-spec-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
}

.wpcr-vehicle-spec-value {
    display: block;
    font-weight: 600;
}

.wpcr-vehicle-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

.wpcr-vehicle-features {
    margin-bottom: 20px;
}

.wpcr-vehicle-features-title {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.wpcr-vehicle-features-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.wpcr-vehicle-feature {
    flex: 0 0 33.333%;
    padding: 5px 10px;
}

@media (max-width: 768px) {
    .wpcr-vehicle-feature {
        flex: 0 0 50%;
    }
}

@media (max-width: 576px) {
    .wpcr-vehicle-feature {
        flex: 0 0 100%;
    }
}

/* Calendar Availability */
.wpcr-availability-calendar {
    margin-bottom: 30px;
}

.wpcr-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wpcr-calendar-title {
    font-size: 1.2em;
    font-weight: 600;
}

.wpcr-calendar-nav {
    display: flex;
    gap: 10px;
}

.wpcr-calendar-nav button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.wpcr-calendar-nav button:hover {
    background-color: #f2f2f2;
}

.wpcr-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.wpcr-calendar-day {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.wpcr-calendar-day.unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

.wpcr-calendar-day.available {
    background-color: #d4edda;
    color: #155724;
}

.wpcr-calendar-day.today {
    font-weight: 600;
    border-color: #0073aa;
}

.wpcr-calendar-day.other-month {
    color: #aaa;
    background-color: #f8f9fa;
}

.wpcr-calendar-weekday {
    text-align: center;
    font-weight: 600;
    padding: 5px 0;
}

/* Loader Animation */
.wpcr-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: wpcr-spin 1s ease-in-out infinite;
}

@keyframes wpcr-spin {
    to { transform: rotate(360deg); }
}
