/**
 * Frontend Styles
 */

/* Container spacing */
.crb-cars-archive .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

@media (max-width: 768px) {
    .crb-cars-archive .container {
        padding: 40px 20px;
    }
    
    .crb-hero-title {
        font-size: 36px;
        letter-spacing: 2px;
    }
    
    .crb-hero-section {
        height: 350px;
    }
}

/* Hero Section */
.crb-hero-section {
    position: relative;
    height: 350px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
    overflow: hidden;
}

/* Ensure My Bookings hero section displays correctly */
.crb-my-bookings .crb-hero-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 350px;
}

.crb-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a1a;
    z-index: 0;
}

.crb-hero-section.has-bg-image::before {
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3));
    opacity: 0.7;
}

/* My Bookings hero - solid black, no image, no overlay */
.crb-my-bookings .crb-hero-section {
    background-image: none !important;
    background-color: #1a1a1a !important;
}

.crb-my-bookings .crb-hero-section::before {
    display: none !important;
}

/* Ensure My Bookings hero text is visible */
.crb-my-bookings .crb-hero-title {
    color: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.crb-my-bookings .crb-hero-overlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
}

.crb-hero-overlay {
    position: relative;
    z-index: 1;
    text-align: center;
}

.crb-hero-title {
    color: #fff;
    font-size: 56px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Section Header */
.crb-section-header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 20px;
}

.crb-section-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-weight: 500;
}

.crb-section-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Car Listing Grid */
.crb-cars-archive {
    padding: 0;
}

.crb-cars-listing {
    padding: 40px 0;
}

.crb-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.crb-car-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.crb-car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.crb-car-image {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    background: #f5f5f5;
}

