/* ==========================================================================
   CAR RENTAL PREMIUM CSS (FRONTEND WIZARD & ADMIN PANELS)
   ========================================================================== */

/* --- Core variables & Themes --- */
:root {
    --cr-primary: #0a84ff;
    --cr-primary-hover: #0066cc;
    --cr-bg-card: rgba(255, 255, 255, 0.9);
    --cr-border: rgba(0, 0, 0, 0.08);
    --cr-shadow: 0 10px 35px rgba(0, 0, 0, 0.04);
    --cr-radius: 16px;
    --cr-text: #1f2937;
    --cr-text-muted: #6b7280;
    --cr-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 247, 250, 0.85) 100%);
}

/* --- Frontend Booking Wizard Container --- */
.cr-wizard {
    max-width: 900px;
    margin: 30px auto;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--cr-glass-bg);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    padding: 30px;
    box-shadow: var(--cr-shadow);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cr-wizard:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.cr-wizard h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--cr-text);
    margin-top: 0;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
    text-align: center;
}

.cr-wizard h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cr-text);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 10px;
}

/* --- Steps Indicators --- */
.cr-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 0 10px;
    position: relative;
}

.cr-steps-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e5e7eb;
    z-index: 1;
    transform: translateY(-50%);
}

.cr-step-indicator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    color: var(--cr-text-muted);
    font-size: 12px;
    font-weight: 600;
    position: relative;
    cursor: default;
    transition: all 0.3s ease;
}

.cr-step-indicator-item span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--cr-text-muted);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.cr-step-indicator-item.active {
    color: var(--cr-primary);
}

.cr-step-indicator-item.active span {
    background: var(--cr-primary);
    border-color: var(--cr-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

.cr-step-indicator-item.completed span {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

@media (max-width: 600px) {
    .cr-step-indicator-item {
        font-size: 10px;
    }
    .cr-step-indicator-item span {
        width: 26px;
        height: 26px;
        font-size: 12px;
        margin-bottom: 4px;
    }
    .cr-steps-indicator::before {
        height: 2px;
    }
}

/* --- Cars Fleet View --- */
.cr-cars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.cr-car {
    background: #ffffff;
    border: 1px solid var(--cr-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.01);
}

.cr-car:hover, .cr-car.selected-active {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--cr-primary);
}

.cr-car-img-wrapper {
    width: 100%;
    height: 150px;
    background: #f3f4f6;
    overflow: hidden;
    position: relative;
}

.cr-car-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cr-car:hover .cr-car-img-wrapper img {
    transform: scale(1.05);
}

.cr-placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #9ca3af;
    background: #e5e7eb;
}

.cr-car-details {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cr-car-details h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cr-text);
}

.cr-car-meta-brand {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--cr-text-muted);
}

.cr-car-specs-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #4b5563;
}

.cr-car-specs-grid span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cr-car-specs-grid .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--cr-text-muted);
}

.cr-car-price-tag {
    margin-top: auto;
    font-size: 13px;
    color: var(--cr-text-muted);
    margin-bottom: 12px;
}

.cr-car-price-tag .price {
    font-size: 18px;
    font-weight: 800;
    color: var(--cr-primary);
}

.cr-book-single {
    width: 100%;
    padding: 16px 24px !important;
    font-size: 16px !important;
}

.cr-shortcode-copy {
    display: flex;
    gap: 6px;
}

