/**
 * Property Widgets Styles
 * Comprehensive styling for property display widgets
 */

/* ===== CSS Variables ===== */
:root {
    --vm-color-primary: var(--e-global-color-primary, #2A3140);
    --vm-color-secondary: var(--e-global-color-secondary, #FFFFFF);
    --vm-color-text: var(--e-global-color-text, #000000);
    --vm-color-accent: var(--e-global-color-accent, #D69600);
    --vm-color-light-bg: var(--e-global-color-823b90b, #F6F6EE);
}

/* ===== Common Styles ===== */
.vm-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vm-color-primary);
    margin: 0 0 1.25rem;
}

.vm-grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.vm-grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.vm-grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
    .vm-grid-cols-3, .vm-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .vm-grid-cols-2, .vm-grid-cols-3, .vm-grid-cols-4 { grid-template-columns: 1fr; }
}

/* ===== Property Gallery ===== */
.vm-property-gallery {
    direction: rtl;
}

/* Hero Layout */
.vm-gallery-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}

.vm-gallery-hero-main {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    cursor: pointer;
}

.vm-gallery-hero-main img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vm-gallery-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.vm-gallery-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(42, 49, 64, 0.8);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.vm-gallery-action:hover {
    background: rgba(42, 49, 64, 0.95);
}

.vm-gallery-action svg {
    flex-shrink: 0;
}

.vm-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.vm-gallery-thumb {
    position: relative;
    padding-bottom: 75%;
    overflow: hidden;
    cursor: pointer;
}

.vm-gallery-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vm-gallery-thumb:hover img {
    transform: scale(1.05);
}

.vm-gallery-more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 49, 64, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .vm-gallery-hero {
        grid-template-columns: 1fr;
    }
    
    .vm-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Grid Layout */
.vm-gallery-grid {
    display: grid;
    gap: 8px;
}

.vm-gallery-item {
    position: relative;
    padding-bottom: 75%;
    overflow: hidden;
    cursor: pointer;
}

.vm-gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vm-gallery-item:hover img {
    transform: scale(1.05);
}

/* Slider Layout */
.vm-gallery-slider {
    position: relative;
    overflow: hidden;
}

.vm-gallery-slider-track {
    display: flex;
    transition: transform 0.3s ease;
}

.vm-gallery-slide {
    flex: 0 0 100%;
}

.vm-gallery-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.vm-slider-prev,
.vm-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.vm-slider-prev { right: 15px; }
.vm-slider-next { left: 15px; }

.vm-slider-prev:hover,
.vm-slider-next:hover {
    background: #fff;
}

.vm-slider-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 49, 64, 0.8);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
}

/* Single Image - Hide navigation */
.vm-gallery-slider.vm-single-image .vm-slider-prev,
.vm-gallery-slider.vm-single-image .vm-slider-next,
.vm-gallery-slider.vm-single-image .vm-slider-counter,
.vm-gallery-slider.vm-single-image .vm-gallery-thumbs {
    display: none;
}

.vm-gallery-main.vm-single-image .vm-slider-prev,
.vm-gallery-main.vm-single-image .vm-slider-next,
.vm-gallery-main.vm-single-image .vm-slider-counter {
    display: none;
}

/* Lightbox */
.vm-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.vm-lightbox-close:hover { opacity: 1; }

.vm-lightbox-prev,
.vm-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.vm-lightbox-prev { right: 10px; }
.vm-lightbox-next { left: 10px; }

.vm-lightbox-prev:hover,
.vm-lightbox-next:hover { opacity: 1; }

.vm-lightbox-image-wrap {
    max-width: 90%;
    max-height: 90%;
}

.vm-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.vm-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
}

/* ===== Property Video ===== */
.vm-property-video {
    direction: rtl;
}

.vm-video-container {
    position: relative;
    overflow: hidden;
}

.vm-aspect-16-9 { padding-bottom: 56.25%; }
.vm-aspect-4-3 { padding-bottom: 75%; }
.vm-aspect-21-9 { padding-bottom: 42.86%; }

.vm-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vm-video-thumbnail {
    cursor: pointer;
}

.vm-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vm-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--vm-color-accent);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.vm-video-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--vm-color-primary);
}

/* Video Modal */
.vm-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
}

