/* Details Pages (Spot / Stay) */

/* Layout & Typography */
.details-header {
    margin-bottom: 24px;
}

.details-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.2;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    color: var(--secondary-color);
    font-size: 1rem;
}

.divider {
    border: 0;
    border-top: 1px solid var(--gray-200);
    margin: 32px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.subsection-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

/* Gallery Grid - Flexible Scroll */
.details-gallery {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin-bottom: 32px;
    border-radius: 16px;
    padding-bottom: 8px; /* For scrollbar space */
    height: 400px; /* Fixed height for consistency */
    scroll-behavior: smooth;
}

.details-gallery::-webkit-scrollbar {
    height: 8px;
}

.details-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.details-gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.details-gallery::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.details-gallery img, 
.details-gallery video {
    height: 100%;
    width: auto; /* Maintain aspect ratio */
    min-width: 250px; /* Ensure images aren't too thin */
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    border-radius: 12px;
    flex-shrink: 0;
}

.details-gallery img:hover,
.details-gallery video:hover {
    filter: brightness(0.9);
    transform: scale(1.01);
}

.good-to-know-card {
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    will-change: transform;
}

.good-to-know-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    border-color: rgba(15, 23, 42, 0.16);
}

.host-credential-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    will-change: transform;
}

.host-credential-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    border-color: rgba(15, 23, 42, 0.16);
}

.guide-photo-strip img,
.guide-photo-strip video {
    cursor: default;
}

.guide-photo-strip img:hover,
.guide-photo-strip video:hover {
    filter: none;
    transform: none;
}

.spot-image-container {
    border-radius: 12px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.full-width-gallery {
    margin-bottom: 24px;
}

.gallery-single {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: 180px;
    gap: 6px;
}

.gallery-grid-1 {
    grid-template-columns: 1fr;
    grid-auto-rows: 380px;
}

.gallery-grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 240px;
}

.gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.gallery-item:hover {
    filter: brightness(0.85);
}

.gallery-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    height: 100%;
}

/* Image Modal (Lightbox) */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

.image-modal-overlay.open .image-modal-content {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 3001;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content Layout */
.details-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

@media (max-width: 900px) {
    .details-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .details-sidebar {
        order: -1; /* Show sidebar (map/action) first on mobile? Or keep at bottom. Let's keep at bottom usually, or top if it's booking. For spots, bottom is fine or top. */
        order: 1;
    }
}

/* Sidebar */
.details-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Booking Card CSS */
.booking-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border: 1px solid rgb(221, 221, 221);
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.booking-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    background: #f8f8f8;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.price-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.price-unit {
    font-size: 16px;
    color: #222;
}

.booking-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.star-icon {
    font-size: 14px;
}

.booking-form-box {
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.booking-dates {
    display: flex;
    border-bottom: 1px solid #b0b0b0;
}

.date-input-group {
    flex: 1;
    padding: 10px 12px;
    position: relative;
    transition: background 0.2s;
}

.date-input-group:hover {
    background: #f9f9f9;
}

.date-input-group::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0 4px 4px 0;
}

.date-input-group:hover::before {
    opacity: 1;
}

.date-input-group.border-right {
    border-right: 1px solid #b0b0b0;
}

.date-input-group label {
    font-size: 10px;
    font-weight: 800;
    color: #222;
    display: block;
    margin-bottom: 2px;
}

.date-input-group input {
    border: none;
    outline: none;
    font-size: 14px;
    color: #222;
    width: 100%;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.booking-guests {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.booking-guests label {
    font-size: 10px;
    font-weight: 800;
    color: #222;
    display: block;
    margin-bottom: 2px;
}

.guests-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.guest-count {
    font-size: 14px;
    color: #222;
}

.btn-guest-toggle {
    background: none;
    border: 1px solid #b0b0b0;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #717171;
}

.btn-guest-toggle:hover {
    border-color: #222;
    color: #222;
}

.btn-availability {
    width: 100%;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    color: #222;
    font-size: 14px;
    font-weight: 800;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-availability:hover {
    background: #f9f9f9;
    border-color: #222;
}

.booking-service {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.booking-service label {
    font-size: 10px;
    font-weight: 800;
    color: #222;
    display: block;
    margin-bottom: 6px;
}

.service-select {
    width: 100%;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    padding: 10px 10px;
    font-size: 14px;
    background: #fff;
    color: #222;
    outline: none;
}

.service-select:focus {
    border-color: var(--primary-color);
}

.btn-reserve, .btn-ask-price {
    width: 100%;
    background: linear-gradient(135deg, #d90b2e 0%, #ff4d6d 100%);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 700;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(217, 11, 46, 0.2);
}

.btn-reserve:hover, .btn-ask-price:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(217, 11, 46, 0.3);
}

.btn-reserve:active, .btn-ask-price:active {
    transform: translateY(0);
}

.booking-note {
    text-align: center;
    font-size: 14px;
    color: #222;
    margin-bottom: 8px;
}


/* Comments Section */
.comment-box {
    background: var(--gray-100);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.login-prompt {
    text-align: center;
    padding: 32px;
    background: var(--gray-100);
    border-radius: 12px;
    margin-bottom: 32px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 700;
    color: var(--text-color);
}

.comment-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.comment-media {
    margin-top: 10px;
}

.comment-media img,
.comment-media video {
    display: block;
    width: 100%;
    max-width: 420px;
    max-height: 340px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: #0b1220;
    object-fit: contain;
}

.comment-media img {
    background: #fff;
}

.comment-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.comment-label-row label {
    margin: 0;
}

.comment-media-preview {
    margin-top: 10px;
}

.comment-media-preview img,
.comment-media-preview video {
    display: block;
    width: 100%;
    max-width: 420px;
    max-height: 340px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: #0b1220;
    object-fit: contain;
}

.comment-media-preview img {
    background: #fff;
}

.comment-media-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.comment-media-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-media-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--secondary-color);
}

.comment-media-btn:hover {
    color: var(--text-color);
}

.comment-media-btn svg {
    width: 18px;
    height: 18px;
}

.comment-media-filename {
    font-size: 0.9rem;
    color: var(--secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-rating-display {
    margin-bottom: 8px;
    font-size: 14px;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 24px;
    color: var(--gray-200);
    transition: color 0.2s;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #f59e0b;
}

.star.filled { color: #f59e0b; }
.star.empty { color: var(--gray-200); }

/* Avatar */
.avatar-placeholder {
    flex-shrink: 0;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 50%;
    text-transform: uppercase;
}

.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-small { width: 32px; height: 32px; font-size: 12px; }
