@import url('style.css');

.space-hero {
    background: linear-gradient(rgba(7,22,51,0.6), rgba(7,22,51,0.6)), url('../images/space/IMG3.jpg');
    background-size: cover;
    background-position: center;
    padding: 150px 0 100px;
    margin-top: 70px;
    text-align: center;
}

.hero-content h1 {
    font-size: 1.5rem; /* updated to 1.5rem */
    margin-bottom: 1rem;
    color: var(--white);
}  

.hero-content p {
    font-size: 1.3rem;
    color: var(--cold);
    max-width: 600px;
    margin: 0 auto;
}

.space-categories {
    padding: 100px 0;
    background-color: var(--navy);
}

.space-categories h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: var(--white);
}  

/* Compact Properties Grid */
.properties-grid.compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.property-card.compact {
    background-color: var(--navy-light);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--navy-lighter);
}

.property-card.compact:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
}

.property-card.compact .property-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background-color: var(--navy-lighter);
    cursor: pointer;
    position: relative;
}

.property-card.compact .property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card.compact:hover .property-image img {
    transform: scale(1.1);
}

.property-card.compact .property-info {
    padding: 1rem;
}

.property-card.compact .property-info h3 {
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.property-card.compact .property-type {
    font-size: 0.8rem;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.property-card.compact .property-price {
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.property-card.compact .property-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.property-card.compact .detail {
    display: flex;
    justify-content: space-between;
    color: var(--gray-light);
}

.property-card.compact .detail .label {
    color: var(--muted);
    font-weight: 600;
}

.property-card.compact .detail .value {
    color: var(--white);
}

.property-card.compact .property-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    background-color: var(--gold);
    color: var(--navy);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    flex: 1;
}

.btn-small:hover {
    background-color: var(--white);
    transform: translateY(-2px);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 3rem 0;
    color: var(--gray-light);
    font-size: 1.1rem;
}

.space-cta {
    background-color: var(--navy-lighter);
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--gray-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-whatsapp {
    background-color: #25D366;
    color: var(--white);
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background-color: #1fad50;
    transform: translateY(-2px);
}

/* Filters (dropdown + custom input) */
.filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--white);
    font-size: 0.95rem;
}

.filter-label select,
.filter-label input {
    background-color: var(--navy-light);
    color: var(--white);
    border: 1px solid var(--navy-lighter);
    padding: 10px 12px;
    border-radius: 6px;
    min-width: 220px;
    outline: none;
}

.filter-label select:disabled {
    opacity: 0.6;
}

/* small helper note under filters */
.filters-note {
    width: 100%;
    text-align: center;
    color: var(--gray-light);
    margin-top: 8px;
}

/* Search input specific overrides */
.filter-label input[type="search"] {
    padding-left: 12px;
}

/* Status badge and code label */
.property-code {
    display: inline-block;
    margin-left: 8px;
    color: var(--gray-light);
    font-size: 0.85rem;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-left: 8px;
}
.status-badge.available { background: rgba(84, 186, 136, 0.12); color: #54BA88; border: 1px solid rgba(84, 186, 136, 0.2); }
.status-badge.sold { background: rgba(214, 64, 64, 0.08); color: #D64040; border: 1px solid rgba(214, 64, 64, 0.12); }
.status-badge.on-lease { background: rgba(57, 118, 255, 0.08); color: #3976FF; border: 1px solid rgba(57, 118, 255, 0.12); }

/* Floor plans modal */
.floor-plans-modal {
    position: fixed;
    z-index: 10005;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
.floor-plans-content {
    background: var(--navy-light);
    padding: 20px;
    border-radius: 8px;
    width: 95%;
    max-width: 1000px;
    color: var(--white);
}
.floor-plans-close {
    background: transparent;
    color: var(--white);
    border: none;
    font-size: 2rem;
    float: right;
    cursor: pointer;
}
.floor-thumbs { display:flex; gap:10px; margin:10px 0; flex-wrap:wrap; }
.floor-thumb { border: none; padding:0; background: transparent; cursor: pointer; border-radius:6px; overflow:hidden; }
.floor-thumb img { width: 96px; height: 64px; object-fit:cover; display:block; border-radius:4px; }
.floor-preview { margin-top: 12px; text-align:center; }
.floor-preview img { width:100%; max-height:420px; object-fit:contain; border-radius:6px; }
.floor-preview #floorPreviewCaption { margin-top:8px; color:var(--gray-light); }

/* Generic modal */
.modal {
    position: fixed;
    z-index: 10010;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--navy-light);
    padding: 18px;
    border-radius: 8px;
    width: 95%;
    max-width: 720px;
    color: var(--white);
}
.modal-close {
    background: transparent;
    color: var(--white);
    border: none;
    font-size: 1.8rem;
    float: right;
    cursor: pointer;
}

/* Search suggestions */
.search-suggestions { list-style:none; margin:8px 0 0; padding:0; max-height:240px; overflow:auto; border-radius:6px; box-shadow: 0 8px 20px rgba(0,0,0,0.6); background: var(--navy-light); }
.search-suggestions li { padding:8px 12px; cursor: pointer; color:var(--white); border-bottom: 1px solid rgba(255,255,255,0.03); }
.search-suggestions li:hover, .search-suggestions li.active { background: rgba(212,175,55,0.06); }

@media (max-width:768px) {
    .modal-content { max-width:420px; }
    .search-suggestions { max-height:180px; }
}

@media (max-width:768px) {
    .floor-thumb img { width: 70px; height:50px; }

    /* Show a small preview image on phones; tapping expands it */
    .floor-preview img {
        width: 140px;
        max-height: none;
        cursor: zoom-in;
        margin: 0 auto;
    }

    .floor-plans-content { width: 95%; max-width:420px; }
}

/* helper class to hide grid until ready */
.properties-grid.hidden {
    display: none;
}

/* ========== LIGHTBOX STYLES ========== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--gold);
}

#lightboxCaption {
    color: var(--white);
    text-align: center;
    padding: 15px 0;
    font-size: 1.2rem;
    width: 100%;
    background: rgba(7, 22, 51, 0.8);
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.lightbox-btn {
    background-color: rgba(7, 22, 51, 0.7);
    color: var(--white);
    border: 2px solid var(--gold);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-btn:hover {
    background-color: var(--gold);
    color: var(--navy);
}

/* Make property images clickable with zoom indicator */
.property-image:after {
    content: '🔍';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(7, 22, 51, 0.7);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.property-image:hover:after {
    opacity: 1;
}

/* Prevent lightbox from opening for header, footer, and social images */
header img,
footer img,
.social-link img,
.logo img {
    cursor: default !important;
}

header .property-image,
footer .property-image {
    cursor: default !important;
}

/* Property data container - hidden */
#propertiesData {
    display: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    .properties-grid.compact {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .space-hero {
        padding: 100px 0 60px;
        margin-top: 70px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .space-categories h2 {
        font-size: 1.5rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-label select,
    .filter-label input {
        min-width: 100%;
        width: 100%;
    }

    .properties-grid.compact {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn, .btn-whatsapp {
        width: 100%;
    }

    /* Lightbox responsive */
    .lightbox-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .lightbox-content img {
        max-height: 60vh;
    }
    
    .lightbox-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-close {
        top: -40px;
        font-size: 2rem;
    }
    
    #lightboxCaption {
        font-size: 1rem;
        padding: 10px;
    }
    
    .lightbox-nav {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .property-card.compact .property-details {
        font-size: 0.75rem;
    }
    
    .property-card.compact .property-info h3 {
        font-size: 0.9rem;
    }
    
    .property-card.compact .property-price {
        font-size: 1rem;
    }
    
    .lightbox-close {
        top: -35px;
        font-size: 1.8rem;
    }
}