/* B&B Availability Calendar - Frontend Styles */

/* General Styles */
.bbac-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Room List Styles */
.bbac-room-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.bbac-room-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bbac-room-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.bbac-room-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.bbac-room-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bbac-room-item:hover .bbac-room-image img {
    transform: scale(1.05);
}

.bbac-room-content {
    padding: 20px;
}

.bbac-room-name {
    font-size: 1.4em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.bbac-room-name a {
    color: #333;
    text-decoration: none;
}

.bbac-room-name a:hover {
    color: var(--bbac-primary-color);
}

.bbac-room-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.bbac-room-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.bbac-room-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bbac-room-meta .bbac-icon::before {
    font-family: 'dashicons';
    font-size: 16px;
    color: #999;
}

.bbac-room-meta .bbac-icon-users::before {
    content: '\f110';
}

.bbac-room-meta .bbac-icon-price::before {
    content: '\f174';
}

.bbac-room-price strong {
    color: var(--bbac-primary-color);
    font-size: 1.1em;
}

.bbac-room-price small {
    color: #999;
    font-weight: normal;
}

.bbac-room-amenities h4 {
    font-size: 1em;
    margin: 0 0 10px 0;
    color: #333;
}

.bbac-room-amenities ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bbac-room-amenities li {
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #666;
}

.bbac-room-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.bbac-book-now-btn {
    display: inline-block;
    background: var(--bbac-primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.bbac-book-now-btn:hover {
    background: #005a87;
    color: #fff;
}

/* Room Details Styles */
.bbac-room-details {
    max-width: 1000px;
    margin: 0 auto;
}

.bbac-room-main-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 30px;
}

.bbac-room-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbac-room-info {
    margin-bottom: 40px;
}

.bbac-room-title {
    font-size: 2.2em;
    margin: 0 0 20px 0;
    color: #333;
}

.bbac-room-info .bbac-room-meta {
    justify-content: flex-start;
    gap: 25px;
    margin-bottom: 25px;
    font-size: 1em;
}

.bbac-room-info .bbac-room-meta span {
    flex-direction: column;
    text-align: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    min-width: 100px;
}

.bbac-room-info .bbac-room-meta .bbac-icon::before {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--bbac-primary-color);
}

.bbac-room-info .bbac-room-description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
}

.bbac-room-amenities h3 {
    font-size: 1.4em;
    margin: 0 0 20px 0;
    color: #333;
}

.bbac-amenities-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.bbac-amenities-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.bbac-amenities-list .bbac-icon-check::before {
    font-family: 'dashicons';
    content: '\f147';
    color: #4CAF50;
    font-size: 18px;
}

/* Calendar Styles */
.bbac-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.bbac-month-calendar {
    width: 100%;
}

.bbac-calendar-wrapper,
.bbac-availability-calendar-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.bbac-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.bbac-month-header {
    display: none;
}

