/**
 * Market Overview Page Styles
 * Extracted from inline styles for better maintainability and caching
 */

/* ==========================================================================
   Floating Sidebar (Currency & Unit Selectors)
   ========================================================================== */

.floating-sidebar {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-widget .widget-label {
    font-size: 12px;
    font-weight: 600;
    color: #1a472a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-align: center;
}

.sidebar-widget a,
.sidebar-widget button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #fff;
    color: #1a472a;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid #1a472a;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    outline: none;
}

.sidebar-widget a:hover,
.sidebar-widget button:hover {
    background-color: #f0f7f4;
    transform: scale(1.1);
}

.sidebar-widget button.active {
    background-color: #1a472a;
    color: #fff;
    box-shadow: 0 2px 12px rgba(45, 106, 79, 0.4);
}

#unit-widget button {
    font-size: 15px;
}

.sidebar-widget a i {
    font-size: 18px;
}

/* Hide sidebar on smaller screens */
@media (max-width: 900px) {
    .floating-sidebar {
        display: none;
    }
}

/* ==========================================================================
   Mobile Bottom Bar
   ========================================================================== */

.mobile-bottom-bar {
    display: none;
}

@media (max-width: 900px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        justify-content: center;
        align-items: center;
        gap: 20px;
    }

    .mobile-bar-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-bar-label {
        font-size: 11px;
        font-weight: 600;
        color: #1a472a;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-bar-buttons {
        display: flex;
        gap: 4px;
    }

    .mobile-bar-buttons button {
        padding: 6px 10px;
        border: 1px solid #1a472a;
        border-radius: 4px;
        background-color: #fff;
        color: #1a472a;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-bar-buttons button:hover {
        background-color: #f0f7f4;
    }

    .mobile-bar-buttons button.active {
        background-color: #1a472a;
        color: #fff;
    }

    .mobile-bar-divider {
        width: 1px;
        height: 24px;
        background-color: #ddd;
    }

    /* Add bottom padding to page so content isn't hidden behind the toolbar */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
}

/* ==========================================================================
   Misc Utility Classes
   ========================================================================== */

/* Hide icons in Neighborhood Hotspots section on smaller screens */
@media (max-width: 767px) {
    .neighborhoodhotspots .icon--green {
        display: none!important;
    }
    .neighborhoodhotspots .hotspot {
        margin-bottom:0px!important;
        padding-top:0px!important;
    }

    .neighborhoodhotspots {
        padding-bottom: 0px!important;
    }
}

/* ==========================================================================
   Inline Share Widget
   ========================================================================== */

.inline-share-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.inline-share-widget .share-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a472a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 8px;
}

.inline-share-widget .share-label .mobile-text {
    display: none;
}

@media (max-width: 576px) {
    .inline-share-widget .share-label .desktop-text {
        display: none;
    }
    .inline-share-widget .share-label .mobile-text {
        display: inline;
    }
}

.inline-share-widget a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a472a;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.inline-share-widget a:hover {
    background-color: #2d6a4f;
    transform: scale(1.1);
}

.inline-share-widget a i {
    font-size: 16px;
}

/* ==========================================================================
   Inline Currency Introduction Section
   ========================================================================== */

.inline-currency-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    margin: 50px 0;
    background: linear-gradient(135deg, #f0f7f4 0%, #e8f5e9 100%);
    border-radius: 12px;
    border: 1px solid #c8e6c9;
}

.inline-currency-intro .intro-text {
    margin-bottom: 16px;
}

.inline-currency-intro .intro-text p {
    margin: 0;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.inline-currency-selector {
    display: flex;
    gap: 8px;
}

.inline-currency-selector .currency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: #fff;
    color: #1a472a;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #1a472a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.inline-currency-selector .currency-btn:hover {
    background-color: #f0f7f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.inline-currency-selector .currency-btn.active {
    background-color: #1a472a;
    color: #fff;
    box-shadow: 0 2px 12px rgba(45, 106, 79, 0.4);
}

