/* Property Detail V2 - UI Specification */
/* Version: 1.2 - 2026-02-13 - Full UI Spec Compliance */

/* CSS Variables */
:root {
    --color-primary: #6C5CE7; /* Brand purple - used for titles and borders */
    --color-primary-hover: #8E7BFF;
    --color-accent: #4CAF50;
    --color-text-dark: #111;
    --color-text-medium: #333;
    --color-text-body: #444;
    --color-text-light: #666;
    --color-text-muted: #777;
    --color-border: #e0e0e0;
    --color-bg-lavender: #F3F0F8;
    --color-bg-light: #F5F5F5;
    --color-bg-hover: #EDEDED;
    --color-filter-bg: #E8E5F5;
    --color-telegram: #0088cc;
    --font-primary: 'Inter', 'SF Pro Display', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: #FAFAFA;
    color: var(--color-text-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Modal Overlay (Dark Background) */
body {
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Main Container (Modal Popup - Teal Header Design) */
.detail-modal-content {
    background: white !important;
    border-radius: 24px;
    max-width: 900px; /* Spec: 900px modal width */
    width: 90%;
    padding: 0;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.4s ease-out;
}

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

/* Teal Header: Logo left, Share + Close right */
.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #E5E5E5;
    background: #1B7A8E !important; /* Teal/cyan color */
    border-radius: 24px 24px 0 0; /* Round top corners to match modal */
}

.detail-modal-logo {
    font-size: 18px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.detail-modal-logo span {
    /* Allow inline styles to work */
}

.detail-modal-logo i {
    display: none !important; /* Hide the home icon */
}

.detail-modal-header-center {
    display: none !important; /* Hide the compass */
}

.detail-modal-header-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.detail-header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: white;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Property Content */
.property-content {
    padding: 32px 24px;
}

/* Property Header */
.property-header {
    margin-bottom: 24px;
}

.property-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 24px; /* Spec: 24px for modal */
    line-height: 1.2;
    color: var(--color-text-dark);
    margin-bottom: 8px;
}

/* Property ID */
.property-id {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    font-weight: 400;
}

/* Bedroom/Bathroom Pills */
.property-specs-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.spec-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #F3F0F8; /* Lavender background */
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-medium);
}

.spec-pill i {
    font-size: 14px;
    color: var(--color-primary);
}

/* Location */
.property-location {
    font-size: 15px;
    color: var(--color-text-medium);
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-location i {
    font-size: 14px;
    color: var(--color-primary);
}

/* Image Gallery Container - EDGE TO EDGE (break out of parent padding) */
.image-gallery-container {
    max-width: none;
    width: calc(100% + 48px);
    margin: -32px -24px 48px -24px;
}

.image-gallery {
}

/* Main Carousel */
.main-carousel {
    position: relative;
    width: 100%;
    height: 480px;
    background: white;
    overflow: hidden;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1 !important;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Videos: Use contain to prevent cropping portrait videos */
.carousel-slide video {
    width: 100%;
    max-width: 100%;
    max-height: 100%;  /* Fit within the 480px carousel container */
    height: auto;      /* Don't force a landscape height */
    object-fit: contain;  /* Never crop/zoom - show full frame */
    display: block;
    background: #000;  /* Black background for letterboxing */
}

/* Portrait videos: Constrain width so they don't become huge */
.carousel-slide video.portrait-video {
    max-width: 60%;  /* Limit width for portrait videos */
}

/* Carousel Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--color-text-dark);
    transition: all 0.3s;
    z-index: 10;
}

.carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    left: 16px;
}

.carousel-next {
    right: 16px;
}

/* Carousel Counter */
.carousel-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* Carousel Dots Navigation - REMOVED (using thumbnails instead) */
.carousel-dots {
    display: none;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: white;
    width: 28px;
    border-radius: 5px;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Thumbnail Grid (MOVED TO TOP - out of the way of video controls) */
/* Shows max ~6 thumbnails visible; scrolls horizontally for more */
.thumbnail-grid {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px !important;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    z-index: 10;
    /* 6 thumbs × 50px + 5 gaps × 2px + padding 12px = 322px */
    max-width: 322px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.thumbnail-grid::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.thumbnail.active {
    box-shadow: none;
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Instagram-style filter: vibrance + contrast + saturation */
    filter: contrast(1.1) saturate(1.15) brightness(1.02);
    -webkit-filter: contrast(1.1) saturate(1.15) brightness(1.02);
}

.thumbnail .video-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Responsive thumbnail grid */
@media (max-width: 480px) {
    .thumbnail-grid {
        /* Slightly smaller on very small screens: ~5 thumbs */
        max-width: 272px;
    }
}

/* Video Icon Badge */
.video-icon-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 5;
}

/* When viewing video: KEEP arrows visible, hide counter/thumbnails/badge */
.main-carousel.viewing-video .carousel-counter {
    display: none !important;
}

.main-carousel.viewing-video .thumbnail-grid {
    display: none !important;
}

.main-carousel.viewing-video .video-icon-badge {
    display: none !important;
}

/* DUPLICATE THUMBNAIL GRID RULES REMOVED - SEE LINE 323 FOR ACTIVE RULES */

/* Video Thumbnail */
.video-thumbnail .video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-light);
    font-size: 32px;
    color: var(--color-text-light);
}

.video-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: white;
    opacity: 0.9;
    pointer-events: none;
}

