/**
 * Booking Form CSS
 * File: assets/booking-form.css
 */

.wrkflw-booking-form {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Talent Autocomplete Styles */
.talent-autocomplete {
    width: 100%;
    position: relative;
}

.talent-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e6e6e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -1px;
}

.talent-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.talent-result-item:last-child {
    border-bottom: none;
}

.talent-result-item:hover,
.talent-result-item.highlighted {
    background-color: #f7f7f7;
}

.talent-result-item.no-results {
    color: #999;
    cursor: default;
    font-style: italic;
}

.talent-result-item.no-results:hover {
    background-color: transparent;
}

.talent-result-name {
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: 1px;
}

.talent-business-name {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.2;
}

.talent-name-part {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.4;
    font-size: 15px;
}

.talent-name-text {
    flex: 1;
}

.talent-first-name {
    color: #2b2b2b;
}

.talent-surname {
    color: #d5a63a;
    font-weight: 600;
}

.talent-result-type {
    font-size: 10px;
    color: #2b2b2b;
    font-weight: 500;
    margin-bottom: 0;
    margin-top: 0;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.talent-result-type-pill {
    display: inline-block;
    padding: 2px 10px;
    background: #fff;
    border: 1px solid #d5a63a;
    border-radius: 999px;
    font-size: 9px;
    color: #2b2b2b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.talent-result-subtitle {
    font-size: 12px;
    color: #666;
    display: none; /* Hidden - admin only */
}

/* Time Slots Grid Styles */
.time-slots-grid,
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding: 0;
}

.time-slot {
    padding: 12px 16px;
    background: white;
    border: 1px solid #d5a63a;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2b2b2b;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.time-slot:hover {
    background: #fff9e6;
    border-color: #c4962a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(213, 166, 58, 0.2);
}

.time-slot.selected {
    background: #d5a63a;
    border-color: #d5a63a;
    color: white;
    box-shadow: 0 2px 12px rgba(213, 166, 58, 0.3);
}

.time-slot:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(213, 166, 58, 0.2);
}

.time-slot:active {
    transform: translateY(0);
}

/* Responsive time slots */
@media (min-width: 600px) {
    .time-slots-grid,
    .time-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
}

@media (min-width: 768px) {
    .time-slots-grid,
    .time-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .time-slots-grid,
    .time-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* Section styling for time slots */
#wrkflwTimeSlotsSection {
    margin-top: 20px;
}

#wrkflwTimeSlotsSection h3 {
    margin-bottom: 15px;
}

#wrkflwTimeSlotsSection > p {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.booking-form {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 24px;
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 1200px;
    box-shadow: none;
}

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

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2b2b2b;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #d5a63a;
}

.form-row {
    margin-bottom: 20px;
    position: relative;
}

.form-row label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: 8px;
}

.form-row .required {
    color: #dc3545;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #d5a63a;
    box-shadow: 0 0 0 3px rgba(213, 166, 58, 0.1);
}

.form-row-half {
    display: block;
    width: 100%;
    margin-right: 0;
}

