/**
 * Frontend styles for REVENTOR Calendar Appointment Booking
 */

.reventorcab-booking-form {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

/* Form Header */
.reventorcab-form-header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
    position: relative;
}

.reventorcab-form-header h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
}

.reventorcab-progress-container {
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.reventorcab-progress-bar {
    height: 100%;
    background: #fff;
    width: 25%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Steps Indicator */
.reventorcab-steps-indicator {
    display: flex;
    justify-content: space-between;
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.reventorcab-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.reventorcab-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.reventorcab-step.active:not(:last-child)::after,
.reventorcab-step.completed:not(:last-child)::after {
    background: #007cba;
}

.reventorcab-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.reventorcab-step.active .reventorcab-step-number {
    background: #007cba;
    color: #fff;
}

.reventorcab-step.completed .reventorcab-step-number {
    background: #28a745;
    color: #fff;
}

.reventorcab-step-label {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

.reventorcab-step.active .reventorcab-step-label {
    color: #007cba;
    font-weight: 600;
}

/* Form Steps */
.reventorcab-form {
    position: relative;
}

.reventorcab-form-step {
    display: none;
    padding: 40px;
    min-height: 400px;
}

.reventorcab-form-step.active {
    display: block;
}

.reventorcab-step-content {
    margin-bottom: 40px;
}

.reventorcab-step-content h4 {
    color: #1d2327;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 25px 0;
    text-align: center;
}

/* Service Selection */
.reventorcab-service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.reventorcab-service-option {
    cursor: pointer;
    display: block;
}

.reventorcab-service-option input[type="radio"] {
    display: none;
}

.reventorcab-service-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.reventorcab-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #007cba;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.reventorcab-service-option:hover .reventorcab-service-card {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.15);
}

.reventorcab-service-option input:checked + .reventorcab-service-card {
    border-color: #007cba;
    background: rgba(0, 124, 186, 0.05);
}

.reventorcab-service-option input:checked + .reventorcab-service-card::before {
    transform: scaleX(1);
}

.reventorcab-service-icon {
    font-size: 24px;
    color: #007cba;
    margin-bottom: 8px;
}

.reventorcab-service-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.reventorcab-service-duration {
    font-size: 12px;
    color: #6c757d;
}

/* Date & Time Selection */
.reventorcab-datetime-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

.reventorcab-date-selection,
.reventorcab-time-selection {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
}

.reventorcab-date-selection label,
.reventorcab-time-selection label {
    font-weight: 600;
    color: #1d2327;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

.reventorcab-date-selection select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    height: 48px;
    box-sizing: border-box;
}

.reventorcab-date-selection select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.reventorcab-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    align-content: start;
    margin: 0;
}

.reventorcab-time-slot {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #1d2327;
    height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reventorcab-time-slot:hover {
    border-color: #007cba;
    background: rgba(0, 124, 186, 0.05);
    transform: translateY(-1px);
}

.reventorcab-time-slot.selected {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.reventorcab-time-slot.unavailable {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.reventorcab-no-date-selected {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 16px;
}

.reventorcab-no-date-selected .dashicons {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.reventorcab-loading-slots {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 16px;
}

/* Personal Information */
.reventorcab-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.reventorcab-form-group {
    display: flex;
    flex-direction: column;
}

.reventorcab-form-group-full {
    grid-column: 1 / -1;
}

.reventorcab-form-group label {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 8px;
    font-size: 14px;
}

.reventorcab-form-group .required {
    color: #dc3545;
}

.reventorcab-form-group input,
.reventorcab-form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.reventorcab-form-group input:focus,
.reventorcab-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.reventorcab-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Confirmation */
.reventorcab-confirmation-details {
    display: grid;
    gap: 25px;
}

.reventorcab-confirmation-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
}

.reventorcab-confirmation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.reventorcab-confirmation-header .dashicons {
    font-size: 20px;
    color: #007cba;
}

.reventorcab-confirmation-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.reventorcab-confirmation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.reventorcab-confirmation-row:last-child {
    border-bottom: none;
}

.reventorcab-confirmation-row strong {
    color: #1d2327;
    font-weight: 600;
}

.reventorcab-confirmation-row span {
    color: #6c757d;
    text-align: right;
}

/* Navigation Buttons */
.reventorcab-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* First step navigation - align Next button to the right */
#step-1 .reventorcab-step-navigation {
    justify-content: flex-end;
}

.reventorcab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
}

.reventorcab-btn-primary {
    background: #007cba;
    color: #fff;
}

.reventorcab-btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.reventorcab-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.reventorcab-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.reventorcab-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success State */
.reventorcab-success-content {
    text-align: center;
    padding: 40px 20px;
}

.reventorcab-success-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 20px;
}

.reventorcab-success-content h4 {
    color: #28a745;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.reventorcab-success-content p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.reventorcab-success-content .reventorcab-btn {
    margin: 0 auto;
    display: inline-flex;
}

/* Loading Overlay */
.reventorcab-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.reventorcab-loading-spinner {
    text-align: center;
}

.reventorcab-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reventorcab-loading-spinner p {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reventorcab-booking-form {
        margin: 10px;
        border-radius: 8px;
    }
    
    .reventorcab-form-header {
        padding: 20px;
    }
    
    .reventorcab-form-header h3 {
        font-size: 20px;
    }
    
    .reventorcab-steps-indicator {
        padding: 20px 15px;
    }
    
    .reventorcab-step-label {
        font-size: 10px;
    }
    
    .reventorcab-form-step {
        padding: 15px;
        min-height: 350px;
    }
    
    .reventorcab-service-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .reventorcab-service-card {
        padding: 12px;
        min-height: 30px;
        display: flex;
        align-items: center;
        text-align: center;
        justify-content: center;
    }
    
    .reventorcab-service-icon {
        font-size: 20px;
        margin-bottom: 0;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    .reventorcab-service-content {
        flex: 1;
    }
    
    .reventorcab-service-name {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .reventorcab-service-duration {
        font-size: 11px;
    }
    
    .reventorcab-datetime-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .reventorcab-form-grid {
        grid-template-columns: 1fr;
    }
    
    .reventorcab-time-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .reventorcab-step-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .reventorcab-btn {
        width: 100%;
    }
    
    .reventorcab-confirmation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .reventorcab-confirmation-row span {
        text-align: left;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .reventorcab-service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .reventorcab-steps-indicator {
        padding: 15px 10px;
    }
    
    .reventorcab-step-number {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .reventorcab-step-label {
        font-size: 9px;
    }
    
    .reventorcab-form-step {
        padding: 15px;
    }
    
    .reventorcab-success-content .reventorcab-btn {
        margin: 0 auto;
        display: inline-flex;
    }
    
    .reventorcab-service-card {
        padding: 20px;
    }
    
    .reventorcab-confirmation-card {
        padding: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Main container */
    .reventorcab-booking-form {
        background: #1d2327;
        color: #f0f0f1;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    /* Form header - keep gradient but adjust for dark mode */
    .reventorcab-form-header {
        background: linear-gradient(135deg, #0073aa 0%, #004a6b 100%);
    }
    
    /* Steps indicator */
    .reventorcab-steps-indicator {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .reventorcab-step:not(:last-child)::after {
        background: #3c434a;
    }
    
    .reventorcab-step.active:not(:last-child)::after,
    .reventorcab-step.completed:not(:last-child)::after {
        background: #0073aa;
    }
    
    .reventorcab-step-number {
        background: #3c434a;
        color: #a7aaad;
    }
    
    .reventorcab-step.active .reventorcab-step-number {
        background: #0073aa;
        color: #fff;
    }
    
    .reventorcab-step.completed .reventorcab-step-number {
        background: #00a32a;
        color: #fff;
    }
    
    .reventorcab-step-label {
        color: #a7aaad;
    }
    
    .reventorcab-step.active .reventorcab-step-label {
        color: #72aee6;
    }
    
    /* Step content headings */
    .reventorcab-step-content h4 {
        color: #f0f0f1;
    }
    
    /* Service cards */
    .reventorcab-service-card {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .reventorcab-service-option:hover .reventorcab-service-card {
        border-color: #72aee6;
        box-shadow: 0 8px 25px rgba(114, 174, 230, 0.15);
    }
    
    .reventorcab-service-option input:checked + .reventorcab-service-card {
        border-color: #72aee6;
        background: rgba(114, 174, 230, 0.1);
    }
    
    .reventorcab-service-card::before {
        background: #72aee6;
    }
    
    .reventorcab-service-icon {
        color: #72aee6;
    }
    
    .reventorcab-service-name {
        color: #f0f0f1;
    }
    
    .reventorcab-service-duration {
        color: #a7aaad;
    }
    
    /* Form inputs */
    .reventorcab-date-selection label,
    .reventorcab-time-selection label,
    .reventorcab-form-group label {
        color: #f0f0f1;
    }
    
    .reventorcab-form-group input,
    .reventorcab-form-group textarea,
    .reventorcab-date-selection select {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .reventorcab-form-group input:focus,
    .reventorcab-form-group textarea:focus,
    .reventorcab-date-selection select:focus {
        border-color: #72aee6;
        box-shadow: 0 0 0 3px rgba(114, 174, 230, 0.1);
    }
    
    /* Time slots */
    .reventorcab-time-slot {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .reventorcab-time-slot:hover {
        border-color: #72aee6;
        background: rgba(114, 174, 230, 0.1);
    }
    
    .reventorcab-time-slot.selected {
        background: #0073aa;
        border-color: #0073aa;
        color: #fff;
    }
    
    .reventorcab-time-slot.unavailable {
        background: #2c3338;
        border-color: #3c434a;
        color: #646970;
    }
    
    /* No date selected and loading states */
    .reventorcab-no-date-selected,
    .reventorcab-loading-slots {
        color: #a7aaad;
    }
    
    /* Confirmation cards */
    .reventorcab-confirmation-card {
        background: #2c3338;
        border-color: #3c434a;
    }
    
    .reventorcab-confirmation-header {
        border-color: #3c434a;
    }
    
    .reventorcab-confirmation-header .dashicons {
        color: #72aee6;
    }
    
    .reventorcab-confirmation-header h5 {
        color: #f0f0f1;
    }
    
    .reventorcab-confirmation-row {
        border-color: #3c434a;
    }
    
    .reventorcab-confirmation-row strong {
        color: #f0f0f1;
    }
    
    .reventorcab-confirmation-row span {
        color: #a7aaad;
    }
    
    /* Navigation */
    .reventorcab-step-navigation {
        border-color: #3c434a;
    }
    
    /* Buttons */
    .reventorcab-btn-primary {
        background: #0073aa;
    }
    
    .reventorcab-btn-primary:hover:not(:disabled) {
        background: #005177;
        box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    }
    
    .reventorcab-btn-secondary {
        background: #646970;
    }
    
    .reventorcab-btn-secondary:hover {
        background: #50575e;
    }
    
    .reventorcab-btn:disabled {
        background: #3c434a;
        color: #646970;
    }
    
    /* Success state */
    .reventorcab-success-icon {
        color: #00a32a;
    }
    
    .reventorcab-success-content h4 {
        color: #00a32a;
    }
    
    .reventorcab-success-content p {
        color: #a7aaad;
    }
    
    /* Loading overlay */
    .reventorcab-loading-overlay {
        background: rgba(29, 35, 39, 0.95);
    }
    
    .reventorcab-spinner {
        border-color: #3c434a;
        border-top-color: #72aee6;
    }
    
    .reventorcab-loading-spinner p {
        color: #a7aaad;
    }
    
    /* Branding */
    .reventorcab-branding {
        background: #2c3338 !important;
        border-top-color: #3c434a !important;
    }
    
    .reventorcab-branding p {
        color: #a7aaad !important;
    }
    
    /* Branding link colors are now handled dynamically via PHP */
}

/* Branding */
.reventorcab-branding {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 0;
}

.reventorcab-branding p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.reventorcab-branding-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.reventorcab-branding-link:hover {
    color: #005a87;
    text-decoration: none;
    transform: translateY(-1px);
}

.reventorcab-branding-link:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007cba, #005a87);
    border-radius: 1px;
}