.cr-shortcode-box {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
    padding: 4px 6px;
    background: #f8fafc;
    border: 1px solid var(--cr-border, #e5e7eb);
    border-radius: 4px;
}

/* --- Form Fields & Grid Layout --- */
.cr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.cr-availability-cal {
    grid-column: 1 / -1;
    border: 1px solid var(--cr-border, #e5e7eb);
    border-radius: 10px;
    padding: 14px 16px 12px;
    box-sizing: border-box;
    max-width: 320px;
}

.cr-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cr-cal-title {
    font-weight: 600;
    font-size: 14px;
}

.cr-cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--cr-text, #1f2937);
}

.cr-cal-nav:hover {
    background: #f1f5f9;
}

.cr-cal-weekdays,
.cr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.cr-cal-weekdays span {
    font-size: 11px;
    font-weight: 600;
    color: var(--cr-text-muted, #6b7280);
    padding: 4px 0;
}

.cr-cal-day {
    position: relative;
    font-size: 13px;
    padding: 7px 0;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.cr-cal-day:hover:not(.cr-cal-day-disabled):not(.cr-cal-day-booked):not(.cr-cal-day-empty) {
    background: #eef2ff;
}

.cr-cal-day-empty {
    cursor: default;
}

.cr-cal-day-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.cr-cal-day-today {
    font-weight: 700;
    text-decoration: underline;
}

.cr-cal-day-selected {
    background: #2563eb;
    color: #fff;
}

.cr-cal-day-in-range {
    background: #dbeafe;
}

.cr-cal-day-booked {
    color: #ef4444;
    text-decoration: line-through;
    cursor: not-allowed;
    background: #fef2f2;
}

.cr-cal-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--cr-text-muted, #6b7280);
}

.cr-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cr-cal-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.cr-cal-dot-booked {
    background: #ef4444;
}

@media (max-width: 550px) {
    .cr-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.cr-form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cr-form input, .cr-form select, .cr-form textarea {
    margin-top: 6px;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: var(--cr-text);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    background-color: #ffffff;
}

.cr-form input:focus, .cr-form select:focus, .cr-form textarea:focus {
    border-color: var(--cr-primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.cr-form input[type="date"] {
    color-scheme: light;
}

.cr-days-readout {
    grid-column: 1 / -1;
    background: rgba(10, 132, 255, 0.05);
    border: 1px solid rgba(10, 132, 255, 0.12);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 13px;
    color: var(--cr-text-muted);
    margin-top: -8px;
    margin-bottom: 4px;
}

.cr-days-readout strong {
    color: var(--cr-primary);
    font-weight: 700;
}

.cr-seats-hint {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--cr-text-muted);
    margin: -6px 0 0;
}

/* --- Add-ons & Activities Checklist --- */
.cr-activities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.cr-activity-checkbox-card {
    background: #ffffff;
    border: 1px solid var(--cr-border);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    margin-bottom: 0 !important;
    transition: all 0.25s ease;
}

.cr-activity-checkbox-card:hover {
    border-color: var(--cr-primary);
    background-color: rgba(10, 132, 255, 0.01);
}

.cr-activity-checkbox-card input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    cursor: pointer;
}

.cr-activity-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    font-size: 14px;
    color: var(--cr-text);
}

.cr-activity-info strong {
    font-weight: 600;
}

.cr-activity-info .price-val {
    color: var(--cr-primary);
    font-weight: 700;
}

/* --- Summary Details Card --- */
.cr-summary-card {
    background: rgba(10, 132, 255, 0.03);
    border: 1px solid rgba(10, 132, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.cr-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cr-summary li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.06);
    font-size: 14px;
    color: #4b5563;
}

.cr-summary li:last-child {
    border-bottom: none;
    font-weight: 800;
    font-size: 18px;
    color: var(--cr-text);
    padding-top: 15px;
    margin-top: 5px;
}

/* --- Control Buttons --- */
.cr-controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
}

.cr-wizard .button {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cr-wizard .button.cr-next, .cr-wizard .button.cr-submit, .cr-wizard .button.cr-select-car {
    background-color: var(--cr-primary);
    color: #ffffff;
}

.cr-wizard .button.cr-next:hover, .cr-wizard .button.cr-submit:hover, .cr-wizard .button.cr-select-car:hover {
    background-color: var(--cr-primary-hover);
}

.cr-wizard .button.cr-prev {
    background-color: #e5e7eb;
    color: #4b5563;
}

.cr-wizard .button.cr-prev:hover {
    background-color: #d1d5db;
}

/* ==========================================================================
   ADMIN DASHBOARD & CRUD STYLING RULES
   ========================================================================== */
.cr-admin-wrap {
    margin: 20px 20px 0 0;
}

.cr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.cr-stat-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.cr-stat-card .stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    background: rgba(10, 132, 255, 0.08);
    color: var(--cr-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.cr-stat-card .stat-icon .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.cr-stat-card .stat-info h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.cr-stat-card .stat-info p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--cr-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Admin Grid Split Layout */
.cr-grid-container {
    display: grid;
    gap: 24px;
    align-items: start;
}

.cr-grid-container.split-col {
    grid-template-columns: 350px 1fr;
}

.cr-grid-container.single-col {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .cr-grid-container.split-col {
        grid-template-columns: 1fr;
    }
}

/* Admin forms cards details */
.cr-card-form.postbox {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
}

.cr-card-form .hndle {
    font-size: 15px;
    font-weight: 700;
    padding: 15px;
    background: #fafafa;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cr-card-form .inside {
    padding: 20px;
    margin: 0;
}

.cr-form-field {
    margin-bottom: 15px;
}

.cr-form-field label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 5px;
}

.cr-form-field input, .cr-form-field select, .cr-form-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.cr-form-field input:focus, .cr-form-field select:focus, .cr-form-field textarea:focus {
    border-color: var(--cr-primary);
}

.cr-form-field.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.cr-form-field.checkbox-field input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.cr-form-row {
    display: flex;
    gap: 12px;
}

.cr-form-row .cr-form-field {
    flex: 1;
}

.cr-form-submit {
    margin-top: 20px;
}

/* Status badging and tables styling in Admin */
.cr-status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.cr-status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background-color: #fef3c7; color: #92400e; }
.status-confirmed { background-color: #d1fae5; color: #065f46; }
.status-completed { background-color: #dbeafe; color: #1e40af; }
.status-cancelled { background-color: #fee2e2; color: #991b1b; }

.required {
    color: #ef4444;
}

.cr-terms-box {
    margin-top: 20px;
    border: 1px solid var(--cr-border, #e5e7eb);
    border-radius: 10px;
    padding: 16px 18px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.cr-terms-box h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.cr-terms-text {
    max-height: 180px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--cr-text-muted);
    line-height: 1.6;
    padding-right: 6px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

/* !important is used below because some themes apply global resets to
   label/input (centering inputs, floats, inline-flex labels) that otherwise
   knock the checkbox + text out of normal flow and push the text outside
   the bordered box. */
.cr-terms-agree {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    direction: ltr;
    align-items: flex-start !important;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
    float: none !important;
}

.cr-terms-agree input[type="checkbox"] {
    order: -1;
    margin: 2px 0 0 !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    float: none !important;
}

.cr-terms-agree-text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
}

.cr-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cr-image-upload-field .cr-image-preview {
    width: 220px;
    height: 140px;
    border: 1px dashed #c3c4c7;
    border-radius: 6px;
    background: #f6f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.cr-image-upload-field .cr-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cr-image-upload-field .cr-no-image {
    font-size: 12px;
    color: #8c8f94;
}

/* ==========================================================================
   MOBILE POLISH (small phones)
   ========================================================================== */
@media (max-width: 600px) {
    .cr-wizard {
        margin: 12px auto;
        padding: 16px;
        border-radius: 12px;
    }

    .cr-wizard h2 {
        font-size: 19px;
        margin-bottom: 18px;
    }

    .cr-wizard h3 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .cr-steps-indicator {
        padding: 0;
    }

    .cr-steps-indicator::before {
        left: 24px;
        right: 24px;
    }

    /* 16px stops iOS Safari from auto-zooming the page on focus */
    .cr-form input,
    .cr-form select,
    .cr-form textarea {
        font-size: 16px;
        padding: 10px 12px;
    }

    .cr-form-grid {
        gap: 14px;
        margin-bottom: 20px;
    }

    .cr-cars {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cr-car-img-wrapper {
        height: 130px;
    }

    .cr-summary-card,
    .cr-terms-box {
        padding: 14px;
    }

    .cr-terms-text {
        max-height: 140px;
    }

    .cr-controls {
        flex-wrap: wrap;
    }

    .cr-controls .button {
        flex: 1 1 auto;
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .cr-book-single {
        font-size: 15px !important;
        padding: 14px 20px !important;
    }
}
