/* ============================================
   Floor Plan Specific Styles
   ============================================ */

/* Building Overview Grid */
.building-overview {
    animation: fadeIn 0.3s ease-in;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.building-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-compact {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-card-compact .stat-icon {
    font-size: 2rem;
}

/* Floor Grid */
.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.floor-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.floor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--brand-secondary);
}

.floor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.floor-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.floor-status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.floor-status-badge.empty {
    background: rgba(14, 165, 233, 0.15);
    color: var(--info-color);
}

.floor-status-badge.light {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.floor-status-badge.moderate {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.floor-status-badge.busy {
    background: rgba(217, 24, 33, 0.15);
    color: var(--brand-action);
}

.floor-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.floor-card-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floor-card-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.floor-card-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.floor-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-view-floor {
    width: 100%;
    padding: 0.75rem;
    background: var(--brand-action);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-view-floor:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Floor Detail View */
.floor-detail-view {
    animation: fadeIn 0.3s ease-in;
}

.floor-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.floor-stats {
    display: flex;
    gap: 2rem;
}

.floor-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.floor-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floor-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Floor Map Container */
.floor-map-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.floor-map-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #102c52 0%, #1a3d6b 100%);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.floor-map-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
    border: 2px solid var(--brand-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0.92;
    transition: opacity var(--transition-base);
    /* Reduce harsh white and blend with dark background */
    filter: brightness(0.9) contrast(1.05);
    background: #f5f5f5;
}

.floor-map-image:hover {
    opacity: 0.98;
    filter: brightness(0.95) contrast(1.05);
}

/* Room Overlays */
.room-overlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.room-overlay {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: help;
    animation: popIn 0.3s ease-out;
}

.room-overlay-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-lg);
    border: 3px solid white;
    transition: all var(--transition-base);
}

.room-overlay:hover .room-overlay-indicator {
    transform: scale(1.2);
    box-shadow: var(--shadow-xl);
}

.room-overlay-indicator.empty {
    background: var(--info-color);
}

.room-overlay-indicator.light {
    background: var(--success-color);
}

.room-overlay-indicator.moderate {
    background: var(--warning-color);
}

.room-overlay-indicator.busy {
    background: var(--brand-action);
}

.room-overlay-indicator.no-data {
    background: #6b7280;
    opacity: 0.7;
    border-style: dashed;
}

.room-overlay-label {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 44, 82, 0.95);
    color: var(--brand-secondary);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.no-map-message {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Floor Legend */
.floor-legend {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.floor-legend h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.legend-indicator.empty {
    background: var(--info-color);
}

.legend-indicator.light {
    background: var(--success-color);
}

.legend-indicator.moderate {
    background: var(--warning-color);
}

.legend-indicator.busy {
    background: var(--brand-action);
}

.legend-indicator.no-camera {
    background: var(--text-dim);
}

.legend-indicator.no-data {
    background: #6b7280;
    opacity: 0.7;
    border-style: dashed;
}

.legend-item span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Room List */
.room-list {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.room-list h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.room-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.room-list-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all var(--transition-fast);
}

.room-list-item:hover {
    border-color: var(--brand-secondary);
    box-shadow: var(--shadow-sm);
}

.room-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.room-list-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.room-list-item-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.room-list-item-badge.empty {
    background: rgba(14, 165, 233, 0.15);
    color: var(--info-color);
}

.room-list-item-badge.light {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.room-list-item-badge.moderate {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.room-list-item-badge.busy {
    background: rgba(217, 24, 33, 0.15);
    color: var(--brand-action);
}

.room-list-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.room-list-item-count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.room-list-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.room-list-item-id {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.no-data-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--brand-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .floor-grid {
        grid-template-columns: 1fr;
    }
    
    .floor-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .floor-stats {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .room-list-grid {
        grid-template-columns: 1fr;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-secondary,
    .refresh-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .building-stats {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .floor-number {
        font-size: 1.5rem;
    }
}
