/**
 * SL Booking Manager - Self-Contained Frontend CSS
 * Ensures 100% standalone display in ANY WordPress theme.
 */

.vs-booking-wrapper {
    --vs-green: #16963c;
    --vs-green-dark: #127930;
    --vs-green-light: #eaf6ed;
    --vs-dark: #1e293b;
    --vs-slate: #334155;
    --vs-text: #0f172a;
    --vs-muted: #64748b;
    --vs-gray-50: #f8fafc;
    --vs-gray-100: #f1f5f9;
    --vs-gray-200: #e2e8f0;
    --vs-gray-300: #cbd5e1;
    --vs-white: #ffffff;
    --vs-radius-sm: 8px;
    --vs-radius-md: 14px;
    --vs-radius-lg: 20px;
    --vs-radius-full: 9999px;
    --vs-shadow-card: 0 12px 32px rgba(15, 23, 42, 0.08);
    --vs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    width: 100%;
    margin: 30px auto;
    font-family: var(--vs-font);
    color: var(--vs-text);
    box-sizing: border-box;
}

.vs-booking-wrapper *,
.vs-booking-wrapper *::before,
.vs-booking-wrapper *::after {
    box-sizing: border-box;
}

.vs-booking-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 36px;
    align-items: flex-start;
}

/* Calendar Card */
.vs-calendar-card {
    background: var(--vs-white);
    border: 1px solid var(--vs-gray-200);
    border-radius: var(--vs-radius-lg);
    padding: 30px;
    box-shadow: var(--vs-shadow-card);
}

.vs-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.vs-cal-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: var(--vs-dark);
}

.vs-cal-nav {
    background: var(--vs-gray-100);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vs-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.vs-cal-nav:hover {
    background: var(--vs-green);
    color: #ffffff;
}

.vs-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--vs-muted);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vs-gray-200);
    margin-bottom: 12px;
}

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

.vs-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50%;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.vs-cell-empty {
    cursor: default;
}

.vs-day-available {
    background: var(--vs-green-light);
    color: var(--vs-green-dark);
    font-weight: 700;
}

.vs-day-available:hover {
    background: var(--vs-green);
    color: #ffffff;
    transform: scale(1.08);
}

.vs-day-selected {
    background: var(--vs-dark) !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(34, 38, 42, 0.35);
}

.vs-day-booked {
    color: #94a3b8;
    background: #f1f5f9;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.65;
}

.vs-day-past {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.45;
}

.vs-cal-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--vs-gray-200);
    font-size: 13.5px;
    color: var(--vs-muted);
}

.vs-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vs-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.vs-dot-available { background-color: var(--vs-green); }
.vs-dot-selected { background-color: var(--vs-dark); }
.vs-dot-booked { background-color: #cbd5e1; }

/* Reservation Form Card */
.vs-form-card {
    background: var(--vs-white);
    border: 1px solid var(--vs-gray-200);
    border-radius: var(--vs-radius-lg);
    padding: 30px;
    box-shadow: var(--vs-shadow-card);
}

.vs-form-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: var(--vs-dark);
}

.vs-form-hint {
    font-size: 13.5px;
    color: var(--vs-muted);
    margin: 0 0 20px 0;
}

.vs-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vs-field-row {
    display: flex;
    gap: 14px;
}

.vs-col-6 {
    flex: 1;
}

.vs-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vs-field-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--vs-slate);
}

.vs-field-group .req {
    color: #e11d48;
}

.vs-field-group input,
.vs-field-group select,
.vs-field-group textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--vs-dark);
    background-color: var(--vs-gray-50);
    border: 1px solid var(--vs-gray-300);
    border-radius: var(--vs-radius-sm);
    transition: all 0.2s ease;
}

.vs-field-group input:focus,
.vs-field-group select:focus,
.vs-field-group textarea:focus {
    outline: none;
    border-color: var(--vs-green);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 150, 60, 0.15);
}

.vs-field-highlight {
    border-color: var(--vs-green) !important;
    background-color: var(--vs-green-light) !important;
}

.vs-input-icon-wrap {
    position: relative;
}

.vs-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--vs-muted);
    pointer-events: none;
}

.vs-input-icon-wrap input {
    padding-left: 38px;
}

.vs-field-checkbox {
    font-size: 13px;
    color: var(--vs-muted);
    line-height: 1.45;
}

.vs-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.vs-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--vs-green);
    flex-shrink: 0;
}

.vs-form-feedback {
    padding: 12px 16px;
    border-radius: var(--vs-radius-sm);
    font-size: 14px;
    line-height: 1.4;
}

.vs-feedback-success {
    background-color: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.vs-feedback-error {
    background-color: #fff1f2;
    border: 1px solid #f43f5e;
    color: #9f1239;
}

.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15.5px;
    padding: 14px 28px;
    border-radius: var(--vs-radius-full);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.vs-btn-primary {
    background-color: var(--vs-green);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(22, 150, 60, 0.35);
}

.vs-btn-primary:hover,
.vs-btn-primary:focus-visible {
    background-color: var(--vs-green-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 150, 60, 0.45);
}

.vs-btn-block {
    width: 100%;
}

.vs-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: vsSpin 0.7s linear infinite;
}

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

@media screen and (max-width: 1024px) {
    .vs-booking-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    .vs-field-row {
        flex-direction: column;
        gap: 16px;
    }
}
