/* ========================================
   Domovita Proximity Module Styles
   Version: 1.2.0
   Card-grid redesign to match the schools module aesthetic.
   ======================================== */

.dv-proximity-module {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin: 30px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .04);
}

/* -------- Header -------- */
.dv-proximity-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--dv-navy, #1f3a5f);
}

.dv-proximity-title {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--dv-navy, #1f3a5f);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.dv-proximity-title i {
    color: var(--dv-teal, #14b8a6);
    font-size: 20px;
}

.dv-proximity-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* -------- Category section -------- */
.dv-proximity-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.dv-proximity-category {
    margin: 0;
}

.dv-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px 0;
    padding: 10px 14px;
    background: linear-gradient(90deg, #f0f9ff 0%, #f8fafc 100%);
    border-left: 4px solid var(--dv-teal, #14b8a6);
    border-radius: 6px;
}

.dv-cat-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--dv-navy, #1f3a5f);
    color: #fff;
    flex-shrink: 0;
}

.dv-cat-icon i {
    font-size: 15px;
}

.dv-cat-name {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--dv-navy, #1f3a5f);
    flex: 1;
    line-height: 1.3;
}

.dv-cat-count {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* -------- POI cards grid -------- */
.dv-poi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.dv-poi-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.dv-poi-card:hover {
    border-color: var(--dv-teal, #14b8a6);
    box-shadow: 0 4px 12px rgba(20, 184, 166, .15);
    transform: translateY(-2px);
}

.dv-poi-card.is-closed-temp {
    opacity: .7;
    background: #fafafa;
}

.dv-poi-card.is-closed-temp .dv-poi-name {
    text-decoration: line-through;
    text-decoration-color: rgba(122, 43, 43, .55);
}

.dv-poi-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.dv-poi-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

.dv-poi-sub {
    font-size: 12.5px;
    color: #64748b;
    text-transform: capitalize;
}

.dv-poi-address {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Distance row */
.dv-poi-distance-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dv-poi-distance {
    font-size: 18px;
    font-weight: 700;
    color: var(--dv-teal, #0f766e);
    line-height: 1;
}

.dv-poi-walk {
    font-size: 12.5px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.dv-poi-walk i {
    font-size: 12px;
    color: var(--dv-teal, #14b8a6);
}

/* Chip row */
.dv-poi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.dv-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.35;
}

/* Distance band chips - readable contrast on all six bands (WCAG AA) */
.dv-chip-band[data-band="<0.25mi"] {
    background: #d1fae5;
    color: #065f46;
}
.dv-chip-band[data-band="0.25-0.5mi"] {
    background: #cffafe;
    color: #0e7490;
}
.dv-chip-band[data-band="0.5-1mi"] {
    background: #dbeafe;
    color: #1e40af;
}
.dv-chip-band[data-band="1-3mi"] {
    background: #fef3c7;
    color: #854d0e;
}
.dv-chip-band[data-band="3-5mi"] {
    background: #ffedd5;
    color: #9a3412;
}
.dv-chip-band[data-band="5+mi"] {
    background: #fee2e2;
    color: #991b1b;
}

/* Rating chip - subtle gold */
.dv-chip-rating {
    background: #fffbeb;
    color: #713f12;
    border: 1px solid #fde68a;
}

.dv-chip-star {
    color: #f59e0b;
    font-size: 12px;
    line-height: 1;
}

.dv-chip-count {
    color: #92400e;
    font-weight: 400;
    font-size: 11px;
    margin-left: 2px;
}

/* Chain chip - neutral */
.dv-chip-chain {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* Status chip - closed temporarily */
.dv-chip-status {
    background: #fee2e2;
    color: #7a2b2b;
    border: 1px solid #fecaca;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: .4px;
    font-weight: 600;
}

/* Ofsted chip inherits its background from inline style; ensure padding/size */
.dv-chip-ofsted {
    font-weight: 600;
}

/* -------- Footer -------- */
.dv-proximity-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.dv-proximity-note {
    margin: 0;
    font-size: 12px;
    font-style: italic;
    color: #94a3b8;
}

/* -------- Unavailable state -------- */
.dv-card-missing {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    color: #4a5568;
    margin: 12px 0 0 0;
}

.dv-card-missing-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #2d3748;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}

.dv-card-missing p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.dv-proximity-unavailable {
    opacity: .9;
}

/* -------- Responsive -------- */
@media (max-width: 767px) {
    .dv-proximity-module {
        padding: 18px;
    }

    .dv-proximity-title {
        font-size: 20px;
    }

    .dv-poi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dv-cat-header {
        padding: 8px 12px;
    }

    .dv-cat-name {
        font-size: 15px;
    }

    .dv-cat-count {
        font-size: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .dv-poi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Compact layout variant - slightly tighter cards */
.dv-proximity-module[data-layout="compact"] .dv-poi-card {
    padding: 13px 14px;
    min-height: 0;
}

.dv-proximity-module[data-layout="compact"] .dv-poi-distance {
    font-size: 17px;
}

/* -------- Print -------- */
@media print {
    .dv-proximity-module {
        border: 1px solid #000;
        page-break-inside: avoid;
        box-shadow: none;
    }

    .dv-poi-card {
        box-shadow: none;
        break-inside: avoid;
    }

    .dv-poi-card:hover {
        transform: none;
        box-shadow: none;
    }

    .dv-chip {
        border: 1px solid #333 !important;
        background: #fff !important;
        color: #000 !important;
    }
}
