/* =============================================
   LISTING DETAIL PAGE
   ============================================= */

/* Photo Gallery */
.listing-gallery {
    background: var(--primary-dark);
}
.gallery-hero {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-hero img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}
.gallery-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--success) 100%);
    color: white;
    font-size: 5rem;
}

.gallery-thumbnails {
    background: var(--primary-dark);
    padding: 0.75rem 0;
}
.thumbnail-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.thumbnail-row::-webkit-scrollbar {
    display: none;
}
.thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}
.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: white;
}
.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Listing Title & Location */
.listing-title {
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.listing-location {
    font-size: 1rem;
}

/* Host Card */
.host-card {
    padding: 1rem;
    background: var(--bg-warm);
    border-radius: var(--radius);
}
.host-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}
.host-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
}
.host-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}
.host-name:hover {
    color: var(--primary);
}

/* Listing Sections */
.listing-section h3 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.listing-section h3 i {
    color: var(--primary);
}
.listing-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

/* =============================================
   BOOKING SIDEBAR (Sticky)
   ============================================= */
.booking-sidebar {
    position: sticky;
    top: 90px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}
.sidebar-price {
    margin-bottom: 0.5rem;
}
.price-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}
.price-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}
.sidebar-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Selected Date */
.selected-date {
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

/* =============================================
   BOOKING CALENDAR
   ============================================= */
.tmj-calendar {
    user-select: none;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.calendar-header .month-title {
    font-weight: 700;
    font-size: 1rem;
}
.calendar-header button {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}
.calendar-header button:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.calendar-grid .day-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.25rem 0;
}
.calendar-grid .day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: all 0.15s;
    position: relative;
}
.calendar-grid .day-cell.empty {
    visibility: hidden;
}
.calendar-grid .day-cell.past,
.calendar-grid .day-cell.disabled {
    color: var(--text-light);
    opacity: 0.4;
}
.calendar-grid .day-cell.today {
    font-weight: 700;
    border: 2px solid var(--primary);
}
.calendar-grid .day-cell.available {
    background: #e8f5e9;
    color: #2e7d32;
    cursor: pointer;
    font-weight: 600;
}
.calendar-grid .day-cell.available:hover {
    background: #c8e6c9;
}
.calendar-grid .day-cell.selected {
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 600;
}
.calendar-grid .day-cell.unavailable {
    color: var(--text-light);
}

/* Manage mode (host calendar) */
.calendar-grid .day-cell.toggleable {
    cursor: pointer;
}
.calendar-grid .day-cell.toggleable:hover {
    background: var(--bg);
}
.calendar-grid .day-cell.toggled-on {
    background: var(--success);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

/* =============================================
   REVIEWS
   ============================================= */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.review-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.review-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.review-author {
    font-weight: 600;
    font-size: 0.95rem;
}
.review-date {
    font-size: 0.8rem;
}
.review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

/* =============================================
   PHOTO UPLOAD AREA
   ============================================= */
.photo-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
}
.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(26, 83, 92, 0.03);
    color: var(--primary);
}
.photo-upload-area i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}
.upload-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}
.photo-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

/* =============================================
   LISTING EDIT MAP
   ============================================= */
.listing-edit-map {
    height: 300px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
    .booking-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .listing-title {
        font-size: 1.5rem;
    }
    .gallery-hero {
        max-height: 300px;
    }
    .gallery-hero img {
        max-height: 300px;
    }
    .thumbnail {
        width: 80px;
        height: 55px;
    }
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}
