/**
 * Facts & Features V2 - Modern, Clean Design
 * Inspired by Zillow, Redfin, and modern UI patterns
 */

/* ========================================
   Property Highlights (Tag System)
   ======================================== */
.mld-property-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.mld-highlight-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.2s ease;
    cursor: default;
}

/* Highlight variants */
.highlight-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.highlight-standard {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.highlight-new {
    background: #10b981;
    color: white;
}

/* ========================================
   Main Facts Grid Layout
   ======================================== */
.mld-facts-main-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

/* Section Styling */
.mld-facts-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    position: relative;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Full width section for important content */
.mld-facts-span-full {
    grid-column: 1 / -1;
}

/* Two column layout for fact items in Home Facts section */
.mld-facts-home .mld-facts-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 40px;
}

@media (max-width: 1024px) {
    .mld-facts-home .mld-facts-list {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.mld-facts-section-title {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Facts List */
.mld-facts-list {
    display: flex;
    flex-direction: column;
}

/* Individual Fact Row */
.mld-fact-row {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.15s ease;
}

.mld-fact-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mld-fact-row:first-child {
    padding-top: 0;
}

.mld-fact-row:hover {
    background: #f8f9fa;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 6px;
}

.mld-fact-content {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr;
    gap: 20px;
    align-items: flex-start;
}

.mld-fact-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.6;
}

.mld-fact-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
}

/* No data state */
.mld-no-data {
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
    padding: 12px 0;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .mld-facts-main-grid {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .mld-facts-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mld-facts-section {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .mld-facts-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mld-facts-main-grid.mld-facts-mobile {
        gap: 16px;
    }

    .mld-property-highlights {
        gap: 6px;
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .mld-highlight-tag {
        font-size: 13px;
        padding: 6px 12px;
    }

    .mld-facts-section {
        background: #ffffff;
        padding: 16px;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }

    .mld-facts-section-title {
        font-size: 16px;
        padding-bottom: 10px;
        margin-bottom: 16px;
    }

    .mld-fact-row {
        padding: 10px 0;
    }

    .mld-fact-content {
        grid-template-columns: minmax(100px, 1fr) 2fr;
        gap: 12px;
    }

    .mld-fact-label {
        font-size: 13px;
    }

    .mld-fact-value {
        font-size: 13px;
    }
}

/* ========================================
   Animation & Interactions
   ======================================== */
.mld-facts-section {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth hover effects */
.mld-fact-row {
    position: relative;
}

.mld-fact-row::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    bottom: 0;
    background: transparent;
    border-radius: 6px;
    transition: background 0.15s ease;
    z-index: -1;
}

.mld-fact-row:hover::before {
    background: #f9fafb;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .mld-property-highlights {
        page-break-inside: avoid;
    }

    .mld-facts-section {
        page-break-inside: avoid;
        border: 1px solid #e5e7eb;
        padding: 12px;
    }

    .mld-highlight-tag {
        border: 1px solid #d1d5db;
        background: white !important;
        color: #374151 !important;
    }
}

/* ========================================
   Expanded Details (Show More Pattern)
   ======================================== */
.mld-facts-expandable {
    max-height: 300px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.mld-facts-expandable.expanded {
    max-height: none;
}

.mld-facts-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mld-facts-expand-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.mld-facts-expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.mld-facts-expand-btn.expanded svg {
    transform: rotate(180deg);
}

/* ========================================
   Custom Scrollbar for Long Lists
   ======================================== */
.mld-facts-list::-webkit-scrollbar {
    width: 6px;
}

.mld-facts-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

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

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

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .mld-facts-section {
        background: #1f2937;
    }

    .mld-facts-section-title {
        color: #f9fafb;
        border-bottom-color: #374151;
    }

    .mld-fact-label {
        color: #9ca3af;
    }

    .mld-fact-value {
        color: #f3f4f6;
    }

    .mld-fact-row:hover {
        background: #374151;
    }

    .mld-property-highlights {
        border-bottom-color: #374151;
    }

    .highlight-standard {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }

    .mld-no-data {
        color: #6b7280;
    }
}