.vm-video-modal-close {
    position: absolute;
    top: -40px;
    left: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.vm-video-modal-player {
    position: relative;
    background: #000;
}

.vm-video-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== Property Details ===== */
.vm-property-details {
    direction: rtl;
}

.vm-details-grid {
    display: grid;
    gap: 12px;
}

.vm-detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--vm-color-light-bg);
    border-radius: 8px;
}

.vm-detail-icon {
    color: var(--vm-color-accent);
    flex-shrink: 0;
}

.vm-detail-label {
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

.vm-detail-value {
    color: var(--vm-color-primary);
    font-weight: 600;
    font-size: 15px;
    margin-right: auto;
}

.vm-details-list .vm-detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.vm-details-list .vm-detail-value {
    margin-right: 0;
}

.vm-details-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.vm-details-inline .vm-detail-item {
    padding: 10px 16px;
    flex-direction: row;
}

/* ===== Property Features ===== */
.vm-property-features {
    direction: rtl;
}

.vm-features-icons {
    display: grid;
    gap: 12px;
}

.vm-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--vm-color-light-bg);
    border-radius: 8px;
    transition: background 0.2s;
}

.vm-feature-icon {
    color: #4CAF50;
    flex-shrink: 0;
}

.vm-feature-label {
    color: var(--vm-color-primary);
    font-size: 14px;
}

.vm-feature-unavailable {
    opacity: 0.4;
}

.vm-feature-unavailable .vm-feature-icon {
    color: #999;
}

.vm-features-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vm-features-tags .vm-feature-item {
    padding: 8px 14px;
    border-radius: 20px;
}

.vm-features-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vm-features-list .vm-feature-item {
    padding: 10px 0;
    background: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
}

/* ===== Property Price ===== */
.vm-property-price {
    direction: rtl;
}

.vm-price-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.vm-price-inline .vm-price-box {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: right;
    padding: 16px 20px;
}

.vm-price-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.vm-status-pending {
    background: #fff3cd;
    color: #856404;
}

.vm-status-reserved {
    background: #cce5ff;
    color: #004085;
}

.vm-status-sold {
    background: #f8d7da;
    color: #721c24;
}

.vm-price-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.vm-price-inline .vm-price-main {
    justify-content: flex-start;
}

.vm-price-currency {
    font-size: 1.5rem;
    color: var(--vm-color-accent);
}

.vm-price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--vm-color-accent);
}

.vm-price-suffix {
    font-size: 1rem;
    color: #666;
}

.vm-price-per-sqm {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.vm-price-negotiable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 13px;
}

.vm-price-extras {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.vm-price-extra {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.vm-extra-label {
    color: #666;
}

.vm-extra-value {
    color: var(--vm-color-primary);
}

/* ===== Similar Properties ===== */
.vm-similar-properties {
    direction: rtl;
}

.vm-similar-grid {
    display: grid;
    gap: 20px;
}

.vm-similar-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.vm-similar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.vm-similar-image {
    position: relative;
    padding-bottom: 66.67%;
    overflow: hidden;
}

.vm-similar-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vm-similar-card:hover .vm-similar-image img {
    transform: scale(1.05);
}

.vm-similar-content {
    padding: 16px;
}

.vm-similar-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vm-color-accent);
    margin-bottom: 6px;
}

.vm-similar-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
}

.vm-similar-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--vm-color-primary);
}

.vm-similar-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.vm-similar-specs {
    display: flex;
    gap: 16px;
}

.vm-spec {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
}

/* ===== Floor Plan ===== */
.vm-property-floor-plan {
    direction: rtl;
}

.vm-floor-plan-image {
    position: relative;
    background: var(--vm-color-light-bg);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.vm-floor-plan-image img {
    max-width: 100%;
    height: auto;
}

.vm-floor-plan-clickable {
    cursor: pointer;
}

.vm-floor-plan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(42, 49, 64, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    opacity: 0;
    transition: background 0.3s, opacity 0.3s;
}

.vm-floor-plan-clickable:hover .vm-floor-plan-overlay {
    background: rgba(42, 49, 64, 0.6);
    opacity: 1;
}

.vm-floor-plan-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-floor-plan-modal-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
}

.vm-floor-plan-modal-content img {
    max-width: 100%;
    max-height: 90vh;
}

.vm-floor-plan-close {
    position: absolute;
    top: -40px;
    left: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}
