/**
 * Beaver Station Availability Search Styles
 * Responsive design for desktop and mobile
 */

/* Main Container */
.bsas-search-widget {
    margin: 0 0 40px 0;
    padding: 0;
    clear: both;
}

.bsas-search-container {
    background: #ffffff;
    border: 3px solid #8b7355;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Title and Description */
.bsas-search-title {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    color: #8b7355;
    margin: 0 0 15px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.bsas-search-description {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 17px;
    color: #555;
    text-align: center;
    margin: 0 0 35px 0;
    line-height: 1.7;
}

/* Form Layout */
.bsas-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.bsas-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.bsas-form-group {
    display: flex;
    flex-direction: column;
}

.bsas-form-group label {
    display: block;
    font-family: 'Lato', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.bsas-form-group input[type="text"] {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #d1c5ba;
    border-radius: 6px;
    font-family: 'Lato', Arial, sans-serif;
    font-size: 16px;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.bsas-form-group input[type="text"]:hover {
    border-color: #8b7355;
}

.bsas-form-group input[type="text"]:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.bsas-form-group input[type="text"]::placeholder {
    color: #999;
}

/* Buttons */
.bsas-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.bsas-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 6px;
    font-family: 'Lato', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.bsas-btn-primary {
    background-color: #8b7355;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.2);
}

.bsas-btn-primary:hover {
    background-color: #6f5a42;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.3);
}

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

.bsas-btn-secondary {
    background-color: #f5f5f5;
    color: #666;
    border: 2px solid #d1c5ba;
}

.bsas-btn-secondary:hover {
    background-color: #e8e8e8;
    border-color: #8b7355;
    color: #333;
}

/* Results Container */
.bsas-results {
    margin-top: 35px;
    padding: 30px;
    border-radius: 8px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bsas-results.available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #28a745;
}

.bsas-results.unavailable {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #dc3545;
}

.bsas-results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bsas-results-icon {
    font-size: 32px;
    line-height: 1;
}

.bsas-results-title {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.bsas-results.available .bsas-results-title {
    color: #155724;
}

.bsas-results.unavailable .bsas-results-title {
    color: #721c24;
}

.bsas-results-message {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    margin: 12px 0;
}

.bsas-results.available .bsas-results-message {
    color: #155724;
}

.bsas-results.unavailable .bsas-results-message {
    color: #721c24;
}

.bsas-date-info {
    font-weight: 700;
    margin: 15px 0;
    font-size: 17px;
}

.bsas-booked-list {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.15);
}

.bsas-booked-list-title {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #721c24;
}

.bsas-booked-event {
    padding: 15px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 4px solid #721c24;
    font-family: 'Lato', Arial, sans-serif;
}

.bsas-booked-event-title {
    font-weight: 700;
    color: #721c24;
    font-size: 15px;
}

.bsas-booked-event-dates {
    color: #856404;
    font-size: 14px;
    margin-top: 5px;
}

.bsas-cta {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.15);
}

.bsas-cta-text {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.bsas-cta-button {
    display: inline-block;
    padding: 16px 35px;
    background-color: #8b7355;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Lato', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.2);
}

.bsas-cta-button:hover {
    background-color: #6f5a42;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.4);
    color: #ffffff !important;
    text-decoration: none;
}

/* Loading Spinner */
.bsas-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-family: 'Lato', Arial, sans-serif;
    font-size: 16px;
}

.bsas-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(139, 115, 85, 0.2);
    border-radius: 50%;
    border-top-color: #8b7355;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

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

/* jQuery UI Datepicker Styling */
.ui-datepicker {
    font-family: 'Lato', Arial, sans-serif !important;
    border: 3px solid #8b7355 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2) !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    width: 260px !important;
    box-sizing: border-box !important;
}

.ui-datepicker-header {
    background: #8b7355 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 8px !important;
    border-radius: 5px 5px 0 0 !important;
    position: relative !important;
    margin: 0 !important;
}

.ui-datepicker-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    line-height: 1.8 !important;
    text-align: center !important;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer !important;
    top: 8px !important;
    width: 18px !important;
    height: 18px !important;
}

.ui-datepicker-prev {
    left: 6px !important;
}

.ui-datepicker-next {
    right: 6px !important;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
    background: none !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 16px !important;
    display: block !important;
    text-align: center !important;
}

.ui-datepicker-calendar {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

.ui-datepicker th {
    color: #8b7355 !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    padding: 8px 2px !important;
    text-align: center !important;
}

.ui-datepicker td {
    padding: 0 !important;
    text-align: center !important;
    width: 14.28% !important;
}

.ui-datepicker td a,
.ui-datepicker td span {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    margin: 1px auto !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.ui-datepicker .ui-state-default {
    border: 1px solid #e0e0e0 !important;
    background: #ffffff !important;
    color: #333 !important;
    text-align: center !important;
    padding: 0 !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    border-radius: 3px !important;
}

.ui-datepicker .ui-state-hover {
    background: #f0ede8 !important;
    border-color: #8b7355 !important;
    color: #8b7355 !important;
}

.ui-datepicker .ui-state-active {
    background: #8b7355 !important;
    border-color: #8b7355 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.ui-datepicker .ui-datepicker-today .ui-state-default {
    background: #fff8f0 !important;
    border-color: #8b7355 !important;
    font-weight: 600 !important;
}

.ui-datepicker .ui-datepicker-unselectable .ui-state-default {
    color: #ccc !important;
    background: #f9f9f9 !important;
}

.ui-datepicker .ui-datepicker-calendar tbody {
    background: #fff !important;
}

.ui-datepicker table {
    margin: 8px !important;
    width: calc(100% - 16px) !important;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .bsas-search-widget {
        margin: 0 0 30px 0;
        padding: 0 5px;
    }

    .bsas-search-container {
        padding: 18px 12px;
        border-width: 2px;
        border-radius: 8px;
        margin-bottom: 25px;
        max-width: 100%;
    }

    .bsas-search-title {
        font-size: 24px;
        letter-spacing: 1px;
        margin-bottom: 12px;
    }

    .bsas-search-description {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.6;
    }

    .bsas-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .bsas-form-group label {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .bsas-form-group input[type="text"] {
        padding: 14px 15px;
        font-size: 16px;
        border-width: 2px;
    }

    .bsas-form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .bsas-btn {
        width: 100%;
        padding: 14px 25px;
        min-width: auto;
        font-size: 14px;
    }

    .bsas-results {
        padding: 18px;
        margin-top: 25px;
    }

    .bsas-results-header {
        margin-bottom: 15px;
    }

    .bsas-results-icon {
        font-size: 28px;
    }

    .bsas-results-title {
        font-size: 20px;
    }

    .bsas-results-message {
        font-size: 14px;
        line-height: 1.6;
    }

    .bsas-date-info {
        font-size: 15px;
    }

    .bsas-booked-list {
        margin-top: 20px;
        padding-top: 15px;
    }

    .bsas-booked-list-title {
        font-size: 16px;
    }

    .bsas-booked-event {
        padding: 12px;
        margin-bottom: 8px;
    }

    .bsas-booked-event-title {
        font-size: 14px;
    }

    .bsas-booked-event-dates {
        font-size: 13px;
    }

    .bsas-cta {
        margin-top: 20px;
        padding-top: 15px;
    }

    .bsas-cta-text {
        font-size: 14px;
    }

    .bsas-cta-button {
        display: block;
        text-align: center;
        width: 100%;
        padding: 14px 20px;
        font-size: 13px;
    }

    .bsas-loading {
        padding: 30px;
        font-size: 15px;
    }

    /* Mobile Datepicker */
    .ui-datepicker {
        width: 100% !important;
        max-width: 320px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
    }

    .ui-datepicker td a,
    .ui-datepicker td span {
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 14px !important;
    }

    .ui-datepicker th {
        font-size: 11px !important;
        padding: 10px 4px !important;
    }

    .ui-datepicker-header {
        padding: 12px 10px !important;
    }

    .ui-datepicker-title {
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .bsas-search-container {
        padding: 18px 12px;
        margin-left: -5px;
        margin-right: -5px;
        border-radius: 6px;
    }

    .bsas-search-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .bsas-search-description {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .bsas-form-group label {
        font-size: 11px;
    }

    .bsas-form-group input[type="text"] {
        padding: 13px 14px;
        font-size: 16px;
    }

    .bsas-btn {
        padding: 13px 20px;
        font-size: 13px;
    }

    .bsas-results {
        padding: 15px;
    }

    .bsas-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bsas-results-icon {
        font-size: 24px;
    }

    .bsas-results-title {
        font-size: 18px;
    }

    .bsas-results-message {
        font-size: 13px;
    }

    .bsas-date-info {
        font-size: 14px;
    }

    .bsas-booked-list-title {
        font-size: 15px;
    }

    .bsas-booked-event {
        padding: 10px;
    }

    .bsas-booked-event-title {
        font-size: 13px;
    }

    .bsas-booked-event-dates {
        font-size: 12px;
    }

    .bsas-cta-text {
        font-size: 13px;
    }

    .bsas-cta-button {
        padding: 13px 18px;
        font-size: 12px;
        letter-spacing: 1px;
    }

    /* Extra small mobile datepicker */
    .ui-datepicker {
        max-width: 300px !important;
    }

    .ui-datepicker td a,
    .ui-datepicker td span {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
    }
}

/* ========================================
   MEC Calendar Mobile Fixes
   ======================================== */

/* Force MEC calendar to be responsive on mobile */
@media (max-width: 768px) {
    /* Container fixes */
    .mec-wrap,
    .mec-calendar,
    .mec-box-calendar,
    .mec-event-calendar-classic,
    .mec-calendar-container,
    .mec-calendar-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Table wrapper - prevent horizontal scroll */
    .mec-calendar .mec-calendar-table-wrapper {
        overflow-x: visible !important;
    }

    /* Calendar table itself */
    .mec-calendar table.mec-calendar-table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    /* Calendar cells */
    .mec-calendar td,
    .mec-calendar th {
        padding: 8px 4px !important;
        font-size: 12px !important;
        width: 14.28% !important;
        max-width: 14.28% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Day numbers */
    .mec-calendar .mec-calendar-day {
        font-size: 14px !important;
        padding: 4px !important;
    }

    /* Event indicators */
    .mec-calendar .mec-has-event {
        font-size: 11px !important;
    }

    /* Month/Year navigation */
    .mec-calendar-header,
    .mec-calendar-top {
        padding: 10px 5px !important;
    }

    .mec-calendar-header h2,
    .mec-calendar-top h2 {
        font-size: 18px !important;
    }

    /* Navigation buttons */
    .mec-calendar .mec-previous-month,
    .mec-calendar .mec-next-month {
        font-size: 20px !important;
    }

    /* Remove any fixed widths */
    .mec-calendar [style*="width"] {
        width: auto !important;
    }
}

/* Extra small mobile (phones) */
@media (max-width: 480px) {
    .mec-calendar td,
    .mec-calendar th {
        padding: 6px 2px !important;
        font-size: 11px !important;
    }

    .mec-calendar .mec-calendar-day {
        font-size: 13px !important;
        padding: 3px !important;
    }

    .mec-calendar-header h2,
    .mec-calendar-top h2 {
        font-size: 16px !important;
    }

    /* Make "Booked" text smaller or abbreviate */
    .mec-calendar .mec-event-title {
        font-size: 9px !important;
    }
}

/* Landscape phone orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .mec-calendar td,
    .mec-calendar th {
        padding: 5px 3px !important;
        font-size: 11px !important;
    }
}

/* ========================================
   ULTRA-SPECIFIC MEC Calendar Mobile Fixes
   Maximum specificity to override everything
   ======================================== */

/* Force MEC calendar containers to be responsive */
@media (max-width: 768px) {
    /* Target ALL possible MEC wrapper combinations */
    body .mec-wrap.mec-calendar,
    body .mec-box-calendar.mec-calendar,
    body .mec-calendar.mec-event-calendar-classic,
    body div.mec-calendar,
    body .mec-calendar-topsec,
    body .mec-calendar .mec-calendar-topsec {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow: visible !important;
    }

    /* Force calendar side to be full width */
    body .mec-calendar .mec-calendar-side,
    body .mec-box-calendar .mec-calendar-side,
    body .mec-event-calendar-classic .mec-calendar-side,
    body div.mec-calendar-side {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        display: block !important;
        padding: 20px 10px !important;
        box-sizing: border-box !important;
    }

    /* Force calendar header to be responsive */
    body .mec-calendar .mec-calendar-header,
    body .mec-calendar-header {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Force calendar table wrapper */
    body .mec-calendar .mec-calendar-table,
    body .mec-calendar-table {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Force all DL/DT elements to be responsive */
    body .mec-calendar dl,
    body .mec-calendar-table dl {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        display: table !important;
    }

    body .mec-calendar dt,
    body .mec-calendar-table dt {
        width: 14.28% !important;
        max-width: 14.28% !important;
        font-size: 11px !important;
        padding: 6px 2px !important;
        height: auto !important;
        min-height: 50px !important;
        line-height: 1.3 !important;
        display: table-cell !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        overflow: hidden !important;
    }

    /* Make event titles smaller */
    body .mec-calendar .mec-event-title,
    body .mec-calendar .mec-single-event-novel h4 {
        font-size: 9px !important;
        line-height: 1.1 !important;
        padding: 2px !important;
        margin: 0 !important;
    }

    /* Navigation buttons */
    body .mec-calendar .mec-previous-month,
    body .mec-calendar .mec-next-month {
        position: absolute !important;
        top: 20px !important;
        font-size: 12px !important;
    }

    body .mec-calendar .mec-previous-month {
        left: 10px !important;
    }

    body .mec-calendar .mec-next-month {
        right: 10px !important;
    }

    /* Header title */
    body .mec-calendar .mec-calendar-header h2 {
        font-size: 16px !important;
        padding: 0 40px !important;
    }

    /* Remove any fixed heights that might cause issues */
    body .mec-calendar .mec-calendar-events-side {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        border-left: none !important;
        padding: 20px 10px !important;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    body .mec-calendar .mec-calendar-side {
        padding: 15px 5px !important;
    }

    body .mec-calendar dt {
        font-size: 10px !important;
        padding: 4px 1px !important;
        min-height: 45px !important;
    }

    body .mec-calendar .mec-event-title,
    body .mec-calendar .mec-single-event-novel h4 {
        font-size: 8px !important;
    }

    body .mec-calendar .mec-calendar-header h2 {
        font-size: 14px !important;
    }
}