.form-row-half:nth-child(even) {
    margin-right: 0;
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row select {
    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='%232b2b2b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Availability Status */
.availability-status {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.availability-status.available {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.availability-status.unavailable {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.availability-status.checking {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* Booking Form Layout */
.booking-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 372px));
    justify-content: center;
    column-gap: 40px;
    row-gap: 0;
    margin: 0 auto 50px auto;
    align-items: start;
    width: 100%;
}

.booking-form-left,
.booking-form-right {
    width: 100%;
    max-width: 372px;
}

.booking-form-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.booking-form-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.booking-form-left fieldset,
.booking-form-right fieldset {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 24px;
    margin: 0;
    box-sizing: border-box;
}

.booking-form-left legend,
.booking-form-right legend {
    font-weight: 600;
    color: #2b2b2b;
    text-transform: uppercase;
    font-size: 14px;
    padding: 0 10px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .booking-form-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0 auto 40px auto;
        gap: 24px;
    }

    .booking-form-left,
    .booking-form-right {
        width: 100%;
        max-width: 340px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .booking-form-left fieldset,
    .booking-form-right fieldset {
        width: min(100%, 340px);
        margin: 0 auto 24px auto;
        box-sizing: border-box;
    }

    .booking-form-right fieldset {
        border: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .booking-form-right fieldset legend {
        display: none !important;
    }

    .booking-form-left .form-row,
    .booking-form-right .form-row {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .duration-inputs {
        flex-direction: column;
        gap: 12px;
    }

    #wrkflwTimeSlotsSection {
        max-width: 340px;
        width: 100%;
        margin: 0 auto;
        text-align: center;
    }

    #wrkflwTimeSlots {
        max-width: 340px;
        margin: 0 auto;
    }
}

/* Date Calendar Container */
.wrkflw-date-calendar {
    margin-top: 10px;
}

/* Full Width Calendar Container */
.wrkflw-date-calendar-full {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Flatpickr Customization for Inline Calendar */
.flatpickr-calendar.inline {
    position: relative !important;
    margin: 0 auto !important;
    box-shadow: none;
    border: none !important;
    border-radius: 0 !important;
    width: 100% !important;
}


.flatpickr-calendar.inline .flatpickr-months {
    width: 100% !important;
    padding: 0 8px !important;
    display: flex !important;
    justify-content: center !important;
}

.flatpickr-calendar.inline .flatpickr-month {
    flex: 0 0 auto !important;
}

.flatpickr-calendar.inline .flatpickr-weekdays,
.flatpickr-calendar.inline .flatpickr-days,
.flatpickr-calendar.inline .dayContainer {
    width: 100% !important;
    max-width: none !important;
}

.flatpickr-calendar.inline .flatpickr-weekdays {
    display: flex !important;
    justify-content: center !important;
    padding: 0 8px !important;
}

.flatpickr-calendar.inline .flatpickr-days {
    padding: 0 8px 8px !important;
    display: flex !important;
    justify-content: center !important;
}

.flatpickr-calendar.inline .dayContainer {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 44px));
    grid-auto-rows: 44px;
    gap: 0 !important;
    justify-content: center !important;
}

.flatpickr-calendar.inline .flatpickr-day {
    width: 44px !important;
    height: 44px !important;
    max-width: none !important;
    margin: 0 !important;
    line-height: 44px !important;
}

.edgtf-container-inner {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Duration Pill Inputs */
.duration-pill-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #d5a63a !important;
    border-radius: 30px !important;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #2b2b2b;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23d5a63a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-pill-input:hover {
    border-color: #c4962a !important;
    background-color: #fff9e6;
}

.duration-pill-input:focus {
    outline: none;
    border-color: #d5a63a !important;
    box-shadow: 0 0 0 3px rgba(213, 166, 58, 0.1);
}

/* Media Toggle Switch */
.media-toggle-switch input:checked + .media-toggle-slider {
    background-color: #d5a63a;
}

.media-toggle-switch input:checked + .media-toggle-slider .media-toggle-slider-inner {
    transform: translateX(30px);
}

.media-toggle-slider {
    background-color: #ccc;
}

.media-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.flatpickr-calendar .flatpickr-day.selected {
    background: #d5a63a;
    border-color: #d5a63a;
    color: white;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: #fff9e6;
}

/* Price Summary */
.price-summary {
    margin-top: 30px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.price-breakdown {
    margin: 15px 0;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    color: #2b2b2b;
}

.price-line.price-total {
    font-size: 18px;
    font-weight: 700;
    color: #d5a63a;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #e6e6e6;
}

.price-note {
    font-size: 12px;
    color: #646970;
    margin-top: 10px;
    font-style: italic;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-submit {
    background: #d5a63a;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-submit:hover {
    background: #c79835;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

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

@media (max-width: 768px) {
    .btn-submit {
        width: 340px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body.woocommerce-checkout .edgtf-container-inner {
        max-width: 350px;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Response Message */
.response-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
}

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

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

/* Flatpickr Overrides */
.flatpickr-calendar {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.flatpickr-day.selected {
    background: #d5a63a;
    border-color: #d5a63a;
}

.flatpickr-day.selected:hover {
    background: #c79835;
    border-color: #c79835;
}

/* Responsive */
@media (max-width: 768px) {
    .booking-form {
        padding: 20px;
    }
    
    .form-row-half {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .form-section h3 {
        font-size: 16px;
    }
    
    .btn-submit {
        width: 100%;
    }
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Credit Application Section */
.credit-application {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e6 100%);
    border: 2px solid #d5a63a !important;
    border-radius: 8px;
    padding: 25px;
}

.credit-balance-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e6e6e6;
}

.balance-item {
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.balance-value {
    font-size: 18px;
    font-weight: 700;
    color: #d5a63a;
}

.credit-input-section {
    margin: 20px 0;
}

.credit-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2b2b2b;
}

.credit-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.number-input-group {
    display: inline-flex;
    align-items: center;
    border: 2px solid #d5a63a;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.btn-credit-adjust {
    width: 45px;
    height: 45px;
    border: none;
    background: #f9f9f9;
    color: #2b2b2b;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-credit-adjust:hover {
    background: #d5a63a;
    color: white;
}

.btn-credit-adjust:active {
    transform: scale(0.95);
}

.btn-credit-adjust:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-credit-adjust:disabled:hover {
    background: #f9f9f9;
    color: #2b2b2b;
}

#wrkflwCreditsToUse {
    width: 70px;
    height: 45px;
    border: none;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #2b2b2b;
    background: white;
    -moz-appearance: textfield;
}

#wrkflwCreditsToUse::-webkit-outer-spin-button,
#wrkflwCreditsToUse::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-credit-action {
    padding: 10px 20px;
    border: 2px solid #d5a63a;
    background: white;
    color: #d5a63a;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-credit-action:hover {
    background: #d5a63a;
    color: white;
}

.btn-credit-action:active {
    transform: scale(0.98);
}

.btn-credit-action#wrkflwCreditMax {
    background: #d5a63a;
    color: white;
}

.btn-credit-action#wrkflwCreditMax:hover {
    background: #c79835;
}

.credit-calculation {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #e6e6e6;
}

.calc-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #2b2b2b;
}

.calc-line:last-child {
    border-bottom: none;
}

.calc-line.calc-total {
    font-size: 20px;
    font-weight: 700;
    color: #d5a63a;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #d5a63a;
    border-bottom: none;
}

.credit-warning {
    padding: 15px;
    background: #fff3e0;
    border-left: 4px solid #f57c00;
    border-radius: 4px;
    font-size: 14px;
    color: #e65100;
    line-height: 1.6;
}

.credit-warning:empty {
    display: none;
}

/* Responsive - Credit Section */
@media (max-width: 768px) {
    .credit-balance-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .credit-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .number-input-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-credit-action {
        width: 100%;
    }
}

.calendar-fallback-row {
    margin-top: 15px;
}

.calendar-fallback-row label {
    display: none !important;
}

.calendar-fallback-row input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .booking-form {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }

    .booking-form-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 40px;
    }

    .booking-form-left fieldset,
    .booking-form-right fieldset {
        width: 100%;
        margin: 0;
        padding: 18px 0 24px 0;
        border: none;
        border-bottom: 1px solid #d5a63a;
        border-radius: 0;
        box-sizing: border-box;
    }

    .booking-form-left fieldset + fieldset,
    .booking-form-right fieldset + fieldset {
        margin-top: 24px;
    }

    .booking-form-left legend,
    .booking-form-right legend {
        padding: 0;
        margin-bottom: 12px;
    }

    .booking-form-left .form-row,
    .booking-form-right .form-row {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .talent-autocomplete input[type="text"] {
        width: 100%;
        max-width: 100%;
        display: block;
        padding: 8px 0;
        border: none;
        border-bottom: 2px solid #d5a63a;
        border-radius: 0;
        background: transparent;
        font-size: 16px;
    }

    .duration-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .duration-pill-input {
        width: 100%;
    }

    .calendar-fallback-row input[type="date"] {
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #e6e6e6;
        border-radius: 0;
        font-size: 16px;
        background: transparent;
    }
}

.calendar-fallback-row {
    margin-top: 15px;
}

.calendar-fallback-row label {
    display: none !important;
}

.calendar-fallback-row input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

