/* Hostaway Booking Widget Styles */

/* ==========================================================================
   Listings Grid/List
   ========================================================================== */

.hostaway-listings {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

.hostaway-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.hostaway-layout-list {
    grid-template-columns: 1fr;
}

.hostaway-listing-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.hostaway-listing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hostaway-layout-list .hostaway-listing-card {
    display: grid;
    grid-template-columns: 350px 1fr;
}

.listing-image {
    position: relative;
    overflow: hidden;
}

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

.hostaway-listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.hostaway-layout-list .listing-image img {
    height: 100%;
    min-height: 300px;
}

.listing-content {
    padding: 20px;
}

.listing-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.listing-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.listing-title a:hover {
    color: #0073aa;
}

.listing-location {
    color: #666;
    font-size: 14px;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-location .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.listing-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.listing-amenities .amenity {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.listing-amenities .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.listing-excerpt {
    margin: 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.listing-price {
    margin: 15px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.price-amount {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

.price-period {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
}

.listing-actions {
    margin-top: 15px;
}

.listing-actions .button {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 15px;
}

.hostaway-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.hostaway-search-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.search-field input,
.search-field select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-field input:focus,
.search-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.search-submit .button {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
}

/* ==========================================================================
   Booking Form
   ========================================================================== */

.hostaway-booking-form-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 30px auto;
}

.hostaway-booking-form .booking-field {
    margin-bottom: 20px;
}

.hostaway-booking-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.hostaway-booking-form input,
.hostaway-booking-form select,
.hostaway-booking-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.hostaway-booking-form input:focus,
.hostaway-booking-form select:focus,
.hostaway-booking-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.booking-price-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.booking-price-summary h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.price-row.total {
    border-top: 2px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #0073aa;
}

.booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.booking-actions .button {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    text-align: center;
}

.booking-message {
    margin-top: 20px;
}

.booking-message.notice {
    padding: 15px;
    border-left: 4px solid;
    border-radius: 4px;
}

.booking-message.notice-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.booking-message.notice-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.booking-message.notice-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ==========================================================================
   Availability Calendar
   ========================================================================== */

.hostaway-availability-calendar {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

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

.calendar-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.calendar-prev,
.calendar-next {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.calendar-prev:hover,
.calendar-next:hover {
    background: #005177;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.calendar-month {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.calendar-month h4 {
    margin: 0;
    padding: 15px;
    background: #f5f5f5;
    text-align: center;
    font-size: 16px;
    color: #333;
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid th {
    padding: 10px 5px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #666;
}

.calendar-grid td {
    padding: 8px;
    text-align: center;
    border: 1px solid #f0f0f0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.calendar-grid td.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-day {
    position: relative;
}

.calendar-day.available {
    background: #d4edda;
}

.calendar-day.available:hover {
    background: #c3e6cb;
}

.calendar-day.booked {
    background: #f8d7da;
    cursor: not-allowed;
}

.calendar-day.unavailable {
    background: #e2e3e5;
    cursor: not-allowed;
}

.day-number {
    display: block;
    padding: 5px;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

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

.legend-color.available {
    background: #d4edda;
}

.legend-color.booked {
    background: #f8d7da;
}

.legend-color.unavailable {
    background: #e2e3e5;
}

.calendar-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .hostaway-layout-list .hostaway-listing-card {
        grid-template-columns: 1fr;
    }
    
    .hostaway-layout-list .listing-image img {
        height: 250px;
        min-height: auto;
    }
    
    .search-fields {
        grid-template-columns: 1fr;
    }
    
    .booking-actions {
        flex-direction: column;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .listing-amenities {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .price-amount {
        font-size: 20px;
    }
    
    .hostaway-booking-form-wrapper {
        padding: 20px;
    }
    
    .calendar-grid th,
    .calendar-grid td {
        padding: 5px 2px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.button-primary {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.button-primary:hover,
.button-primary:focus {
    background-color: #005177;
    border-color: #005177;
}

.button-secondary {
    background-color: #fff;
    border-color: #ddd;
    color: #333;
}

.button-secondary:hover,
.button-secondary:focus {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
