/**
 * Ezy Car Rentals - Enhanced Booking Form Styles v2.0
 * Date Range Picker + Auto-Flow Navigation
 */

/* ================================
   DATE RANGE PICKER
   ================================ */

.ezycr-daterange-picker {
    position: relative;
    width: 100%;
}

.ezycr-daterange-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ezycr-daterange-input:hover {
    border-color: #cbd5e1;
}

.ezycr-daterange-picker.open .ezycr-daterange-input {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ezycr-daterange-field {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ezycr-daterange-field.has-value {
    background: #eff6ff;
}

.ezycr-daterange-icon {
    font-size: 24px;
}

.ezycr-daterange-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ezycr-daterange-label small {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.ezycr-daterange-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.ezycr-daterange-arrow {
    font-size: 20px;
    color: #94a3b8;
    flex-shrink: 0;
}

.ezycr-daterange-duration {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Calendar Dropdown */
.ezycr-calendar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.ezycr-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ezycr-cal-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ezycr-cal-nav:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ezycr-cal-months {
    display: flex;
    gap: 40px;
}

.ezycr-cal-month-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

/* Calendar Body */
.ezycr-calendar-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}

.ezycr-calendar-grid {
    min-width: 0;
}

.ezycr-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.ezycr-cal-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    padding: 8px 0;
}

.ezycr-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ezycr-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.ezycr-cal-day:hover:not(.disabled) {
    background: #f1f5f9;
}

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

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

.ezycr-cal-day.past {
    color: #e2e8f0;
    text-decoration: line-through;
}

.ezycr-cal-day.blocked {
    background: #fef2f2;
    color: #fca5a5;
}

.ezycr-cal-day.today {
    border: 2px solid #3b82f6;
}

.ezycr-cal-day.start {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 8px 0 0 8px;
}

.ezycr-cal-day.end {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 0 8px 8px 0;
}

.ezycr-cal-day.start.end {
    border-radius: 8px;
}

.ezycr-cal-day.in-range {
    background: #dbeafe;
    color: #1e40af;
    border-radius: 0;
}

.ezycr-cal-day.preview-range {
    background: #eff6ff;
    border-radius: 0;
}

/* Calendar Footer */
.ezycr-calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.ezycr-calendar-legend {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #64748b;
}

.ezycr-calendar-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ezycr-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.ezycr-legend-dot.start,
.ezycr-legend-dot.end {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.ezycr-legend-dot.range {
    background: #dbeafe;
}

.ezycr-calendar-actions {
    display: flex;
    gap: 12px;
}

.ezycr-cal-clear,
.ezycr-cal-apply {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ezycr-cal-clear {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.ezycr-cal-clear:hover {
    background: #f1f5f9;
}

.ezycr-cal-apply {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: white;
}

.ezycr-cal-apply:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.ezycr-cal-apply:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Min days notice */
.ezycr-calendar-min-notice {
    padding: 12px 20px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #dbeafe;
}

.ezycr-calendar-min-notice.error {
    background: #fef2f2;
    color: #dc2626;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ================================
   TIME PICKER
   ================================ */

.ezycr-time-picker-section {
    margin-top: 20px;
}

.ezycr-time-picker-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ezycr-time-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ezycr-time-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ezycr-time-select {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.ezycr-time-select:hover {
    border-color: #cbd5e1;
}

.ezycr-time-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ================================
   AUTO-FLOW NAVIGATION
   ================================ */

.ezycr-field-highlight {
    animation: fieldHighlight 1s ease;
}

@keyframes fieldHighlight {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: none; }
}

.ezycr-auto-advance {
    transition: all 0.3s ease;
}

.ezycr-auto-advance.completed {
    opacity: 0.7;
}

.ezycr-auto-advance.completed::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-weight: bold;
}

/* Progress indicator */
.ezycr-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ================================
   SIMPLIFIED FORM STYLES
   ================================ */

.ezycr-form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.ezycr-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ezycr-form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ezycr-form-section-title .section-icon {
    font-size: 24px;
}

/* Optional fields toggle */
.ezycr-optional-fields-toggle {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #e2e8f0;
}

.ezycr-optional-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.ezycr-optional-toggle-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.ezycr-optional-toggle-btn .toggle-icon {
    transition: transform 0.2s ease;
}

.ezycr-optional-toggle-btn.open .toggle-icon {
    transform: rotate(180deg);
}

.ezycr-optional-fields {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.ezycr-optional-fields.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .ezycr-daterange-input {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ezycr-daterange-field {
        flex: 1 1 100%;
    }
    
    .ezycr-daterange-arrow {
        display: none;
    }
    
    .ezycr-daterange-duration {
        width: 100%;
        text-align: center;
    }
    
    .ezycr-calendar-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ezycr-cal-months {
        gap: 20px;
    }
    
    #ezycr-cal-month-2,
    #ezycr-cal-grid-2 {
        display: none;
    }
    
    .ezycr-calendar-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ezycr-calendar-footer {
        flex-direction: column;
        gap: 16px;
    }
    
    .ezycr-calendar-actions {
        width: 100%;
    }
    
    .ezycr-cal-clear,
    .ezycr-cal-apply {
        flex: 1;
    }
    
    .ezycr-time-picker-row {
        grid-template-columns: 1fr;
    }
}

/* ================================
   PICK UP POINT (renamed from Meeting Point)
   ================================ */

.ezycr-pickup-point-section {
    margin-bottom: 24px;
}

.ezycr-pickup-point-select {
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ezycr-pickup-point-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
