/* VRG Properties Frontend Styles */

/* Import Oswald font for buttons */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&display=swap');

/* ============================================
   Google Maps InfoWindow Styles
   ============================================ */

/* Style the InfoWindow container */
.gm-style-iw {
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.gm-style-iw-c {
    padding: 0 !important;
    border-radius: 8px !important;
}

.gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important;
}

/* Hide the default tail/arrow */
.gm-style-iw-tc {
    display: none !important;
}

/* Style the close button - fixed positioning and z-index */
.gm-ui-hover-effect {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    background: white !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    opacity: 1 !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.gm-ui-hover-effect > span {
    background-color: #374151 !important;
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
}

.gm-ui-hover-effect:hover {
    background: #f3f4f6 !important;
}

/* InfoWindow image container - ensure it doesn't overlap close button */
.vrg-info-window-image {
    position: relative;
    overflow: hidden;
}

/* Remove image hover zoom effect to prevent covering close button */
.vrg-info-window img {
    transition: none;
}

/* ============================================
   The7 Theme Compatibility Fixes
   Hide The7's featured image - we display it via the plugin instead
   ============================================ */

/* Hide The7's default featured image display for property posts */
.single-property .post-thumbnail,
.single.type-property .post-thumbnail,
article.type-property > .post-thumbnail,
body.single-property .post-thumbnail,
body.single-property article.type-property > .post-thumbnail {
    display: none !important;
}

/* VRG Plugin Featured Image Display */
.vrg-featured-image-container {
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.vrg-featured-image-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.vrg-properties-container {
    background-color: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
    height: 100vh;
    min-height: 500px;
    position: relative;
}

.vrg-properties-layout {
    display: flex;
    height: 100%;
    min-height: 100vh;
}

/* Map Section - 66% Width */
.vrg-map-section {
    width: 66%;
    position: relative;
    background-color: #f3f4f6;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.vrg-map-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #f0f8ff;
    background-image: linear-gradient(rgba(156, 163, 175, 0.1) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(156, 163, 175, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.vrg-map-placeholder::before {
    content: 'Interactive Map';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 18px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0.7;
}

/* Map Controls - Hide satellite toggle */
.map-controls {
    display: none;
}

.map-control-btn {
    display: none;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 80px;
    right: 16px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 10;
}

.zoom-btn {
    display: block;
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: #374151;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.zoom-btn:last-child {
    border-bottom: none;
}

.zoom-btn:hover {
    background-color: #f9fafb;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    z-index: 10;
    transition: background-color 0.2s;
}

.fullscreen-btn:hover {
    background-color: #f9fafb;
}

/* Google Map Container */
.google-map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Map Markers */
.map-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-marker {
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: #0175bc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: all 0.2s;
}

.map-marker:hover {
    background-color: #047857;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Map Attribution */
.map-attribution {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #6b7280;
    z-index: 10;
}

.terms-link {
    color: #6b7280;
    text-decoration: none;
}

.terms-link:hover {
    color: #0175bc;
    text-decoration: underline;
}

/* Properties Panel - Independent Scrolling */
.vrg-properties-panel {
    width: 34%;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    position: relative;
}

/* Filters Section - Fixed at top */
.properties-filters {
    background: #1f2937;
    padding: 16px;
    border-bottom: 1px solid #374151;
    flex-shrink: 0;
}

.search-container {
    position: relative;
    margin-bottom: 16px;
}

.property-search {
    width: 100%;
    padding: 12px 40px 12px 16px; /* Add right padding for clear button */
    border: 1px solid #374151;
    border-radius: 6px;
    background: #374151;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.property-search::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.property-search:focus {
    outline: none;
    border-color: #0175bc;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Remove search icon completely */
.search-icon {
    display: none;
}

/* Search Clear Button */
.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.search-clear-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.search-clear-btn svg {
    width: 16px;
    height: 16px;
}

/* Search Row - Search Input + Advanced Search Button */
.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: stretch;
}

.search-row .search-container {
    flex: 1;
    margin-bottom: 0;
}

/* Advanced Search Button */
.advanced-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.advanced-search-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: white;
}

.advanced-search-btn.active {
    background: #0175bc;
    border-color: #0175bc;
    color: white;
}

.advanced-search-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Advanced Search Panel */
.advanced-search-panel {
    background: #2d3748;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #4b5563;
}

.advanced-search-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.advanced-search-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.advanced-search-field label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advanced-search-field select {
    padding: 10px 12px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #374151;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.advanced-search-field select:hover {
    border-color: #6b7280;
}

.advanced-search-field select:focus {
    outline: none;
    border-color: #0175bc;
    box-shadow: 0 0 0 3px rgba(1, 117, 188, 0.2);
}

.advanced-search-field select option {
    background: #374151;
    color: white;
    padding: 8px;
}

/* Advanced Search Actions */
.advanced-search-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.apply-filters-btn {
    padding: 10px 20px;
    background: #0175bc;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-filters-btn:hover {
    background: #015a9a;
    transform: translateY(-1px);
}

.reset-filters-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-filters-btn:hover {
    background: #374151;
    border-color: #6b7280;
    color: white;
}

/* Filter Result Count */
.filter-result-count {
    font-size: 13px;
    color: #9ca3af;
    margin-left: auto;
}

/* Mobile Responsive for Advanced Search */
@media (max-width: 600px) {
    /* Keep search bar and Filters button on same row */
    .search-row {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
    }

    .search-row .search-container {
        flex: 1;
        min-width: 0; /* Allow shrinking */
    }

    .property-search {
        padding: 10px 36px 10px 12px;
        font-size: 14px;
    }

    /* Compact Filters button on mobile */
    .advanced-search-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .advanced-search-btn span {
        display: none; /* Hide "Filters" text, show only icon */
    }

    .advanced-search-btn svg {
        width: 20px;
        height: 20px;
    }

    .advanced-search-row {
        grid-template-columns: 1fr;
    }

    .advanced-search-actions {
        flex-direction: column;
    }

    .apply-filters-btn,
    .reset-filters-btn {
        width: 100%;
        text-align: center;
    }

    .filter-result-count {
        margin-left: 0;
        text-align: center;
        width: 100%;
        order: -1;
        margin-bottom: 12px;
    }

    /* Hide quick filter buttons on mobile - use Filters panel instead */
    .filter-buttons {
        display: none !important;
    }

    /* Reduce padding on filters section for mobile */
    .properties-filters {
        padding: 12px;
    }
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #4b5563;
    border-radius: 4px;
    background: transparent;
    color: #d1d5db;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: none; /* Hide by default, show via JavaScript when needed */
}

.filter-btn.visible {
    display: inline-block;
}

.filter-btn:hover,
.filter-btn.active {
    background: #0175bc;
    border-color: #0175bc;
    color: white;
}

.filter-btn.clear-filters {
    border-color: #6b7280;
    color: #9ca3af;
    display: inline-block; /* Always show clear filters */
}

.filter-btn.clear-filters:hover {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

/* Properties List - Scrollable */
.properties-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    height: 0; /* Force flex child to respect container height */
}

/* Custom scrollbar */
.properties-list::-webkit-scrollbar {
    width: 6px;
}

.properties-list::-webkit-scrollbar-track {
    background: transparent;
}

.properties-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.properties-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Property Card Link */
.property-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 30px;
}

.property-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Property Card */
.property-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.property-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.property-image {
    position: relative;
    width: 100%;
    height: 192px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.property-status {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.property-status.status-for-lease {
    background: rgba(5, 150, 105, 0.9);
    color: white;
}

.property-status.status-for-sale {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.property-status.status-for-lease-for-sale {
    background: rgba(147, 51, 234, 0.9);
    color: white;
}

.property-status.status-fully-leased {
    background: rgba(107, 114, 128, 0.9);
    color: white;
}

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

.property-header {
    margin-bottom: 16px;
}

.property-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.property-description {
    color: #6b7280;
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.property-location {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* Property Highlights */
.property-highlights {
    margin-bottom: 20px;
}

.property-highlights h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.property-highlights ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.property-highlights li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 4px;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

.property-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: #0175bc;
    border-radius: 50%;
}

/* Property Contact */
.property-contact {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.property-contact h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    background: #0175bc;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

.contact-btn:hover {
    background: #015a9a;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.contact-btn svg {
    width: 16px;
    height: 16px;
}

/* Single Property Page Styles */
.vrg-property-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #0175bc;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.vrg-property-back-link:hover {
    color: #015a9a;
    text-decoration: none;
    transform: translateX(-2px);
}

.vrg-property-back-link svg {
    width: 16px;
    height: 16px;
}

.vrg-property-images-gallery {
    margin: 20px 0;
}

.vrg-property-images-gallery h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.property-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 100%;
}

.property-gallery-thumbnail {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    background: #f8f9fa;
}

.property-gallery-thumbnail:hover {
    transform: scale(1.05);
    border-color: #0175bc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.property-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.property-gallery-thumbnail:hover img {
    transform: scale(1.1);
}

/* Responsive Design */

/* Hide map and show only properties panel at 900px and below */
@media (max-width: 900px) {
    .vrg-properties-layout {
        flex-direction: row; /* Keep horizontal layout */
    }

    .vrg-map-section {
        display: none; /* Hide the map section completely */
    }

    .vrg-properties-panel {
        width: 100%; /* Properties panel takes full width */
        border-left: none;
        height: 100%;
    }

    .vrg-properties-container {
        border-radius: 4px; /* Slightly smaller border radius on mobile */
    }

    /* Mobile spacing fixes for single property pages */
    .vrg-property-back-link {
        padding-left: 20px;
    }

    .entry-content h2,
    .entry-content h3 {
        padding-left: 20px;
    }
}

@media (max-width: 1024px) and (min-width: 901px) {
    .vrg-properties-layout {
        flex-direction: column;
    }

    .vrg-map-section {
        height: 50vh;
        flex: none;
        width: 100%;
    }

    .vrg-properties-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        height: 50vh;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .vrg-properties-container {
        border-radius: 0;
        height: 100vh;
        min-height: 100vh;
    }

    /* Map is already hidden due to 900px rule */
    .vrg-properties-panel {
        height: 100vh;
    }

    .property-content {
        padding: 16px;
    }

    /* Additional mobile spacing for single property pages */
    .vrg-property-back-link {
        padding-left: 20px;
    }

    .entry-content h2,
    .entry-content h3 {
        padding-left: 20px;
    }

    .contact-buttons {
        flex-direction: column;
    }

    .contact-btn {
        justify-content: center;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        text-align: center;
    }

    .property-gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .property-gallery-thumbnail {
        aspect-ratio: 1;
    }

    @media (min-width: 480px) and (max-width: 768px) {
        .property-gallery-thumbnails {
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }
    }
}

/* Loading State */
.properties-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
}

.properties-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #0175bc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Results */
.no-properties {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.no-properties::before {
    content: '🏢';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
