/**
 * Book Now Public Styles
 *
 * @package BookNow
 * @since   1.0.0
 */

/* Form Wrapper */
.booknow-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.booknow-form-step h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Consultation Type Options */
.booknow-type-options {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.booknow-type-option {
    display: block;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.booknow-type-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.booknow-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.booknow-type-option input[type="radio"]:checked + .type-option-content {
    color: #0073aa;
}

.booknow-type-option input[type="radio"]:checked ~ .type-option-content {
    font-weight: 600;
}

.booknow-type-option input[type="radio"]:checked {
    border-color: #0073aa;
    background: #e7f3f8;
}

.type-option-content {
    display: grid;
    gap: 8px;
}

.type-option-content strong {
    font-size: 18px;
}

.type-duration,
.type-price {
    display: inline-block;
    margin-right: 15px;
    font-size: 14px;
    color: #666;
}

.type-price {
    font-weight: 600;
    color: #0073aa;
}

.type-desc {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

/* Date & Time Selection */
.booknow-datetime-selector {
    margin-bottom: 20px;
}

.booknow-datetime-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.booknow-datetime-selector input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.booknow-time-slots {
    margin-top: 20px;
}

#slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.time-slot {
    padding: 10px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-slot:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.time-slot.selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

/* Customer Details Form */
.booknow-form-fields p {
    margin-bottom: 20px;
}

.booknow-form-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

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

/* Form Navigation */
.booknow-form-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.booknow-form-nav button {
    flex: 1;
    padding: 12px 24px;
    font-size: 16px;
}

/* Consultation Types Grid */
.booknow-types-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.booknow-types-grid.booknow-columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.booknow-types-grid.booknow-columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.booknow-types-grid.booknow-columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.booknow-type-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.booknow-type-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.booknow-type-card .type-name {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.booknow-type-card .type-description {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.booknow-type-card .type-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.booknow-type-card .type-price {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.booknow-type-card .button {
    width: 100%;
}

/* Confirmation */
.booknow-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.booknow-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #5cb85c;
    color: #fff;
    font-size: 48px;
    line-height: 80px;
    border-radius: 50%;
}

.booknow-confirmation h3 {
    color: #5cb85c;
    margin-bottom: 15px;
}

.confirmation-message {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Loading State */
.booknow-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.booknow-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 600px) {
    .booknow-form-wrapper {
        padding: 20px;
    }

    #slots-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .booknow-types-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Booking modal (popup) */
body.booknow-modal-open {
    overflow: hidden;
}

.booknow-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    background: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

/* Transparent positioning container so the form itself is the single card
   (no white frame around the cream form). */
.booknow-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* The form wrapper becomes the visible card; keep its themed background. */
.booknow-modal-dialog .booknow-form-wrapper {
    max-width: none;
    margin: 0;
    padding: 40px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.booknow-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 1;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1c2b3a;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.booknow-modal-close-btn:hover,
.booknow-modal-close-btn:focus {
    background: rgba(0, 0, 0, 0.08);
    color: #000;
}

/* Status messages (no slots / loading / error) should span the slot grid. */
#slots-container > p {
    grid-column: 1 / -1;
    margin: 0;
}

@media screen and (max-width: 600px) {
    .booknow-modal-dialog .booknow-form-wrapper {
        padding: 28px 20px;
    }
}
