/* ═══════════════════════════════════════════════════════════
   entities.css — Floor plan, Legend, Entity list / cards,
                  Itinerary panel
   ═══════════════════════════════════════════════════════════ */

/* ========== Floor plan ========== */
.floor-plan-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: auto;
}

.floor-plan-container svg {
    max-width: 100%;
    height: auto;
}

/* SVG entity hover/click effects */
.floor-plan-container svg [id^="desk-"],
.floor-plan-container svg [id^="office-"],
.floor-plan-container svg [id^="seminar-"],
.floor-plan-container svg [id^="hotdesk-"] {
    cursor: pointer;
    transition: opacity 0.2s;
}

.floor-plan-container svg [id^="desk-"]:hover,
.floor-plan-container svg [id^="office-"]:hover,
.floor-plan-container svg [id^="seminar-"]:hover,
.floor-plan-container svg [id^="hotdesk-"]:hover {
    opacity: 0.8;
    stroke-width: 3;
}

/* ========== Legend ========== */
.legend {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

/* ========== Itinerary panel ========== */
.itinerary-panel {
    background: white;
    border: 2px solid var(--brand, #45a349);
    border-radius: 6px;
    padding: 1rem;
    position: sticky;
    top: 1rem;
}

.itinerary-panel h3 {
    color: var(--brand-dark, #367f39);
    margin-bottom: 0.75rem;
}

.itinerary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.itinerary-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e5e7eb;
    font-weight: 700;
    text-align: right;
}

.itinerary-office-group {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #fafafa;
}

.itinerary-office-group .office-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.itinerary-office-group .sub-item {
    padding: 0.25rem 0 0.25rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.85rem;
}

.itinerary-office-group .sub-item:last-child {
    border-bottom: none;
}

/* ========== Entity list (used when no SVG) ========== */
.entity-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.entity-card {
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.entity-card:hover {
    border-color: var(--brand, #45a349);
    box-shadow: 0 2px 4px rgba(69, 163, 73, 0.12);
}

.entity-card.selected {
    border-color: var(--brand, #45a349);
    background: var(--brand-muted, #edf7ee);
}

.entity-card.unavailable {
    cursor: not-allowed;
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
}
.entity-card.unavailable .entity-name {
    color: #6b7280;
}
.entity-card.unavailable .entity-type {
    color: #9ca3af;
}
/* Notify buttons stay fully visible and clickable */
.entity-card.unavailable form,
.entity-card.unavailable .notify-active {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}
.entity-card.unavailable form .btn {
    cursor: pointer;
}

.entity-card .entity-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.entity-card .entity-type {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ========== Campus map ========== */
.campus-map-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.campus-map {
    max-width: 665px;
    width: 100%;
    height: auto;
    display: block;
}

/* Building overlays — transparent by default, highlight on hover */
.campus-bldg-rect {
    fill: transparent;
    pointer-events: all;
    transition: fill 0.15s, stroke 0.15s;
}

.campus-bldg--inactive .campus-bldg-rect {
    fill: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.campus-bldg--active {
    cursor: pointer;
}

.campus-bldg--active:hover .campus-bldg-rect,
.campus-bldg--active:focus .campus-bldg-rect {
    fill: rgba(69, 163, 73, 0.38);
    stroke: #367f39;
    stroke-width: 2;
}

.campus-bldg--active:focus {
    outline: none;
}

.campus-bldg--active:focus-visible .campus-bldg-rect {
    stroke: #1d4ed8;
    stroke-width: 3;
}

/* Hover tooltip */
.campus-tooltip {
    position: fixed;
    background: #1a3d1c;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1.5;
}


@media (max-width: 640px) {
    .campus-map { max-width: 100%; }
    .campus-map-container { padding: 1rem; }
}
