/**
 * Taylor Vets Booking System - Minimal WordPress CSS
 * Only essential structural styles - easily overridden by theme
 */

/* Container */
.taylor-vets-booking {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Card layout */
.booking-card {
    margin-bottom: 20px;
}

/* Site selection */
.booking-site-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.booking-site-btn {
    margin-bottom: 15px;
    background-color: rgba(65, 81, 78, 0.94) !important;
    border-color: rgba(65, 81, 78, 0.94) !important;
    color: white !important;
}

.booking-site-btn:hover {
    background-color: #2f3a38 !important;
    border-color: #2f3a38 !important;
}

.booking-site-btn small {
    font-weight: normal;
    opacity: 0.9;
}

/* Override Bootstrap btn-primary for all booking buttons */
.taylor-vets-booking .btn-primary {
    background-color: rgba(65, 81, 78, 0.94) !important;
    border-color: rgba(65, 81, 78, 0.94) !important;
    color: white !important;
}

.taylor-vets-booking .btn-primary:hover,
.taylor-vets-booking .btn-primary:focus,
.taylor-vets-booking .btn-primary:active {
    background-color: #2f3a38 !important;
    border-color: #2f3a38 !important;
    color: white !important;
}

/* Override Bootstrap btn-secondary for navigation buttons */
.taylor-vets-booking .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.taylor-vets-booking .btn-secondary:hover,
.taylor-vets-booking .btn-secondary:focus,
.taylor-vets-booking .btn-secondary:active {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: white !important;
}
/* Override Bootstrap btn-outline-primary for slot buttons */
.taylor-vets-booking .btn-outline-primary {
    color: rgba(65, 81, 78, 0.94) !important;
    border-color: rgba(65, 81, 78, 0.94) !important;
    background-color: transparent !important;
}

.taylor-vets-booking .btn-outline-primary:hover,
.taylor-vets-booking .btn-outline-primary:focus,
.taylor-vets-booking .btn-outline-primary:active {
    background-color: rgba(65, 81, 78, 0.94) !important;
    border-color: rgba(65, 81, 78, 0.94) !important;
    color: white !important;
}


/* Chat container - Modern App Style */
.booking-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

/* Optional chat header */
.booking-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(65, 81, 78, 0.94) 0%, #2f3a38 100%);
    color: white;
    font-weight: 600;
    border-bottom: 2px solid #2f3a38;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.booking-chat-header-title {
    font-size: 16px;
    margin: 0;
}

.booking-chat-header-subtitle {
    font-size: 13px;
    opacity: 0.9;
    font-weight: normal;
}

/* Chat messages area - scrollable */
.booking-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f8fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Custom scrollbar for chat messages */
.booking-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.booking-chat-messages::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.booking-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c8ce;
    border-radius: 4px;
}

.booking-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8b1b8;
}

/* Individual message bubbles */
.booking-chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
}

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

.booking-chat-user {
    background: rgba(65, 81, 78, 0.94);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 4px rgba(65, 81, 78, 0.2);
}

.booking-chat-assistant {
    background: white;
    border: 1px solid #e1e8ed;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Chat input area - fixed at bottom */
.booking-triage-input {
    padding: 16px;
    background: #ffffff;
    border-top: 2px solid #e1e8ed;
    display: flex;
    gap: 10px;
    align-items: center;
}

.booking-triage-input textarea {
    flex: 1;
    min-height: 65px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 24px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.booking-triage-input textarea:focus {
    outline: none;
    border-color: rgba(65, 81, 78, 0.94);
    box-shadow: 0 0 0 3px rgba(65, 81, 78, 0.1);
}

.booking-triage-input button[type="submit"] {
    min-width: 70px;
    height: 45px;
    padding: 0 20px;
    border-radius: 12px;
    background: rgba(65, 81, 78, 0.94);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: 600;
}

.booking-triage-input button[type="submit"]:hover {
    background: #2f3a38;
    transform: scale(1.05);
}

.booking-triage-input button[type="submit"]:active {
    transform: scale(0.95);
}

/* Triage options */
.booking-triage-options {
    padding: 16px;
    background: #ffffff;
    border-top: 2px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.booking-option-btn {
    padding: 12px 20px;
    border: 2px solid rgba(65, 81, 78, 0.94);
    background: white;
    color: rgba(65, 81, 78, 0.94);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
}

.booking-option-btn:hover {
    background: rgba(65, 81, 78, 0.94);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(65, 81, 78, 0.2);
}

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

/* Loading indicator */
.booking-chat-typing {
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    margin-right: auto;
    max-width: 75px;
}

.booking-chat-typing::after {
    content: '...';
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 100% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Calendar navigation */
/* Calendar navigation */
.booking-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Calendar table */
.booking-calendar {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.booking-calendar th,
.booking-calendar td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.booking-calendar th {
    background: rgba(65, 81, 78, 0.94);
    color: white;
    font-weight: 600;
}

.booking-calendar td.available a {
    color: rgba(65, 81, 78, 0.94);
    font-weight: 600;
    text-decoration: underline;
}

.booking-calendar td.today {
    background: #fff3cd;
}

.booking-calendar td.past {
    color: #ccc;
}

/* Slot grid */
.booking-slot-grid {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.booking-slot-btn {
    padding: 10px;
    text-align: center;
}

/* Summary */
.booking-summary {
    margin: 20px 0;
}

.booking-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.booking-summary-row:last-child {
    border-bottom: none;
}

.booking-summary-label {
    font-weight: 600;
}

/* SQL Preview */
.booking-sql-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
}

/* Loading */
.booking-loading {
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .booking-chat-container {
        height: 500px;
        border-radius: 8px;
        border-width: 1px;
    }

    .booking-chat-messages {
        padding: 12px;
    }

    .booking-chat-message {
        max-width: 85%;
        font-size: 14px;
    }

    .booking-triage-input {
        padding: 12px;
    }

    .booking-triage-input textarea {
        font-size: 14px;
        padding: 10px 14px;
    }

    .booking-option-btn {
        font-size: 14px;
        padding: 10px 16px;
    }


    .booking-summary-row {
        flex-direction: column;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .taylor-vets-booking {
        padding: 0;
    }

    .booking-chat-container {
        height: calc(100vh - 180px);
        max-height: 500px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .booking-chat-message {
        max-width: 90%;
    }

    /* Ensure input is visible above navigation bar */
    .booking-triage-input {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
        background: #ffffff;
        z-index: 10;
    }

    .booking-chat-messages {
        padding-bottom: 20px;
    }

    .booking-card {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Calendar navigation - ensure inline on all screens */
.booking-calendar-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.booking-calendar-nav h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    white-space: nowrap;
}

.booking-calendar-nav .btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Center the proceed/urgent booking button */
.booking-triage-input > div:has(#proceed-booking) {
    width: 100%;
    display: flex;
    justify-content: center;
}

#proceed-booking {
    max-width: 300px;
    width: 100%;
}

/* Center all booking action buttons */
.booking-triage-input > div {
    display: flex;
    justify-content: center;
    width: 100%;
}

.booking-triage-input .btn-primary:not([type="submit"]) {
    max-width: 300px;
}

/* Center the details form submit button */
.booking-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.booking-form-actions .btn-primary {
    max-width: 300px;
    width: 100%;
}