@media (max-width: 576px) {
    .inline-currency-intro {
        padding: 20px 16px;
    }

    .inline-currency-intro .intro-text p {
        font-size: 14px;
    }

    .inline-currency-selector .currency-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Inline Unit Selection Section
   ========================================================================== */

.inline-unit-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    margin: 50px 0;
    background: linear-gradient(135deg, #f0f7f4 0%, #e8f5e9 100%);
    border-radius: 12px;
    border: 1px solid #c8e6c9;
}

.inline-unit-intro .intro-text {
    margin-bottom: 16px;
}

.inline-unit-intro .intro-text p {
    margin: 0;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.inline-unit-selector {
    display: flex;
    gap: 8px;
}

.inline-unit-selector .unit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    background-color: #fff;
    color: #1a472a;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #1a472a;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.inline-unit-selector .unit-btn:hover {
    background-color: #f0f7f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.inline-unit-selector .unit-btn.active {
    background-color: #1a472a;
    color: #fff;
    box-shadow: 0 2px 12px rgba(45, 106, 79, 0.4);
}

@media (max-width: 576px) {
    .inline-unit-intro {
        padding: 20px 16px;
    }

    .inline-unit-intro .intro-text p {
        font-size: 14px;
    }

    .inline-unit-selector .unit-btn {
        padding: 8px 20px;
        font-size: 15px;
    }
}

/* ==========================================================================
   Price Distribution Table
   ========================================================================== */

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
}

.price-table th {
    background-color: #1a472a;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-table th:last-child {
    text-align: right;
}

.price-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.price-table td:last-child {
    text-align: right;
}

.price-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.price-table tr:hover {
    background-color: #f0f7f2;
}

.price-table .price-range {
    font-weight: 500;
    color: #333;
}

.price-table .listings {
    color: #666;
}

.price-table .percentage {
    font-weight: 600;
    color: #1a472a;
}

/* ==========================================================================
   Property Card Images
   ========================================================================== */

.property-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-card-image .photo-credit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    font-size: 11px;
    color: #666;
}

/* ==========================================================================
   Resort Data Table
   ========================================================================== */

.resort-table-container {
    overflow-x: auto;
}

.resort-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    min-width: 600px;
}

.resort-table th {
    background-color: #1a472a;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.resort-table th:hover {
    background-color: #2d6a4f;
}

.resort-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.4;
    font-size: 10px;
    vertical-align: middle;
}

.resort-table th:hover .sort-icon {
    opacity: 0.7;
}

.resort-table th.sort-asc .sort-icon,
.resort-table th.sort-desc .sort-icon {
    opacity: 1;
}

.resort-table th.sort-asc .sort-icon::before {
    content: "\25B2"; /* ▲ */
}

.resort-table th.sort-desc .sort-icon::before {
    content: "\25BC"; /* ▼ */
}

.resort-table th:not(.sort-asc):not(.sort-desc) .sort-icon::before {
    content: "\21C5"; /* ⇅ */
}

.resort-table th:not(:first-child) {
    text-align: right;
}

.resort-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.resort-table td:not(:first-child) {
    text-align: right;
}

.resort-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.resort-table tr:hover {
    background-color: #f0f7f2;
}

.resort-table .resort-name {
    font-weight: 500;
    color: #333;
    text-transform: capitalize;
}

.resort-table .no-data {
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   Realtor Data Table
   ========================================================================== */

.realtor-table-container {
    overflow-x: auto;
}

.realtor-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    min-width: 500px;
}

.realtor-table th {
    background-color: #1a472a;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.realtor-table th:hover {
    background-color: #2d6a4f;
}

.realtor-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.4;
    font-size: 10px;
    vertical-align: middle;
}

.realtor-table th:hover .sort-icon {
    opacity: 0.7;
}

.realtor-table th.sort-asc .sort-icon,
.realtor-table th.sort-desc .sort-icon {
    opacity: 1;
}

.realtor-table th.sort-asc .sort-icon::before {
    content: "\25B2"; /* ▲ */
}

.realtor-table th.sort-desc .sort-icon::before {
    content: "\25BC"; /* ▼ */
}