.bbac-calendar-title {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.bbac-calendar-nav {
    background: var(--bbac-primary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.bbac-calendar-nav:hover {
    background: #005a87;
}

.bbac-calendar-nav:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bbac-calendar-container {
    margin-bottom: 20px;
}

.bbac-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.bbac-calendar-table th {
    background: #f5f5f5;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #555;
    border: 1px solid #e0e0e0;
}

.bbac-calendar-table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: center;
    vertical-align: top;
    min-height: 80px;
    position: relative;
}

.bbac-calendar-day {
    min-height: 60px;
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bbac-calendar-day:hover {
    background: #f9f9f9;
}

.bbac-calendar-day-number {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.bbac-calendar-day.other-month {
    color: #ccc;
    background: #fafafa;
}

.bbac-calendar-day.today {
    background: #e3f2fd;
    border-radius: 4px;
}

.bbac-calendar-day.selected {
    background: var(--bbac-primary-color);
    color: #fff;
    border-radius: 4px;
}

.bbac-calendar-day.selected .bbac-calendar-day-number {
    color: #fff;
}

/* Calendar Status Colors */
.bbac-calendar-day.status-available {
    background: var(--bbac-status-available-bg);
    cursor: pointer;
}

.bbac-calendar-day.status-booked {
    background: var(--bbac-status-booked-bg);
    cursor: not-allowed;
}

.bbac-calendar-day.status-arrival {
    background: linear-gradient(135deg, var(--bbac-status-available-bg) 50%, var(--bbac-status-booked-bg) 50%);
}

.bbac-calendar-day.status-departure {
    background: linear-gradient(135deg, var(--bbac-status-booked-bg) 50%, var(--bbac-status-available-bg) 50%);
}

.bbac-calendar-day.status-partial {
    background: var(--bbac-status-pending-bg);
}

.bbac-calendar-day.status-blocked {
    background: #ececec;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.bbac-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
}

.bbac-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.bbac-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.bbac-legend-color.bbac-available {
    background: var(--bbac-status-available-bg);
}

.bbac-legend-color.bbac-booked {
    background: var(--bbac-status-booked-bg);
}

.bbac-legend-color.bbac-arrival {
    background: linear-gradient(135deg, var(--bbac-status-available-bg) 50%, var(--bbac-status-booked-bg) 50%);
}

.bbac-legend-color.bbac-departure {
    background: linear-gradient(135deg, var(--bbac-status-booked-bg) 50%, var(--bbac-status-available-bg) 50%);
}

.bbac-legend-color.bbac-partial {
    background: var(--bbac-status-pending-bg);
}

.bbac-legend-color.bbac-blocked {
    background: #ececec;
}

/* Booking Form Styles */
.bbac-booking-form-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.bbac-booking-form {
    margin: 0;
}

.bbac-form-group {
    margin-bottom: 20px;
}

.bbac-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.bbac-form-group label .required {
    color: #f44336;
}

.bbac-form-group input[type="text"],
.bbac-form-group input[type="email"],
.bbac-form-group input[type="tel"],
.bbac-form-group input[type="date"],
.bbac-form-group select,
.bbac-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.bbac-form-group input[type="text"]:focus,
.bbac-form-group input[type="email"]:focus,
.bbac-form-group input[type="tel"]:focus,
.bbac-form-group input[type="date"]:focus,
.bbac-form-group select:focus,
.bbac-form-group textarea:focus {
    outline: none;
    border-color: var(--bbac-primary-color);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.bbac-date-group,
.bbac-guests-group {
    display: flex;
    gap: 15px;
}

.bbac-date-input,
.bbac-guests-input {
    flex: 1;
}

.bbac-price-display {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 25px 0;
}

.bbac-price-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}

.bbac-price-label {
    font-weight: 600;
    color: #666;
}

.bbac-price-amount {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--bbac-primary-color);
}

.bbac-booking-submit {
    background: var(--bbac-primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

.bbac-booking-submit:hover {
    background: #005a87;
}

.bbac-booking-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bbac-form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.bbac-form-messages.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.bbac-form-messages.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Widget Styles */
.widget .bbac-booking-form-wrapper {
    padding: 0;
    border: none;
    border-radius: 0;
    max-width: 100%;
}

.widget .bbac-booking-form-wrapper .bbac-date-group,
.widget .bbac-booking-form-wrapper .bbac-guests-group {
    flex-direction: column;
    gap: 10px;
}

.widget .bbac-booking-form-wrapper .bbac-form-group {
    margin-bottom: 15px;
}

.widget .bbac-booking-form-wrapper .bbac-price-display {
    margin: 15px 0;
    padding: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .bbac-room-list {
        grid-template-columns: 1fr;
    }

    .bbac-date-group,
    .bbac-guests-group {
        flex-direction: column;
    }

    .bbac-calendar-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .bbac-calendar-legend {
        flex-direction: column;
        gap: 10px;
    }

    .bbac-room-info .bbac-room-meta {
        flex-direction: column;
        gap: 15px;
    }

    .bbac-room-info .bbac-room-meta span {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}

/* Utility Classes */
.bbac-text-center {
    text-align: center;
}

.bbac-text-right {
    text-align: right;
}

.bbac-hidden {
    display: none;
}

.bbac-loading {
    position: relative;
}

.bbac-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--bbac-primary-color);
    border-radius: 50%;
    animation: bbac-spin 1s linear infinite;
}

@keyframes bbac-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Global Notices */
.bbac-global-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 15px 40px 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 300px;
    text-align: center;
    border-left: 5px solid #2e7d32;
}

.bbac-global-notice.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #2e7d32;
}

.bbac-global-notice.error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #c62828;
}

.bbac-global-notice p {
    margin: 0;
    font-weight: 500;
}

.bbac-close-notice {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    line-height: 1;
}

.bbac-close-notice:hover {
    opacity: 1;
}

/* Calendar Range Selection Styles */
.bbac-calendar-day.range-start {
    background: var(--bbac-selection-color, var(--bbac-primary-color)) !important;
    color: #fff !important;
    border-radius: 4px 0 0 4px;
}

.bbac-calendar-day.range-end {
    background: var(--bbac-selection-color, var(--bbac-primary-color)) !important;
    color: #fff !important;
    border-radius: 0 4px 4px 0;
}

.bbac-calendar-day.in-range {
    background: var(--bbac-selection-color-light, #e3f2fd) !important;
    color: #333 !important;
}

/* Ensure selected state overrides status colors */
.bbac-calendar-day.selected {
    background: var(--bbac-selection-color, var(--bbac-primary-color)) !important;
    color: #fff !important;
    border-radius: 4px;
}

/* Blocked Dates */
.bbac-calendar-day.status-blocked {
    background: #ececec !important;
    color: #999 !important;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

/* UI/UX Improvements */
.bbac-instruction-text {
    width: 100%;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #007cba;
    /* WordPress Blue match or primary color */
}

.bbac-date-group {
    flex-wrap: wrap;
    /* Allow instruction to take full width */
}

/* Make sure instruction takes full width */
.bbac-instruction-text {
    flex-basis: 100%;
}

/* Improve extras list styling */
.bbac-extras-list {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 4px;
}

.bbac-extra-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.bbac-extra-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Button Loading State */
.bbac-btn-loading {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.9;
    cursor: wait !important;
}

.bbac-btn-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: bbac-spin 1s linear infinite;
}

.bbac-extra-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.bbac-extra-price {
    margin-left: auto;
    color: #666;
    font-size: 0.9em;
}

/* Price status improvements */
.bbac-price-amount {
    min-width: 100px;
    /* Prevent jumpiness */
    display: inline-block;
}