.crb-car-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.crb-car-image-placeholder {
    width: 100%;
    height: 250px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.crb-car-card:hover .crb-car-image img {
    transform: scale(1.05);
}

.crb-car-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.crb-car-content {
    padding: 20px;
}

.crb-car-specs {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.crb-spec-item {
    font-size: 14px;
    color: #666;
}

.crb-spec-item strong {
    color: #333;
    margin-right: 5px;
}

.crb-additional-info {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
}

.crb-additional-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.crb-car-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.crb-car-title a {
    color: #333;
    text-decoration: none;
}

.crb-car-title a:hover {
    color: #000;
}

.crb-car-description {
    color: #666;
    font-size: 13px;
    margin: 0 0 15px 0;
    line-height: 1.5;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.crb-car-price {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.crb-rent-now-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.crb-rent-now-btn:hover {
    background: #000;
    color: #fff;
}

/* Filters */
.crb-car-filters {
    margin-bottom: 30px;
    text-align: center;
    display: none;
}

.crb-filter-select {
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Single Car Page */
.crb-single-car {
    padding: 40px 0;
}

.crb-single-car .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .crb-single-car .container {
        padding: 0 20px;
    }
}

.crb-car-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.crb-car-image-large img {
    width: 100%;
    border-radius: 8px;
}

/* Car Gallery Styles */
.crb-car-gallery {
    margin-bottom: 20px;
}

.crb-car-image-large {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.crb-car-image-large img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.crb-car-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.crb-thumbnail-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.crb-thumbnail-item:hover {
    opacity: 1;
    border-color: #0073aa;
}

.crb-thumbnail-item.active {
    opacity: 1;
    border-color: #0073aa;
    border-width: 3px;
}

.crb-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .crb-thumbnail-item {
        width: 60px;
        height: 60px;
    }
}

.crb-car-info {
    padding: 20px 0;
}

.crb-car-meta {
    margin: 15px 0;
}

.crb-meta-item {
    display: inline-block;
    margin-right: 15px;
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
}

.crb-car-pricing {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.crb-price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.crb-price-label {
    color: #666;
}

.crb-price-value {
    font-weight: bold;
    color: #333;
}

/* Booking Form */
.crb-booking-form-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.crb-booking-form {
    max-width: 600px;
}

.crb-form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.crb-form-section:last-child {
    border-bottom: none;
}

.crb-form-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.crb-date-picker-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.crb-date-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.crb-date-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.crb-price-calculation {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.crb-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crb-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.crb-price-row.crb-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #ddd;
    font-size: 20px;
    font-weight: bold;
}

.crb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.crb-form-field {
    margin-bottom: 20px;
}

.crb-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.crb-form-field input[type="text"],
.crb-form-field input[type="email"],
.crb-form-field input[type="tel"],
.crb-form-field textarea,
.crb-form-field input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.crb-form-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.crb-rental-agreement {
    margin-top: 15px;
}

.crb-download-link {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.crb-download-link:hover {
    background: #005a87;
}

#crb-stripe-payment-element {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    min-height: 100px;
}

#crb-stripe-payment-element:empty::before {
    content: 'Loading payment form...';
    color: #999;
    font-style: italic;
}

.crb-form-actions {
    margin-top: 30px;
}

.crb-submit-btn {
    width: 100%;
    padding: 15px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.crb-submit-btn:hover:not(:disabled) {
    background: #333;
}

.crb-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.crb-error-message {
    color: #d63638;
    background: #fcf0f1;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.crb-success-message {
    background: #d4edda;
    color: #155724;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.crb-success-message h3 {
    margin: 0 0 15px 0;
    color: #155724;
}

/* Responsive */
@media (max-width: 768px) {
    .crb-car-details {
        grid-template-columns: 1fr;
    }
    
    .crb-cars-grid {
        grid-template-columns: 1fr;
    }
    
    .crb-date-picker-wrapper,
    .crb-form-row {
        grid-template-columns: 1fr;
    }
}

/* Admin Actions Styles */
.crb-admin-actions {
    margin-top: 20px;
}

.crb-action-form {
    margin-bottom: 15px;
}

.crb-action-notes {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.crb-action-notes textarea,
.crb-action-notes input[type="number"] {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.crb-alert {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.crb-alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.crb-booking-details table {
    width: 100%;
    margin-bottom: 20px;
}

.crb-booking-details table th {
    width: 30%;
    padding: 10px;
    background: #f9f9f9;
    text-align: left;
}

.crb-booking-details table td {
    padding: 10px;
}

/* User Bookings Styles */
.crb-my-bookings {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* Hide page title if it appears above the shortcode */
.page .crb-my-bookings h1:first-child,
.page .crb-my-bookings h2:first-child,
.single .crb-my-bookings h1:first-child,
.single .crb-my-bookings h2:first-child,
.page .entry-title,
.page .page-title {
    display: none;
}

/* Ensure hero section is full width - break out of any container */
.crb-my-bookings {
    position: relative;
}

.crb-my-bookings .crb-hero-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0;
}

.crb-my-bookings .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

@media (max-width: 768px) {
    .crb-my-bookings .container {
        padding: 40px 20px;
    }
}

.crb-bookings-list {
    display: grid;
    gap: 20px;
}

.crb-booking-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.crb-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.crb-booking-header h3 {
    margin: 0;
}

.crb-booking-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.crb-booking-details-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.crb-booking-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.crb-booking-details-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.crb-booking-detail {
    font-size: 14px;
}

.crb-booking-actions {
    margin-top: 15px;
}

.crb-view-booking-details {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.crb-view-booking-details:hover {
    background: #005a87;
}

/* User Menu Styles */
.crb-user-menu {
    position: relative;
    display: inline-block;
}

.crb-user-menu-wrapper {
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
}

.crb-user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #000;
    font-weight: 500;
    text-transform: none;
    white-space: nowrap;
}

.crb-user-menu-trigger:hover {
    background: #f5f5f5;
}

.crb-user-name {
    font-weight: 500;
}

.crb-user-menu-icon {
    font-size: 10px;
    color: #000;
    transition: transform 0.2s;
}

.crb-user-menu.active .crb-user-menu-icon {
    transform: rotate(180deg);
}

.crb-user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.crb-user-menu.active .crb-user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.crb-menu-item {
    display: block;
    padding: 12px 16px;
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 14px;
}

.crb-menu-item:last-child {
    border-bottom: none;
}

.crb-menu-item:hover {
    background: #f5f5f5;
}

.crb-menu-item.crb-logout {
    color: #d63638;
}

.crb-menu-item.crb-logout:hover {
    background: #fff5f5;
}

.crb-menu-item span {
    display: block;
}

@media (max-width: 768px) {
    .crb-user-menu-wrapper {
        margin-left: 10px;
    }
    
    .crb-user-menu-trigger {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Read-only email field styling */
input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Admin Forms Styling */
.crb-additional-payment-form,
.crb-admin-notes-form {
    margin-top: 20px;
}

.crb-additional-payment-form h4,
.crb-admin-notes-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #23282d;
    font-size: 16px;
    font-weight: 600;
}

.crb-additional-payment-form label,
.crb-admin-notes-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.crb-additional-payment-form input[type="number"],
.crb-additional-payment-form textarea,
.crb-admin-notes-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.crb-additional-payment-form input[type="number"]:focus,
.crb-additional-payment-form textarea:focus,
.crb-admin-notes-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.crb-additional-payment-form textarea,
.crb-admin-notes-form textarea {
    resize: vertical;
    min-height: 80px;
}

.crb-additional-payment-form .button,
.crb-admin-notes-form .button {
    padding: 10px 20px;
    height: auto;
    min-height: 40px;
    white-space: nowrap;
    font-weight: 500;
}

/* Rental Agreement Modal */
.crb-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.crb-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.crb-modal-header {
    padding: 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.crb-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.crb-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.crb-modal-close:hover,
.crb-modal-close:focus {
    color: #000;
}

.crb-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* PDF embed in modal */
.crb-modal-body iframe {
    display: block;
    min-height: 500px;
}

.crb-modal-footer {
    padding: 20px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    text-align: right;
    border-radius: 0 0 8px 8px;
}