.view-all-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.no-image-placeholder {
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-light);
    border-radius: 16px;
    color: var(--color-text-muted);
}

.no-image-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 720px;
    margin: 0 auto;
}

.content-main {
    max-width: 720px;
}

/* Description Section */
.description-section {
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 22px;
    line-height: 28px;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

.description-body {
    font-weight: 400;
    font-size: 15px;
    line-height: 24px;
    color: var(--color-text-body);
    max-width: 65ch;
}

/* Amenities Section */
.amenities-section {
    margin-bottom: 32px;
}

.amenities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.amenity-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #F3F0F8; /* Lavender background - same as bedroom/bathroom pills */
    border: 1px solid #F3F0F8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #222;
}

.amenity-item i {
    font-size: 12px;
    color: var(--color-primary);
}

/* Rental Terms Card */
.rental-terms-card {
    background-color: var(--color-bg-lavender);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    /* Removed text-align: center - only title and price should be centered */
}

.card-title {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #222; /* BLACK - changed from purple */
    margin-bottom: 16px;
    text-align: center; /* CENTER ONLY THE TITLE */
}

/* Dual Pricing (CENTERED) - NEW DIRECTIVE (2026-02-16): Show BOTH daily AND monthly prices */
.dual-pricing {
    margin-bottom: 20px;
    text-align: center;
}

.price-row {
    margin-bottom: 12px;
}

.price-label {
    font-weight: 600;
    font-size: 16px;
    color: #222;
    margin-right: 8px;
}

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

.price-period {
    font-weight: 400;
    font-size: 16px;
    color: var(--color-primary);
}

/* Terms List (Left-aligned) */
.terms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Removed margin-left/right auto to align to actual left edge */
    text-align: left;
}

.term-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.term-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 14px;
}

.term-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-medium);
}

.term-separator {
    color: var(--color-text-light);
    margin: 0 4px;
}

.term-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-dark);
}

/* Terms Footnote */
.terms-footnote {
    margin-top: 16px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--color-text-muted);
    text-align: left;
    /* Removed margin-left/right auto to align to actual left edge */
}

/* CTA BUTTONS - REDESIGNED LAYOUT (2026-02-13) */
.cta-buttons {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Row 2: Ask Manager + Remove from Favorites */
.cta-buttons-row-2 {
    display: flex;
    gap: 12px;
}

.btn {
    border-radius: 12px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

/* BIG GREEN RESERVE BUTTON (Row 1) */
.btn-reserve-big {
    height: 56px; /* BIGGER than standard buttons */
    background: linear-gradient(135deg, #27AE60 0%, #2ECC71 100%); /* GREEN gradient */
    color: white;
    font-size: 17px; /* Larger font */
    font-weight: 700; /* Bolder */
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3); /* Green shadow */
}

.btn-reserve-big:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

/* SECONDARY BUTTON — "Ask Manager" (Row 2) */
.btn-secondary {
    height: 48px;
    background: transparent;
    border: 1px solid #6C5CE7;
    color: #6C5CE7;
    font-weight: 500;
    flex: 1; /* Equal width in row 2 */
}

.btn-secondary:hover {
    background: #F3F0F8;
}

/* TERTIARY BUTTON — "Remove from Favorites" (Row 2) */
.btn-tertiary {
    height: 48px;
    background: #F5F5F5;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    flex: 1; /* Equal width in row 2 */
}

.btn-tertiary i {
    font-size: 16px;
    color: #FF385C; /* Heart icon color */
}

.btn-tertiary:hover {
    background: #EDEDED;
}

/* Responsive Design */
@media (max-width: 1440px) {
    .main-panel {
        margin: 20px;
    }
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .content-main {
        max-width: 100%;
    }

    .header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    /* MOBILE: Full-screen modal - no wasted space */
    .detail-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
        min-height: 100vh;
    }

    .main-panel {
        margin: 0;
        border-radius: 0;
    }

    .panel-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-btn,
    .telegram-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .property-title {
        font-size: 24px;
    }

    .main-image {
        height: 300px;
    }

    .price-value {
        font-size: 20px;
    }

    .main-carousel {
        height: 300px;
    }

    .cta-buttons-row-2 {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
    }

    /* MOBILE: Bigger CTA buttons for better touch targets */
    .btn-secondary,
    .btn-tertiary {
        height: 56px !important;
        min-height: 56px !important;
        font-size: 16px !important;
        padding: 16px 20px !important;
    }

    .btn-reserve-big {
        height: 60px !important;
        min-height: 60px !important;
        font-size: 18px !important;
        padding: 16px 20px !important;
    }
}

