/**
 * Market Rent Research Styles
 * Styles for the FINN.no and Hybel.no search feature
 */

/* ===== Wrapper & Header ===== */
.market-rent-wrapper {
    margin-top: 32px;
    padding: 16px 0 0 0;
    border-top: 1px solid var(--color-border, #e0e0e0);
}

.market-rent-wrapper.hidden {
    display: none;
}

.market-rent-header {
    margin-bottom: 12px;
}

.market-rent-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary, #666);
    margin: 0;
    font-weight: 400;
}

/* ===== Button Grid ===== */
.market-rent-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
}

/* ===== Platform Buttons ===== */
.market-rent-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: white !important;
    border: 1px solid #000 !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: auto;
}

.market-rent-btn:hover {
    background: #f8f9fa !important;
    border-color: #000 !important;
}

.market-rent-btn:active {
    background: #e9ecef !important;
}

.market-rent-btn:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.market-rent-btn img {
    height: 18px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
}

.market-rent-btn span {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-primary, #1a1a1a);
}

/* ===== Modal Container ===== */
.market-rent-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.market-rent-modal.active {
    display: flex;
}

/* ===== Modal Overlay ===== */
.market-rent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* ===== Modal Content ===== */
.market-rent-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

/* ===== Modal Header ===== */
.market-rent-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.market-rent-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a1a);
}

.market-rent-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--color-text-secondary, #666);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.market-rent-close:hover {
    background: var(--color-bg-light, #f8f9fa);
    color: var(--color-text-primary, #1a1a1a);
}

.market-rent-close:focus {
    outline: 2px solid var(--color-primary, #0063fb);
    outline-offset: 2px;
}

/* ===== Modal Body ===== */
.market-rent-modal-body {
    padding: 24px;
}

/* ===== Search Parameter Sections ===== */
.search-param-section {
    margin-bottom: 20px;
}

.search-param-section:last-child {
    margin-bottom: 0;
}

.search-param-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-primary, #1a1a1a);
}

.search-param-section .uk-help {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    margin-top: 4px;
}

/* ===== Location Inputs ===== */
.location-inputs {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
}

@media (max-width: 480px) {
    .location-inputs {
        grid-template-columns: 1fr;
    }
}

/* ===== Property Type Checkboxes ===== */
.property-type-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-type-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-type-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.property-type-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

/* ===== Modal Footer ===== */
.market-rent-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--color-border, #e0e0e0);
    position: sticky;
    bottom: 0;
    background: white;
    border-radius: 0 0 12px 12px;
}

@media (max-width: 480px) {
    .market-rent-modal-footer {
        flex-direction: column-reverse;
    }

    .market-rent-modal-footer .uk-btn {
        width: 100%;
    }
}

/* ===== Search Button Icon ===== */
.market-rent-search-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Mobile Responsiveness ===== */
@media (max-width: 768px) {
    .market-rent-content {
        width: 95%;
        max-height: 85vh;
    }

    .market-rent-modal-header,
    .market-rent-modal-body,
    .market-rent-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ===== Small Mobile (Portrait) ===== */
@media (max-width: 480px) {
    .market-rent-buttons {
        max-width: 100%;
    }

    .market-rent-modal-header h3 {
        font-size: 18px;
    }

    .search-param-section {
        margin-bottom: 16px;
    }
}

/* ===== Accessibility Enhancements ===== */
@media (prefers-reduced-motion: reduce) {
    .market-rent-btn,
    .market-rent-close,
    .market-rent-overlay,
    .market-rent-content {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .market-rent-btn {
        border-width: 2px;
    }
}

/* ===== Green Styling ===== */
/* Green Button */
.market-rent-btn-green {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.market-rent-btn-green:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.market-rent-btn-green:active {
    background: #047857 !important;
    border-color: #047857 !important;
}

.market-rent-btn-green:focus {
    outline: 2px solid #10b981 !important;
    outline-offset: 2px;
}

/* Green Checkboxes */
.property-type-checkbox input[type="checkbox"] {
    accent-color: #10b981;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Fallback for browsers that don't support accent-color */
.property-type-checkbox input[type="checkbox"]:checked {
    background-color: #10b981;
    border-color: #10b981;
}

/* Green checkboxes for Hybel modal specifically */
#hybel_search_modal .property-type-checkbox input[type="checkbox"] {
    accent-color: #10b981;
}

/* ===== Print Styles ===== */
@media print {
    .market-rent-wrapper,
    .market-rent-modal {
        display: none !important;
    }
}
