/**
 * Office Space Listings - Frontend Styles
 */

/* Container Styles */
.office-listings-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Filter Styles */
.office-filters {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.office-filters.full-width {
    width: 100%;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: flex-end;
}

@media (max-width: 1024px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

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

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.filter-button {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.filter-submit,
.filter-reset,
.load-more-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-submit {
    background-color: #007bff;
    color: white;
}

.filter-submit:hover {
    background-color: #0069d9;
}

.filter-reset {
    background-color: #f1f1f1;
    color: #333;
}

.filter-reset:hover {
    background-color: #e1e1e1;
}

/* Grid Styles */
.office-listings-wrapper {
    position: relative;
    width: 100%;
}

.office-listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .office-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .office-listings-grid {
        grid-template-columns: 1fr;
    }
}

.office-listings-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Office Card Styles */
.office-card {
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: #fff;
    width: 100%;
}

.office-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.office-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.office-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
    color: #888;
    text-align: center;
    padding: 20px;
}

.office-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.business-center-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #333;
    line-height: 1.2;
}

.booked-dates {
    color: #e74c3c;
    font-weight: 500;
    margin-top: 4px;
    font-size: 0.9em;
}

.office-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #333;
}

.office-location,
.office-number,
.office-type {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.office-price-container {
    margin: 15px 0;
}

.price-selector {
    margin-top: 10px;
}

.price-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.price-tab {
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.price-tab:hover {
    color: #007bff;
}

.price-tab.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    font-weight: 600;
}

.price-values {
    position: relative;
    margin-top: 10px;
}

.price-value {
    display: none;
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}

.price-value.active {
    display: block;
}

.office-status {
    margin-top: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.available {
    background-color: #e3fcef;
    color: #0f5132;
}

.status-badge.booked {
    background-color: #fff3cd;
    color: #856404;
}

.status-date {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
}

.office-actions {
    margin-top: auto;
}

.book-now-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.book-now-btn:hover:not(.disabled) {
    background-color: #0069d9;
}

.book-now-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 30px 0;
}

.load-more-button {
    background-color: #007bff;
    color: white;
}

.load-more-button:hover {
    background-color: #0069d9;
}

/* No Results */
.no-offices-found {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Booking Form Container Styles */
.booking-details-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.booking-details-container .office-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
}

.booking-details-container .office-details h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.booking-details-container .office-details p {
    margin: 8px 0;
    color: #2c3e50;
}

.pricing-options {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    flex: 1;
}

.pricing-options h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.pricing-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.pricing-item:last-child {
    border-bottom: none;
}

.pricing-label {
    color: #495057;
    font-weight: 500;
}

.pricing-value {
    color: #007bff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .booking-details-container {
        flex-direction: column;
        gap: 15px;
    }
}

/* Modal Styles */
.office-booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
}

.office-booking-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 5px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modal-appear 0.3s;
    margin: 20px;
}

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.modal-title {
    padding: 20px;
    margin: 0;
    border-bottom: 1px solid #eee;
    font-size: 24px;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.office-details-summary {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.summary-image {
    flex: 0 0 200px;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
    color: #888;
}

.summary-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    grid-column: span 2;
}

.summary-info {
    margin-bottom: 0;
}

.summary-pricing {
    margin-bottom: 0;
}

.summary-title {
    grid-column: span 2;
    margin: 0 0 20px 0 !important;
    font-size: 24px;
    color: #333;
}

.summary-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    color: #333;
}

.summary-info {
    margin-bottom: 20px;
}

.summary-info p,
.summary-pricing p {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.5;
    color: #555;
}

.summary-info strong,
.summary-pricing strong {
    color: #333;
    width: 80px;
    display: inline-block;
}

.summary-availability span.available {
    color: #0f5132;
    font-weight: 600;
}

.summary-availability span.booked {
    color: #856404;
    font-weight: 600;
}

.summary-pricing h4 {
    margin: 15px 0 10px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.booking-form-container {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.booking-form-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-button {
        margin: 10px 0 0;
        width: 100%;
    }
    
    .filter-button button {
        flex: 1;
    }
    
    .office-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .office-details-summary {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .summary-image {
        height: 150px;
        grid-column: 1;
    }
    
    .summary-details {
        grid-template-columns: 1fr;
        grid-column: 1;
    }
    
    .summary-title {
        grid-column: span 1;
    }
}

/* For smaller screens */
@media (max-width: 480px) {
    .office-listings-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure form elements in the modal don't overflow */
.booking-form-container input,
.booking-form-container select,
.booking-form-container textarea {
    max-width: 100%;
}

/* Contact Form 7 Integration Styles */
.booking-form-container .booking-form-grid {
    max-width: 100%;
    margin: 0;
}

.booking-form-container .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

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

.booking-form-container .form-group.half-width {
    flex: 1;
}

.booking-form-container .form-group.full-width {
    flex: 100%;
}

.office-details-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.office-details-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.booking-form-container .form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.booking-form-container .form-group input,
.booking-form-container .form-group select,
.booking-form-container .form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: border-color 0.3s;
}

.booking-form-container .form-group input:focus,
.booking-form-container .form-group select:focus,
.booking-form-container .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.booking-form-container .form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

.booking-form-container .submit-button {
    background-color: #007bff;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.booking-form-container .submit-button:hover {
    background-color: #0069d9;
}

@media (max-width: 768px) {
    .booking-form-container .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .booking-form-container .form-group.half-width {
        flex: none;
    }
}