.realtor-table th:not(.sort-asc):not(.sort-desc) .sort-icon::before {
    content: "\21C5"; /* ⇅ */
}

.realtor-table th:not(:first-child) {
    text-align: right;
}

.realtor-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.realtor-table td:not(:first-child) {
    text-align: right;
}

.realtor-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.realtor-table tr:hover {
    background-color: #f0f7f2;
}

.realtor-table .realtor-name {
    font-weight: 500;
    color: #333;
}

.realtor-table .realtor-name a {
    color: #1a472a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.realtor-table .realtor-name a:hover {
    color: #2d6a4f;
    text-decoration: underline;
}

.realtor-table .no-data {
    color: #999;
    font-style: italic;
}

/* Hidden rows for expandable functionality */
.realtor-table tr.hidden-row {
    display: none;
}

.realtor-table-container.expanded tr.hidden-row {
    display: table-row;
}

/* Toggle button */
.realtor-table-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 0;
    padding: 14px 20px;
    background: #f0f7f4;
    border: 1px solid #c8e6c9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: #1a472a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.realtor-table-toggle:hover {
    background: #e8f5e9;
}

.realtor-table-toggle i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.realtor-table-container.expanded .realtor-table-toggle i {
    transform: rotate(180deg);
}

.realtor-table-container.expanded .realtor-table-toggle .toggle-text::before {
    content: "Show less";
}

.realtor-table-container.expanded .realtor-table-toggle .toggle-text {
    font-size: 0;
}

.realtor-table-container.expanded .realtor-table-toggle .toggle-text::before {
    font-size: 14px;
}

/* ==========================================================================
   Embed Map Button
   ========================================================================== */

.embed-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.embed-map-btn:hover {
    border-color: #1a472a;
    color: #1a472a;
    background: #f0f7f4;
}

.embed-map-btn i {
    font-size: 14px;
}

/* Download Image Button */
.download-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    margin-right: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.download-image-btn:hover {
    border-color: #1a472a;
    color: #1a472a;
    background: #f0f7f4;
    text-decoration: none;
}

.download-image-btn i {
    font-size: 14px;
}

/* Download Excel Button */
.download-excel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-excel-btn:hover {
    border-color: #1a472a;
    color: #1a472a;
    background: #f0f7f4;
}

.download-excel-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.download-excel-btn i {
    font-size: 14px;
}

/* Spinning animation for loading state */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.download-excel-btn i.icon-loader {
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Embed Modal
   ========================================================================== */

.embed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.embed-modal.active {
    display: flex;
}

.embed-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.embed-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.embed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.embed-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a472a;
    margin: 0;
}

.embed-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.embed-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.embed-modal-body {
    padding: 24px;
}

.embed-option-section {
    margin-bottom: 20px;
}

.embed-option-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

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

.embed-currency-btn,
.embed-unit-btn {
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.embed-currency-btn:hover,
.embed-unit-btn:hover {
    border-color: #1a472a;
    background: #f0f7f4;
}

.embed-currency-btn.active,
.embed-unit-btn.active {
    border-color: #1a472a;
    background: #1a472a;
    color: #fff;
}

.embed-code-section {
    margin-top: 24px;
}

.embed-code-section .embed-option-label {
    margin-bottom: 8px;
}

.embed-code-preview {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    background: #f9f9f9;
    resize: vertical;
}

.embed-code-preview:focus {
    outline: none;
    border-color: #1a472a;
}

.embed-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 24px;
    background: #1a472a;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.embed-copy-btn:hover {
    background: #2d6a4f;
}

.embed-copy-btn.copied {
    background: #27ae60;
}

.embed-copy-btn i {
    font-size: 16px;
}

/* Responsive embed modal */
@media (max-width: 576px) {
    .embed-modal-content {
        width: 95%;
        margin: 10px;
    }

    .embed-modal-header {
        padding: 16px 20px;
    }

    .embed-modal-body {
        padding: 20px;
    }

    .embed-modal-title {
        font-size: 16px;
    }

    .embed-currency-btn,
    .embed-unit-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .embed-code-preview {
        font-size: 11px;
        height: 100px;
    }
}

