/* Custom CSS for Apartments App */

/* Custom card text styling for rich content */
.card-text p,
.card-text ul,
.card-text ol {
    margin-bottom: 0.5rem;
}

/* Description content styling with brand accent */
.description-content {
    background-color: var(--brand-light-gray);
    border-left: 4px solid var(--brand-yellow);
    padding: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark);
    border-radius: 8px;
}

/* Hover effect for apartment cards */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Object fit utility for images */
.object-fit-cover {
    object-fit: cover;
}

/* CTA Banner and Smart Matches Styles */
.map-shell{position:relative;border:2px solid #ffcc00;border-radius:16px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,0.08);}
.sticky-map{position:sticky;top:88px;height:calc(100vh - 120px);}
#map{width:100%;height:100%;border-radius:16px;}
.filter-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;border:1px solid #e5e5e5;background:#fff;cursor:pointer;transition:all 0.2s ease;box-shadow:0 4px 10px rgba(0,0,0,0.04);}
.filter-chip:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(0,0,0,0.08);}
.filter-bar {
    background: #fff;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 72px; /* Adjust based on navbar height */
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.filter-dropdown .dropdown-toggle {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.filter-dropdown .dropdown-toggle:after {
    margin-left: 10px;
}
.filter-dropdown .dropdown-toggle:hover {
    border-color: #000;
    background: #f8f9fa;
}
.filter-dropdown .dropdown-menu {
    min-width: 280px;
    padding: 1.5rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 16px;
    margin-top: 10px;
}
.filter-active-indicator {
    width: 8px;
    height: 8px;
    background: #ffcc00;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.filter-popover{position:fixed;top:20%;left:50%;transform:translate(-50%,-20%);width:min(420px,90%);background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,0.2);z-index:1050;display:none;max-height:80vh;overflow-y:auto;}
.filter-popover.active{display:block;}
.popover-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.4);z-index:1040;display:none;}
.popover-backdrop.active{display:block;}
.rental-card{border:none;border-radius:12px;overflow:hidden;transition:transform 0.2s,box-shadow 0.2s;background:#fff;}
.rental-card:hover{transform:translateY(-4px);box-shadow:0 12px 24px rgba(0,0,0,0.15);}
.rental-image-container{position:relative;height:200px;overflow:hidden;background:#f0f0f0;}
.rental-price-badge{position:absolute;bottom:12px;left:12px;background:rgba(0,0,0,0.85);color:#fff;padding:6px 14px;border-radius:20px;font-weight:700;font-size:1rem;backdrop-filter:blur(8px);}
.image-count-badge{position:absolute;bottom:12px;right:12px;background:rgba(0,0,0,0.7);color:#fff;padding:4px 10px;border-radius:8px;font-size:0.85rem;font-weight:600;}
.carousel-control-prev,.carousel-control-next{width:40px;}
.carousel-control-prev-icon,.carousel-control-next-icon{background-color:rgba(0,0,0,0.5);border-radius:50%;padding:10px;}
/* Modern Light CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, #ffffff 0%, #fffbe6 100%);
    border: 1px solid #dcdde1;
    border-radius: 20px;
    padding: 48px 40px;
    color: #1a1a1a;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 204, 0, 0.15), transparent 60%);
    pointer-events: none;
}

.cta-banner h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: #000;
    text-align: center;
}

.cta-banner p {
    font-size: 1.15rem;
    color: #555;
    max-width: 650px;
    margin: 0 auto 32px;
    line-height: 1.6;
    text-align: center;
}

/* Fix for the "Sign In" button visibility in light mode */
.cta-banner .btn-outline-light {
    color: #1a1a1a;
    border-color: #1a1a1a;
}
.cta-banner .btn-outline-light:hover {
    background-color: #1a1a1a;
    color: #fff;
}

.smart-matches-section{background:#f8f9fa;border-radius:20px;padding:32px 0;margin-bottom:32px;}

/* Styled Dismiss Button */
.cta-banner .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0.8rem;
    background-size: 10px;
    transition: all 0.2s ease;
}

.cta-banner .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Apartment Overview Styles */
.carousel-item img {
    height: 500px;
    object-fit: cover;
    border-radius: 12px;
}
.sticky-sidebar {
    position: sticky;
    top: 90px;
}
.amenity-badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
}
/* ======================================================
   NEIGHBOURHOOD SCORES  (color-coded arc rings)
   ====================================================== */
.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 110px;
    gap: 4px;
}

/* SVG ring container */
.score-ring-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    margin-bottom: 6px;
}
.score-ring-wrap svg {
    transform: rotate(-90deg);
    display: block;
}
/* Prevent default black fill on all SVG children */
.score-ring-wrap svg circle {
    fill: none;
}
.score-ring-bg {
    stroke: #f1f3f5;
    stroke-width: 7;
}
.score-ring-fill {
    stroke-width: 7;
    stroke-linecap: round;
    /* stroke-dasharray / stroke-dashoffset set by JS */
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-ring-fill.ring-walk    { stroke: #10b981; }
.score-ring-fill.ring-transit { stroke: #3b82f6; }
.score-ring-fill.ring-bike    { stroke: #f59e0b; }

.score-ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 900;
    color: #111;
    letter-spacing: -0.03em;
}

.score-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-top: 2px;
}
.score-desc {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

/* Lifestyle character tags */
.lifestyle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.lifestyle-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    transition: background 0.15s, border-color 0.15s;
}
.lifestyle-tag:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}
.lifestyle-tag i { font-size: 0.72rem; opacity: 0.75; }

/* Data attribution strip */
.neighbourhood-attribution {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.neighbourhood-attribution i { font-size: 0.65rem; }

/* ======================================================
   SCHOOL RATINGS  (refined for Google Places data)
   ====================================================== */
.school-rating {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
/* Color tiers */
.rating-high  { background: #d1fae5; color: #065f46; }
.rating-mid   { background: #fef3c7; color: #92400e; }
.rating-low   { background: #fee2e2; color: #991b1b; }
.rating-none  { background: #f3f4f6; color: #9ca3af; font-size: 0.75rem; font-weight: 600; }

/* School type badge */
.school-type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stb-public  { background: #eff6ff; color: #1d4ed8; }
.stb-private { background: #fdf4ff; color: #7e22ce; }
.stb-charter { background: #fff7ed; color: #c2410c; }

/* Map Styling */
#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
}
.map-marker {
    cursor: pointer;
}

/* Travel Times Styling */
.travel-times-container {
    background: #fff;
    border-radius: 12px;
}
.transport-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.transport-btn {
    flex: 1;
    border: 1px solid #dee2e6;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
}
.transport-btn.active {
    background: var(--brand-black);
    color: #fff;
    border-color: var(--brand-black);
}
.destination-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}
.destination-item:hover {
    transform: translateX(4px);
}
.dest-icon {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--brand-black);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.dest-info {
    flex-grow: 1;
}
.dest-time {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--brand-black);
}
.remove-dest {
    color: #ced4da;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
.remove-dest:hover {
    color: #dc3545;
}

/* Mapbox Search Override */
mapbox-address-autofill {
    width: 100%;
}
.search-input-group {
    position: relative;
}
.search-input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    z-index: 10;
}
#destination-search {
    padding-left: 45px;
    border-radius: 10px;
    height: 50px;
    border: 2px solid #f1f3f5;
    transition: border-color 0.2s;
}
#destination-search:focus {
    border-color: var(--brand-yellow);
    box-shadow: none;
}

/* Broker Contact Card Styles */
.broker-contact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    position: relative;
    text-decoration: none !important;
    overflow: hidden;
    container-type: inline-size; /* Enable container queries */
}

.broker-contact-row:hover {
    background-color: #f8f9fa;
}

.broker-contact-text {
    /* Scale font size based on container width to avoid truncation */
    font-size: clamp(0.75rem, 6cqw, 0.95rem); 
    color: #212529;
    font-weight: 500;
    white-space: nowrap;
    /* Removed text-overflow: ellipsis and overflow: hidden to prefer shrinking */
    flex: 1;
    text-align: left; /* Override parent text-center */
}

.broker-contact-text .fw-bold {
    display: inline-block;
    min-width: 50px; /* Ensure values align vertically */
}

.broker-copy-btn {
    opacity: 1; /* Fully visible as requested */
    transition: background-color 0.2s;
    color: #6c757d; /* Muted text color by default */
    background: none;
    border: none;
    padding: 4px 8px; /* Slightly more padding for touch/click target */
    border-radius: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: auto; /* Push to right if in flex container, though we use gap now */
}

.broker-copy-btn:hover {
    background-color: #e9ecef;
    color: #0d6efd; /* Brand or Primary color on hover */
}

/* ======================================================
   AVAILABILITY STATUS BAR
   ====================================================== */
.availability-bar { padding: 4px 0; }

.avail-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.83rem;
    letter-spacing: 0.01em;
}
.avail-now     { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.avail-soon    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.avail-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.avail-taken   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.avail-meta {
    font-size: 0.81rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.avail-no-fee { color: #059669; font-weight: 600; }
.avail-fee    { color: #d97706; font-weight: 600; }

/* ======================================================
   CONCESSIONS BANNER
   ====================================================== */
.concessions-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fcd34d;
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 0 2px 10px rgba(252,211,77,0.25);
}
.conc-icon {
    width: 38px; height: 38px;
    background: #fbbf24;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; flex-shrink: 0;
}
.conc-body  { font-size: 0.9rem; color: #374151; }
.conc-label {
    font-weight: 700; color: #92400e;
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em;
    background: #fcd34d; padding: 2px 8px; border-radius: 4px;
    display: inline-block; margin-right: 6px;
}
.conc-highlight { font-weight: 800; color: #065f46; font-size: 1.05rem; }
.conc-sub       { color: #6b7280; font-size: 0.85rem; }

/* ======================================================
   NEARBY POIs
   ====================================================== */
.poi-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.poi-tab-btn {
    padding: 8px 16px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.poi-tab-btn:hover {
    border-color: #111;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}
.poi-tab-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}
.poi-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f9fafb;
    margin-bottom: 8px;
    border: 1px solid #f3f4f6;
    transition: transform 0.15s ease, background 0.15s ease;
}
.poi-item:hover { transform: translateX(4px); background: #f3f4f6; }
.poi-distance {
    font-size: 1rem; font-weight: 800; color: #111;
    min-width: 52px; text-align: center;
    background: #fff; border-radius: 8px;
    padding: 6px 8px; border: 1px solid #e5e7eb;
    flex-shrink: 0; line-height: 1.1;
}
.poi-distance span { font-size: 0.68rem; font-weight: 500; color: #9ca3af; display: block; }
.poi-name { font-weight: 600; font-size: 0.9rem; color: #111; }
.poi-sub  { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }

/* ======================================================
   NEIGHBORHOOD MINI-MAP
   ====================================================== */
.neighborhood-map-wrapper {
    position: relative;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
#neighborhood-mini-map { width: 100%; height: 100%; }
.nbmap-label {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.72); color: #fff;
    padding: 4px 14px; border-radius: 999px;
    font-size: 0.78rem; font-weight: 600;
    backdrop-filter: blur(4px); white-space: nowrap;
}

/* ======================================================
   INTERACTIVE MONTHLY COST ESTIMATOR
   ====================================================== */
.cost-estimator-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    background: #fff;
}
.ce-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
}
.ce-base { background: #f9fafb; }

.ce-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}
.ce-label i { color: #9ca3af; width: 16px; flex-shrink: 0; }
.ce-sub { color: #9ca3af; font-size: 0.78rem; }

.ce-val         { font-size: 0.9rem; color: #374151; white-space: nowrap; }
.ce-val-toggle  { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ce-estimate    { font-size: 0.8rem; color: #9ca3af; }

/* Badge tags */
.ce-tag {
    font-size: 0.66rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.04em;
    display: inline-block; flex-shrink: 0;
}
.ce-tag-green  { background: #d1fae5; color: #065f46; }
.ce-tag-yellow { background: #fef3c7; color: #92400e; }
.ce-tag-gray   { background: #f3f4f6; color: #6b7280; }

/* Toggle switch */
.ce-switch {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
    cursor: pointer; flex-shrink: 0;
}
.ce-switch input { opacity: 0; width: 0; height: 0; }
.ce-slider {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db; border-radius: 999px;
    transition: background 0.2s;
}
.ce-slider::before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.ce-switch input:checked + .ce-slider               { background: #111; }
.ce-switch input:checked + .ce-slider::before       { transform: translateX(18px); }

/* Total bar */
.ce-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    background: #111;
    color: #fff;
}
.ce-total-label {
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    opacity: 0.75;
}
.ce-total-val {
    font-size: 1.9rem; font-weight: 900; color: #fff;
    letter-spacing: -0.03em;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}
.ce-total-val .ce-mo { font-size: 0.9rem; font-weight: 500; opacity: 0.65; }
.ce-pulse { color: #fbbf24 !important; transform: scale(1.06) !important; }

/* Disclaimer */
.ce-disclaimer {
    padding: 10px 22px;
    background: #f9fafb;
    font-size: 0.77rem;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
}
